MasayukiSuda / Mp4Composer-android

This library generate an Mp4 movie using Android MediaCodec API and apply filter, scale, trim, transcode, crop, timeScale, mute and rotate Mp4.
MIT License
956 stars 219 forks source link

Surface frame wait timed out #112

Open ibanxpertai opened 2 years ago

ibanxpertai commented 2 years ago

With some videos it is working fine but with other ones I am getting this error. I am doing it in a new thread so it is not the main Thread.

2022-05-02 16:47:08.488 5564-5564/com.ayoba.ayoba.pre.debug E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ayoba.ayoba.pre.debug, PID: 5564 io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.RuntimeException: Surface frame wait timed out at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704) at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701) at io.reactivex.internal.observers.ConsumerSingleObserver.onError(ConsumerSingleObserver.java:46) at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79) at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:220) at android.app.ActivityThread.main(ActivityThread.java:6929) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870) Caused by: java.lang.RuntimeException: Surface frame wait timed out at com.daasuu.mp4compose.composer.DecoderSurface.awaitNewImage(DecoderSurface.java:144) at com.daasuu.mp4compose.composer.VideoComposer.drainDecoder(VideoComposer.java:197) at com.daasuu.mp4compose.composer.VideoComposer.stepPipeline(VideoComposer.java:112) at com.daasuu.mp4compose.composer.Mp4ComposerEngine.runPipelines(Mp4ComposerEngine.java:178) at com.daasuu.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:121) at com.daasuu.mp4compose.composer.Mp4Composer$1.run(Mp4Composer.java:196) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:798)