rainbowcreatures / FlashyWrappers

AIR / Flash video recording SDK
17 stars 10 forks source link

Android: Video Encoding progress do not completed #34

Open jkpatel1463 opened 6 years ago

jkpatel1463 commented 6 years ago

Environment

Problem Description

Steps to Reproduce

  1. Open the app
  2. Tap a button to start video creation process
  3. Animation flickered after 2 to 3 seconds.
rainbowcreatures commented 6 years ago

Hi, thanks for the report. The flicker is a known issue in some situations, though I saw it mostly happening when video camera was displaying a video. Does the app display video camera output on screen?

Android device log would help me to determine why the encoding didn't complete, otherwise there's no chance to tell.

Also if you can, try to record in software mode:

1) see if you observe the flicker (I think you shouldn't) 2) see if you can finish the encoding

Thanks

jkpatel1463 commented 6 years ago

Hello @rainbowcreatures

Please find the log in the link: https://www.dropbox.com/s/2k5iaj17b9fm7dg/FWlog.txt?dl=0

jkpatel1463 commented 6 years ago

Hello @rainbowcreature

I found that when i start the recording with software method by belowcode, it do not record the video and directl shows merge video log

Here is the code for starting the recording for android:

_fwEncoder.start(24, FWVideoEncoder.AUDIO_STEREO, false);
_fwEncoder.forcePTSMode(FWVideoEncoder.PTS_REALTIME);   //  force software mode to work in realtime      
_fwEncoder.forceFramedropMode(FWVideoEncoder.FRAMEDROP_ON);   //  force software mode to work in realtime

Here is the log message i get instantly after starting the record.

[FlashyWrappers] Merged file path: /storage/emulated/0/Android/data/air.app_package_id/files/video_merged.mp4

jkpatel1463 commented 6 years ago

Hello @rainbowcreatures

Am i doing any mistake in starting record with software mode ?

rainbowcreatures commented 6 years ago

This seems weird, the first log is only the "clean" FWLog, I'd need complete device log for the whole of the recording session. Also set FW logging to "verbose" mode before starting:

[http://flashywrappers.com/asdoc/com/rainbowcreatures/FWVideoEncoder.html#setLogging()](http://flashywrappers.com/asdoc/com/rainbowcreatures/FWVideoEncoder.html#setLogging())

Android Studio device log

jkpatel1463 commented 6 years ago

Hello @rainbowcreatures I have set loggin as verbose, As per your instruction _fwEncoder.setLogging(FWVideoEncoder.LOGGING_VERBOSE);

Here is Android studio device log: https://www.dropbox.com/s/ng5t8gntc94199r/Flashy_wrapper_Android%20Studio%20device%20log.txt?dl=0

i found that plugin is crashed. Here are the stacktrace of crash:

09-20 10:30:30.848 29274-29927/? I/ACodec: setupVideoEncoder succeeded
09-20 10:30:30.863 29274-29925/? E/[EGL-ERROR]: EGLBoolean __egl_platform_create_surface_window(egl_surface*, mali_base_ctx_handle):787: [__egl_platform_create_surface_window]: dequeueBuffer fail on native win 0x5b39c008, buffer 0x0
09-20 10:30:30.868 29274-29925/? W/System.err: java.lang.Exception: eglCreateWindowSurface: EGL error: 0x3003
09-20 10:30:30.868 29274-29925/? W/System.err:     at com.rainbowcreatures.FlashyWrappersAndroidHW.ae.a(Unknown Source)
09-20 10:30:30.868 29274-29274/? I/[FlashyWrappers]: Waiting for composer to start...
09-20 10:30:30.868 29274-29925/? W/System.err:     at com.rainbowcreatures.FlashyWrappersAndroidHW.ae.<init>(Unknown Source)
09-20 10:30:30.868 29274-29925/? W/System.err:     at com.rainbowcreatures.FlashyWrappersAndroidHW.z.a(Unknown Source)
09-20 10:30:30.868 29274-29925/? W/System.err:     at com.rainbowcreatures.FlashyWrappersAndroidHW.ag.handleMessage(Unknown Source)
09-20 10:30:30.868 29274-29925/? W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 10:30:30.868 29274-29925/? W/System.err:     at android.os.Looper.loop(Looper.java:176)
09-20 10:30:30.868 29274-29925/? W/System.err:     at com.rainbowcreatures.FlashyWrappersAndroidHW.af.run(Unknown Source)
09-20 10:30:30.868 29274-29925/? W/System.err:     at java.lang.Thread.run(Thread.java:841)
09-20 10:30:30.868 29274-29925/? I/[FlashyWrappers]: Finishing composerRunnable loop...
rainbowcreatures commented 6 years ago

Nice catch @jkpatel1463 , so its in OpenGL (eglX messages). This is a low-level issue. It is something specific to this Android device make/model/Android or GL ES implementation. Without having the exact device here this will be hard to debug.

The only weird thing I see is width and height reported as -1 by Android before initialization.

You might try swapping around couple resolutions when initializing recording, that's the only thing that seemed to sometimes help with weird GL ES implementations. I particularly remember there were strange issues with the Mali GPU's, unfortunately. Maybe try forcing 1280x720 (or even lower, but something "safe", ie same as Android screen resolution):

myEncoder.setDimensions(1280, 720);
myEncoder.start(....);

Software mode won't help with this, as the video composer I'm using to render the final video uses GL ES as well (I could add one that doesn't use GL ES, but making fallback purely software mode seemed like overkill, its not too trivial and might bring its own issues).