Ankita Shah Ankita Shah - 1 month ago 20
Android Question

How to compress video?

I want to compress video which is either recorded from camera or stored video. And I want to upload compressed video to server. Please help me.

Answer

Here are some well known demo projects and guidelines for ffmpeg-android

https://github.com/guardianproject/android-ffmpeg

https://github.com/WritingMinds/ffmpeg-android-java

And Here is the well described answer if you want to configure latest version of ffmpeg by yourself.

Command for compressing video that I have been using :

String command = "ffmpeg -y -i inputVideoPath -s widthxheight -r 23 -c:v libx264 -preset ultrafast -c:a copy -me_method zero -tune fastdecode -tune zerolatency -strict -2 -b:v 1000k -pix_fmt yuv420p compressedVideoPath";

Update :

Found new Library (Haven't tested)