AbedElazizShe / light_compressor

A powerful and easy-to-use video compression plugin for Flutter.
MIT License
59 stars 32 forks source link

Problem on Android while compressing #17

Closed Tom3652 closed 1 year ago

Tom3652 commented 2 years ago

Hello again,

Here are the logs from my Android device using the same code as in IOS :

E/Compressor(27830): java.lang.IllegalStateException
E/Compressor(27830):    at android.media.MediaExtractor.getSampleTrackIndex(Native Method)
E/Compressor(27830):    at com.abedelazizshe.lightcompressorlibrary.compressor.Compressor.start(Compressor.kt:242)
E/Compressor(27830):    at com.abedelazizshe.lightcompressorlibrary.compressor.Compressor.compressVideo(Compressor.kt:160)
E/Compressor(27830):    at com.abedelazizshe.lightcompressorlibrary.VideoCompressor$startCompression$2.invokeSuspend(VideoCompressor.kt:114)
E/Compressor(27830):    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/Compressor(27830):    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/Compressor(27830):    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
E/Compressor(27830):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
E/Compressor(27830):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
E/Compressor(27830):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

What may be causing this please ?

AbedElazizShe commented 2 years ago

@Tom3652 thank you for opening this issue. I'd appriciate if you can share a sample video with me that is having this issue. It seems audio or video track is not usual.

Can you confirm if this is happening with all your videos? Sharing the device's brand could be helpfull too.

Thank you.

Tom3652 commented 2 years ago

Hi @AbedElazizShe thanks for the reply.

No this happened actually rarely and definitely not on all videos.
I don't remember which video it was by now, but i can confirm that the video was a .mp4 and playing fine without compression.

The phone was a OPPO under Android SDK 29.