IllegalStateException while compressing video on "dequeueOutputBuffer ()"

I also checked several or more similar questions, but none of them had a satisfactory answer.

My requirement is to compress the video to approx. 1-2 minutes. The video size limit in my app is 500MB and the duration limit is 4 minutes.

The commands I've tried are -

-i / storage / sdcard0 / Videos / Lat_test.mp4 -r 20 -vcodec mpeg4 -preset ultrafast -c: copy -tune fastdecode -page -2 -b: v 150k / storage / sdcard 0 / Videos / output.mp4

-y -i / storage / sdcard0 / Videos / test3.mp4 -crf 24 -vcodec mpeg4 -preset ultrafast -c: copy -me_method zero -tune fastdecode -tune zerolatency -strict -2 -b: v 1000k -pix_fmt yuv420p / storage /sdcard0/Videos/output.mp4

and a few more mentioned here

1) https://github.com/Tourenathan-G5organisation/SiliCompressor (the one using MediaCodec instead of FFMPEG).

2) https://github.com/lalongooo/VideoCompressor

When you tried with Samsung Galaxy Grand GT-i9082 version 5.0.1 (root) it fails below error -

> java.lang.IllegalStateException
> at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
> at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033)
> at com.iceteck.silicompressorr.videocompression.MediaController.convertVideo(MediaController.java:491)
> at com.iceteck.silicompressorr.SiliCompressor.compressVideo(SiliCompressor.java:300)
> at com.iceteck.silicompressor.SelectPictureActivity$VideoCompressAsyncTask.doInBackground(SelectPictureActivity.java:379)
> at com.iceteck.silicompressor.SelectPictureActivity$VideoCompressAsyncTask.doInBackground(SelectPictureActivity.java:358)
> at android.os.AsyncTask$2.call(AsyncTask.java:288)
> at java.util.concurrent.FutureTask.run(FutureTask.java:237)
> at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> at java.lang.Thread.run(Thread.java:818)

      

Please suggest to solve this problem.

Or please suggest any other better video compressing approach / sample / reference

if possible

I've tried various examples of video compression using FFMPEG as well as MediaCodec, but none of them work well. Some are very slow. and the rest fails across multiple devices.

+3


source to share





All Articles