tanersener / react-native-ffmpeg

FFmpeg for react-native. Not maintained anymore. Superseded by FFmpegKit.
GNU General Public License v3.0
400 stars 51 forks source link

Large APK size after installing package #266

Closed Tymofiev closed 2 years ago

Tymofiev commented 2 years ago

Description After adding package to project Android APK size increases from ~90 MB to ~146 MB. Does not depend on external libraries as I am using "min" pack.

Expected behavior Bundle size should only grow by couple MB instead of ~50 providing zero external libraries are used.

Screenshots Without package image After installing it image Comparing these two APKs image

Other As I understand it's because of this shared objects, but can I decrease the size somehow? image

tanersener commented 2 years ago

min package is around 25 MB and each architecture takes ~ 6 MB. It cannot increase the size that much. I suggest you check logcat output and find the mobile-ffmpeg package loaded. It will tell you whether your app uses min package or not.

ursnj commented 2 years ago

Same for me as well, it increased almost 25 Mb than previous version:

Before My APK size: 20Mb

After update to 0.5.2 : 45Mb

Tymofiev commented 2 years ago

min package is around 25 MB and each architecture takes ~ 6 MB. It cannot increase the size that much. I suggest you check logcat output and find the mobile-ffmpeg package loaded. It will tell you where your app uses min package or not.

Thanks for answering, so there is no way to decrease the size, exclude some files etc.? As you see on the screenshot, libs take a bit space for every architecture

P.S. Building Android App Bundle seems to resolve this issue for now, results with around 60-70MB in my case

tanersener commented 2 years ago

If min package is not small enough for you then you can try building your own .so libraries. They come from mobile-ffmpeg project. There is a wiki page called How to decrease binary size under the project which explains how the binary size can be decreased further.

Tymofiev commented 2 years ago

I thought there is a list of those I can't exclude this way, but if I am able to do that - will try it as soon as .aab file gets too large. Thank you!