grizzly grizzly - 3 years ago 154
Android Question

Android Create MP4 with bitmap series and mp3 by FFmpeg (i need minimal ffmpeg config for build)

i'm building ffmpeg for android. my target is only create mp4 video with series of bitmap image and merge mp3 audio. i want use ffmpeg only only for this target. So i need optimized config for this target. i try find in google and find not bad config list. but i need full optimize config for reduce size of ffmpeg in android app. can you suggest me best config for this target?

i find this:

Minimal configuration for mp4 files

how do i modify this ffmpeg build script for minimal binary size output

but is not complete optimized.

please suggest me full optimize config for my target. thanks

Answer Source

These types of questions are not trivial as they seem so each question like this requires a custom answer. You must negotiate the spiderweb of internal and external dependencies, so you will likely need to experiment by compiling and testing multiple times until you get it right. Here's something to start with:

./configure --disable-all --disable-autodetect --disable-network --enable-pthreads
    --enable-avcodec --enable-avformat --enable-swscale --enable-swresample
    --enable-avfilter --enable-libx264 --enable-gpl --enable-parser=bmp,mpegaudio
    --enable-demuxer=image2,bmp_pipe,mp3 --enable-decoder=bmp --enable-muxer=mp4
    --enable-encoder=libx264 --enable-filter=format,scale --enable-protocol=file
  • I probably forgot something.
  • Memorize the output of ./configure --help.
  • Divine the innards of the configure file for clues.
  • This does not include anything special or extra to get it to work on Android.
  • It may be easier for users to avoid --disable-all and use --disable-everything instead. The first option disables components (muxers, demuxers, filters, decoders, encoders, etc), libraries, and programs. The second option "only" disables components.
  • The resulting binary will be small, but if for some crazy reason file size is more important than speed consider adding --enable-small.
  • MP3 is not as widely compatible as AAC in MP4.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download