Is it possible to compress video on Android?
41,034
Solution 1
I used ffmpeg4android,
And was able to achieve this in about 10min using only java, Note that its a commercial library.
Solution 2
Yes in android you can us ffmpeg4android for compress video it's native library
Please check this link
Install the Android NDK First to Use it
Related videos on Youtube
Comments
-
Jay Thakkar almost 2 years
I want to do video compression.
Actually in my application I want to have two options, one is low and another is high. If I choose the low option then the application will compress the video and then upload it. If I choose high then it will upload the original video which I have recorded itself.
I want to do this thing in my application and I'm confused. I have searched google a lot but I'm not able to find the useful way to solve this question please if anyone can help me out.
-
Kazekage Gaara almost 12 yearsTo compress a video, you will need to re-encode it to a lower bit-rate or maybe a lower resolution. You can search the Google to find many libraries available to encode videos in Java. I would suggest you to try ffmpeg. Here's a link to get you started. And here's an answer that might help your cause.
-
Wim L. over 9 yearsThe library given in this answer stackoverflow.com/a/23815402/4153725 is free.
-
-
Noman about 10 yearsHow to use it in code ??
-
Eli about 10 yearsSee detailed explanations here: androidwarzone.blogspot.co.il/2011/12/ffmpeg4android.html
-
Rakki s over 9 yearsI like to use the ffmpeg4android , Do i need to register or pay something for that . What are the license details?.
-
Narendra Singh almost 7 years@Eli it is very very slow :(
-
Neo almost 7 yearsI have implemented it. Its not working mostly all device above android M. is there any solution for it?
-
Narendra Singh almost 7 yearsIs NDK necessary for that? As I have seen sdk examples too.
-
Eli almost 7 years@MrNarendra Hi, It depends on a lot of factors (you can read the performance guide in the blog). If you still have problems, please email me, and I will try to assis you.
-
Macdroid Solution almost 7 yearsYes it's necessary because ffmpeg library build in C++ Code and c++ Code need their own compiler (Ndk) :)
-
Dallas187 almost 6 yearsI realize this is an old post, but in case it helps anyone else who reads this comment, FFmpeg4Android can run FFmpeg commands in Java without the need for C code, or installing the NDK. See this link for more info. At time of this comment, the page clearly states: "FFmpeg4Android is a way your application can run FFmpeg commands, only Java, no need for C code, or NDK."