Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

a system for building custom ffmpeg binaries for Android

enabled md5 muxer

latest commit 8e5903572d
n8fr8 n8fr8 authored
Octocat-spinner-32 ffmpeg @ 39fe803 update to ffmpeg 0.11.1 August 21, 2012
Octocat-spinner-32 freetype2 @ 50ed33e added freetype2 v2.4.9 as a submodule August 24, 2012
Octocat-spinner-32 sox @ 542cab5 add sox as submodule November 22, 2012
Octocat-spinner-32 tests change build to get audio+video filters working simultaneously, updat… August 24, 2012
Octocat-spinner-32 x264 @ 37be552 updated x264 from the latest upstream/stable July 17, 2012
Octocat-spinner-32 .gitignore add binary dir to gitignore November 22, 2012
Octocat-spinner-32 .gitmodules add sox as submodule November 22, 2012
Octocat-spinner-32 ARM_generate_position_independent_code_to_access_data_symbols.patch add some ARM optimizations from libav August 24, 2012
Octocat-spinner-32 ARM_intmath_use_native-size_return_types_for_clipping_functions.patch add some ARM optimizations from libav August 24, 2012
Octocat-spinner-32 LICENSE Add license information February 28, 2013
Octocat-spinner-32 LICENSE.GPLv3 Add license information February 28, 2013
Octocat-spinner-32 README.txt update to build with Android NDK r8e June 05, 2013
Octocat-spinner-32 arm-asm-fix.patch enable building ffmpeg with ARM assembly and NEON August 21, 2012
Octocat-spinner-32 clean.sh Build and install SoX - the Swiss Army knife of sound processing tools November 22, 2012
Octocat-spinner-32 configure_ffmpeg.sh enabled md5 muxer November 14, 2013
Octocat-spinner-32 configure_freetype2.sh build and include freetype2 by default to enable the 'drawtext' filter August 24, 2012
Octocat-spinner-32 configure_make_everything.sh Build and install SoX - the Swiss Army knife of sound processing tools November 22, 2012
Octocat-spinner-32 configure_sox.sh update sox build to work on Debian/squeeze (yes, its old...) June 05, 2013
Octocat-spinner-32 configure_x264.sh got ffmpeg built and runs on Android enough to print help September 06, 2011
Octocat-spinner-32 enable-fake-pkg-config.patch build and include freetype2 by default to enable the 'drawtext' filter August 24, 2012
Octocat-spinner-32 fake-pkg-config Properly exit from fake pkg-config November 21, 2012
Octocat-spinner-32 make_ffmpeg.sh Install ffmpeg library to ./data November 22, 2012
Octocat-spinner-32 make_freetype2.sh build and include freetype2 by default to enable the 'drawtext' filter August 24, 2012
Octocat-spinner-32 make_sox.sh Strip the sox binary. Shrinks size from 45MB -> 8MB November 22, 2012
Octocat-spinner-32 make_x264.sh working x264 build with sysroot-style NDK build September 06, 2011
Octocat-spinner-32 redact-plugins.patch update redact plugins patch for ffmpeg 0.11.1 August 21, 2012
Octocat-spinner-32 settings.sh update to build with Android NDK r8e June 05, 2013
Octocat-spinner-32 sox-update-ffmpeg-api.patch Build and install SoX - the Swiss Army knife of sound processing tools November 22, 2012
README.txt
This is a new android-ffmpeg project since it seems there were so many
different ways of doing it, it was confusing.  So here is my clean, easily
changeable, static ffmpeg creator for Android.  The result is a single
'ffmpeg' that is statically linked, so its the only file you need.

setup
-----

 1. Install the Android NDK r8 or newer
 2. On Debian/Ubuntu, run: apt-get install yasm bash patch make gawk
    (If you are on older releases of Debian/Ubuntu/Mint, like Debian/squeeze,
    then you will need to get newer versions of the packages automake,
    autotools-dev, and libtool.  You can download these from testing and
    manually install them. These are needed to provide the newest version
    of config.guess and config.sub, which only recently got Android support)


building
--------

cd android-ffmpeg
git submodule init
git submodule update
NDK_BASE=/path/to/android-ndk ./configure_make_everything.sh

That should give you command line binary ffmpeg/ffmpeg, which is the only file
you should need.


Note: the 'make' build is setup to work with the Android NDK r8e. If you are
using an older version, or you are using the 32-bit NDK on a 64-bit system,
then you might need to set some variables manually as part of the command
line.  For example, using the 32-bit NDK on a 64-bit system:

    NDK_PROCESSOR=x86 ./configure_make_everything.sh

 Or using an older compiler version:

    NDK_COMPILER_VERSION=4.4.3 ./configure_make_everything.sh


customizing
-----------

If you want to change which coders, decoders, muxers, filters, etc that are
included, edit configure_ffmpeg.sh and add/substract what you want.


sources of inspiration
----------------------

https://github.com/mconf/android-ffmpeg
https://github.com/halfninja/android-ffmpeg-x264
https://github.com/guardianproject/SSCVideoProto
http://wiki.multimedia.cx/index.php?title=FFmpeg_filter_howto


testing
-------

# embedding metadata into a matroska video
/data/local/ffmpeg -y -i test.mp4 \
    -attach attach.txt -metadata:s:2 mimetype=text/plain \
    -acodec copy -vcodec copy testattach.mkv

# video redact only
./ffmpeg/ffmpeg -y -i test.mp4 \
    -filter:v redact=redact_unsort.txt \
    -acodec copy \
    output-test-vf_redact.mp4

# audio redact only
/data/local/ffmpeg -i test.mp4 -t 10 \
    -filter:a aredact=aredact_unsort.txt \
    -acodec aac  -b:a 32k -strict experimental \
    -y output-test-af_aredact.mp4

# redact audio and video
/data/local/ffmpeg -i test.mp4 \
    -af aredact=aredact_unsort.txt \
    -vf redact=redact_unsort.txt \
    -acodec aac  -b:a 32k -strict experimental \
    -vcodec libx264 \
    -y output-test-redact.mp4

# tweaking h264 output settings
./ffmpeg \
    -i sscvideoproto_nexuss_high_quality_2_3_3.mp4 \
    -acodec copy \
    -vcodec libx264 -b:v 1000k -an -f mp4 \
    -y /tmp/output.mp4

# drawtext test
./ffmpeg \
    -i test.mp4 \
    -fflags +genpts -t 600 -r 8 -s 640x480 \
    -vf drawtext="fontfile=DejaVuSans.ttf:x=70:y=455: \
text='\%H\:\%M\:\%S | \%a \%d/\%b/\%Y | S500ATV | camera 0': \
fontcolor=0xFFFFFFFF:fontsize=18: \
shadowcolor=0x000000EE:shadowx=1:shadowy=1" \
    -b:v 1500000 -r 8 \
    -acodec copy \
    -y video_file.mp4
Something went wrong with that request. Please try again.