uestccokey / EZFilter

A lightweight (<180KB), easy-to-extend Android filter and dynamic sticker framework for adding filters and stickers for camera, video, bitmap and view.(一个轻量级(<180KB)、易扩展的Android滤镜和动态贴纸框架,支持摄像头、视频、图片和视图添加滤镜和贴纸。)
MIT License
208 stars 57 forks source link

Compatibility errors #24

Closed jackaru closed 6 years ago

jackaru commented 6 years ago

I've seen that in some devices tested by google play console, the app will crash only if he choose a filter that include double filters rendering.

image

"no main() in shader", but it exist

I don't know where is the problem 'cause is not the android version as you can see

image

uestccokey commented 6 years ago

can you share you shader?I can test in my pixel

jackaru commented 6 years ago

gba1: censored gba2: censored And mRenderPipeline.addFilterRender(new gba1()); mRenderPipeline.addFilterRender(new gba2());

In my android it works well

uestccokey commented 6 years ago

I have test your shader in my pixel, find the same error "ERROR: 0:13: '8.' : Syntax error: syntax error". so i change the shader "const vec4 color1 = vec4(008. / 255., 025. / 255., 032. / 255., 1.);\n" + "const vec4 color2 = vec4(050. / 255., 106. / 255., 079. / 255., 1.);\n" + "const vec4 color3 = vec4(137. / 255., 192. / 255., 111. / 255., 1.);\n" + "const vec4 color4 = vec4(223. / 255., 246. / 255., 208. / 255., 1.);\n" + to "const vec4 color1 = vec4(8. / 255., 025. / 255., 032. / 255., 1.);\n" + "const vec4 color2 = vec4(050. / 255., 106. / 255., 079. / 255., 1.);\n" + "const vec4 color3 = vec4(137. / 255., 192. / 255., 111. / 255., 1.);\n" + "const vec4 color4 = vec4(223. / 255., 246. / 255., 208. / 255., 1.);\n" + then find the similar error "ERROR: 0:14: '9.' : Syntax error: syntax error" so i change the shader to "const vec4 color1 = vec4(8. / 255., 025. / 255., 032. / 255., 1.);\n" + "const vec4 color2 = vec4(050. / 255., 106. / 255., 79. / 255., 1.);\n" + "const vec4 color3 = vec4(137. / 255., 192. / 255., 111. / 255., 1.);\n" + "const vec4 color4 = vec4(223. / 255., 246. / 255., 208. / 255., 1.);\n" + then it can work. so i think 008 and 079 it's erroneous octal numbers. When the number begins with 0, some mobile phones use the whole number as an octal number

jackaru commented 6 years ago

Thanks, you helped me a lot since I'm still a learner with shaders, I will test it in Google Console if it's working with all devices. Another micro issue is why is unsupported to take photo or video with a saved video by the app?

uestccokey commented 6 years ago

take photo or video with a saved video? you can see the VideoFilterActivity.java in develop branch, should be supported,

jackaru commented 6 years ago

Yah, I missed something with photo that says me "unsupported" and already solved it, but with an imported video I can't use startRecording and stopRecording functions.. I'm alright?

uestccokey commented 6 years ago

why? RenderPipeline always has startRecording and stopRecording functions.you say you can't, is it mean will crash?

uestccokey commented 6 years ago

mRenderPipeline = EZFilter.input(mCurrentUri) .addFilter(new BWRender(VideoFilterActivity.this)) .enableRecord("/sdcard/recordVideo.mp4", true, false) .setPreparedListener(new IMediaPlayer.OnPreparedListener() { @Override public void onPrepared(IMediaPlayer var1) { Log.e("VideoFilterActivity", "onPrepared"); } }) .setCompletionListener(new IMediaPlayer.OnCompletionListener() { @Override public void onCompletion(IMediaPlayer var1) { Log.e("VideoFilterActivity", "onCompletion"); } }) .into(mRenderView); I have test in demo, it can work

jackaru commented 6 years ago

Thanks, I don't know why but it's working only with WhatsApp videos, camera videos is crashing every time with this code

new Thread() { public void run() { mRenderPipeline = EZFilter.input(Uri.parse(paths.get(0))) .setLoop(true) .enableRecord(getPath(1), true, true) .setPreparedListener(var1 -> Log.e("VideoFilterActivity", "onPrepared")) .setCompletionListener(var1 -> Log.e("VideoFilterActivity", "onCompletion")) .into(mRenderView); } }.start();

jackaru commented 6 years ago

Error. image

jackaru commented 6 years ago

Update: is not working only with vertical orientation camera videos

uestccokey commented 6 years ago

what's the width and height of camera videos?

jackaru commented 6 years ago

1920 x 1080