Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce apk size when using ffmpeg

I am building an app that can trim a video into multiple segments , for that purpose i have used ffmpeg library

This command does all the work

ffmpeg -i testfile.mp4 -c copy -f segment -segment_time 1200 testfile_piece_%02d.mp4

But including this library increased my app size upto ~45 mb

I want to reduce my apk size

I want help in

  • Deleting non required libs like x86 , x86_64
  • or Building ffmpeg with required libs only but i dont know which lib is required for segment purpose
  • and also I dont know how to build ffmpeg from source code

I am using this library 'com.arthenica:mobile-ffmpeg-min-gpl:4.4.LTS'

like image 532
Anas Ansari Avatar asked Jul 18 '26 20:07

Anas Ansari


1 Answers

I found few ways to reduce app size when i was using ffmpeg.

  1. You could use app bundle. so, the unused arms will be ignored. when download from the playstore
  2. I would suggest not deleting x86 cause some low-end devices won't work without it. x86_64 can be deleted though. I have already done it once for min-4.4-lts not for min-gpl-4.4-lts. you can download it and directly use in your project and test it in the low-end devices .aar
like image 186
gowtham6672 Avatar answered Jul 20 '26 10:07

gowtham6672



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!