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'
I found few ways to reduce app size when i was using ffmpeg.
You could use app bundle. so, the unused arms will be ignored. when download from the playstore
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
Related
My app size has more than doubled from 21MB to 44MB when ported over from android to ios and compiled in xcode (default settings with a few imported frameworks for admob and chartboost). Any ideas on why this is and if there is any way to reduce it?
I've gone through my texture/audio settings after converting the project, and all of them seem to be the same, so im not sure on why the sudden increase.
EDIT:
a bit more info:
-unity target device (iphone + ipad)
-Target OS - 5.1
Xcode
-architectures - armv7
-Valid architectures - arm64 arm7 arm7s
-base sdk - IOS 8.1
-supported platforms - iphoneos
everything else is pretty much default
well. its a very general question but you should know some important things.
first one is when you export your game for a platform the unity add the assembly files and system files and... for that platform. for example if you export and empty project for android you will see its about 9mb. it maybe different for ios for pc and...
second one is how package format of these platforms are compressed. different compression algorithm they use, the different size of final output will be.
there was a same problem for me that i wanted to avoid using data files with my apk file. there is not much problem with more file size untill it doesnt effect you game/program quality.
there is a topic on unity website about this problem.
http://answers.unity3d.com/questions/233563/transferred-game-from-android-to-ios-why-is-the-fi.html
its may because you made output for both arm6 and 7
For those interested, just found out that depending on your project, your development build may be significantly larger than your actual release build. Mine was 44.9MB when testing on my iphone, but the actual release build which needed to be submitted to itunes was only 28MB. (Also the estimate button in your archives window may also show higher numbers sometimes, even for your release build)
From reading, I found out that this could be reduced further, however I decided to stop here and go with this build for now as 28 mb seems ok.
Keep in mind that when you just build with Xcode and check the size of the produced .APP, that is not the one will be uploaded to AppStore. This is uncompressed unlike .APK on Android or the .IPA on iOS which is compressed by ZIP actually (just like .JAR).
On my quick test I have compiled a minimal project with only a text label on it and got a 43MB .APP. When I zipped it up manually, I got around 9.2MB .ZIP file, and when I have done an Archive build and exported that to a folder I have got a 7.4MB .IPA file... Obviously when you do an Archive (Final Release) build that is not only a dumb zipping it up process. Xcode will strip off every unnecessary thing from your executable, hence the smaller footprint...
Anyways, I think the file size is acceptable in my opinion.
Am using the OpenCV library for my project and after integration it produces .so files for armeabi, armeabi-v7a, mips and x86 architectures. My apk file size is around 60MB. I searched google and find a way of publishing multiple apk for different architecture. But it would be better if i can trim the file size. Please suggest.
OpenCV is probably built as a set of .so files, e.g. Machine Learning produces a -ml library. Only include the libraries which you actually need. You're almost certainly not going to need all of them.
I have been distributing my app with armeabi and armeabi-v7 versions of native binary but recently started to get a lot of UnsatisfiedLinkError errors where "somehow" one of the native binaries (app has few) isn't extracted/copied on install. I can't reproduce it but it looks like this is due to size of the app being near to 8 MB.
I want to stop including armeabi-v7 in the app to save near enough 2 MB and done some tests on 3 devices I have. Everything seems to be working. I also noticed (for example) Dropbox only distributes armeabi.
Would you advise against it? And yes, native binary does some number crunching and encoding but there is no optimization in build script?
8 MB should not be a problem. However, you can safely drop armeabi-v7a if you verify that it is not performance bottleneck.
Alternatively, you can use the multi-APK approach to make user downloads smaller. The official site recommends: You should generally use multiple APKs to support different device configurations only when your APK is too large (greater than 50MB). You should carefully follow the version code guidelines if you choose this route.
I downloaded LAME for Windows. It have two files, one is lame_enc.dll and another is lame.exe.
I want to convert an MP3 file from 320kbs to 128kbs.
In Windows I use command line: C:\Lame\lame.exe --preset cbr 128 "320.mp3" "128.mp3" - it works good. My question is how can I call lame.exe from my Android project? And what steps must I take to achieve that?
Thank you for your replies!
You can't call Windows executable files in Android, because they have different architecture.
It easy to understand, you can't run apk file on Windows if you don't have any converting or simulation softwares.
You can use extended libraries such as ffmpeg, lame to change bitrate of mp3 files. You can access this link to build shared library in Android:
http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI
You can't just "run lame executable from Android", because Android does not run Windows' executable files. Analogical you are not able to run MacOS applications in Windows without converting them/using emulator/etc.
I advice you to use something different than LAME for this job - I haven't used any of such, so I can't reccomend you anything right now.
EDIT
It seems that you may also easily port LAME for Android - Lame MP3 Encoder compile for Android
I am trying to port pulseaudio to Android. I have compiled pulse audio on Ubuntu and it works fine with my build. However, I want to do this on Android and for that I need the list of files that are compiled during "make". I have disabled a lot of optional components by passing args to configure.
Is there an easy way to find the list of files that are being compiled so that I can use them on Android and discard rest of the files.
I know the hard way to do this using a strace and look for all open calls for .c files, but that obviously is not a good option (especially when the file count is very high).
Thanks,
If you run make -Bn, you should see all the compiled files.