'How to compress a video file in android?

i have list of video files in my sdcard.when i click the selected video in gridview,i want to compress the selected video file in android.How to compress a video file in android.is there any sample code availavble?



Solution 1:[1]

Video Compression can be done by MediaCodec (From JB) and FFMPEG. Please refer documents of FFMPEG for more information on compression.

Refer:

ffmpeg: compress video?

https://www.virag.si/2012/01/web-video-encoding-tutorial-with-ffmpeg-0-9/

Solution 2:[2]

I think the best solution for video compression is using ffmpeg library. Here you can find a sample android app that used that library:

https://github.com/umeshbsa/ffmpeg-video-compresion-with-progress-android

another lovely library is silicompressor you can find that here:

https://github.com/Tourenathan-G5organisation/SiliCompressor

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Community
Solution 2 younes khanbaba