Hi I am trying to trim video in android, but all of the source codes I have found are using ffmpeg, is there a smaller library, which I can use ? Because ffmpeg library is about 8-9 MB, and my application is about 6 MB, adding ffmpeg library to my app will make it more than double size.
You can do this with mp4parser library. Have a look at the ShortenExample
it does exactly what the name suggests. Since the library cannot re-encode the video it can only cut the video at I-frames. So the points in time where you can make a cut are quite coarse.
On Android 4.1 you can access the hardware codecs via MediaCodec API which could be an option (but I haven't seen any example of that yet)
Or, you can use this class: TrimVideoUtils.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With