3

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'

Anas Ansari
  • 405
  • 4
  • 6

1 Answers1

3

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
gowtham6672
  • 999
  • 1
  • 10
  • 22
  • Thanx bro, btw can you tell me how to delete x86? I am new to this and plz answer for point no. 2 as well – Anas Ansari Jul 13 '21 at 07:23
  • Use this https://ufile.io/8yjhtrtq I have deleted x86_64 in min-gpl-4.4. if you want to do on your own download aar file from https://github.com/tanersener/mobile-ffmpeg/releases here and open the aar file with any kind of archive manager application like Winrar. then, go into jni folder delete the arm file that you want. that it. Sorry, I have no idea about Building ffmpeg with required libs. – gowtham6672 Jul 13 '21 at 09:34
  • min-gpl uses these libvid.stab, x264, x265, xvidcore libraries. you could research about each libraries . that might help for your second qes. – gowtham6672 Jul 13 '21 at 09:38
  • I have deleted the x86_64 from the .aar file but now how to include this library in my project – Anas Ansari Jul 13 '21 at 14:49