Recherche avancée

Médias (0)

Mot : - Tags -/masques

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (65)

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (11910)

  • Building FFMpeg 1.0.1 for Android gives me an error with make install

    23 décembre 2013, par Fabien Henon

    I'm trying to build FFMpeg 1.0.1 for Android.

    I followed this tutorial : http://www.packtpub.com/sites/default/files/downloads/Developing_Multimedia_Applications_with_NDK.pdf (part Porting the ffmpeg library to Android with NDK).

    Thus, in my ffmpeg folder I have a script build_android.sh and here is the content :

    #!/bin/bash
    NDK=/Users/me/android-ndk
    SYSROOT=$NDK/platforms/android-8/arch-arm/
    TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64
    function build_one
    {
    ./configure \
    --prefix=$PREFIX \
    --disable-shared \
    --enable-static \
    --disable-doc \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-avdevice \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG
    make clean
    make
    make install
    }
    CPU=arm
    PREFIX=$(pwd)/android/$CPU
    ADDI_CFLAGS="-marm"
    build_one

    That was working fine mith version 2.1 of ffmpeg but with version 1.0.1 and other versions it does not work.

    I have the following error :

    ...
    CC  libavutil/random_seed.o
    CC  libavutil/rational.o
    CC  libavutil/rc4.o
    CC  libavutil/samplefmt.o
    CC  libavutil/sha.o
    CC  libavutil/time.o
    CC  libavutil/timecode.o
    CC  libavutil/tree.o
    CC  libavutil/utils.o
    CC  libavutil/xtea.o
    AR  libavutil/libavutil.a
    INSTALL libavfilter/libavfilter.a
    ./install: line 2: syntax error near unexpected token `)'
    ./install: line 2: `1) Type './configure' to create the configuration. A list of configure'
    make: *** [install-libavfilter-static] Error 2

    I'm using NDK 9r and Mac OSX.

    So the configure command works fine, the make commmand too, but the make install is not working and is giving me the error.

    Can you help me with this issue ?

    For you information, ./install is (in my opinion) the INSTALL file which has this content :

    1) Type './configure' to create the configuration. A list of configure
    options is printed by running 'configure --help'.

    'configure' can be launched from a directory different from the FFmpeg
    sources to build the objects out of tree. To do this, use an absolute
    path when launching 'configure', e.g. '/ffmpegdir/ffmpeg/configure'.

    2) Then type 'make' to build FFmpeg. GNU Make 3.81 or later is required.

    3) Type 'make install' to install all binaries and libraries you built.

    NOTICE

    - Non system dependencies (e.g. libx264, libvpx) are disabled by default.

    I don't know why make install tries to execute this file. Here is the content of the Makefile :

    MAIN_MAKEFILE=1
    include config.mak

    vpath %.c    $(SRC_PATH)
    vpath %.cpp  $(SRC_PATH)
    vpath %.h    $(SRC_PATH)
    vpath %.S    $(SRC_PATH)
    vpath %.asm  $(SRC_PATH)
    vpath %.v    $(SRC_PATH)
    vpath %.texi $(SRC_PATH)
    vpath %/fate_config.sh.template $(SRC_PATH)

    PROGS-$(CONFIG_FFMPEG)   += ffmpeg
    PROGS-$(CONFIG_FFPLAY)   += ffplay
    PROGS-$(CONFIG_FFPROBE)  += ffprobe
    PROGS-$(CONFIG_FFSERVER) += ffserver

    PROGS      := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
    INSTPROGS   = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
    OBJS        = cmdutils.o
    OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
    TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
    HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
    TOOLS       = qt-faststart trasher
    TOOLS-$(CONFIG_ZLIB) += cws2fws

    BASENAMES   = ffmpeg ffplay ffprobe ffserver
    ALLPROGS    = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
    ALLPROGS_G  = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
    ALLMANPAGES = $(BASENAMES:%=%.1)

    FFLIBS-$(CONFIG_AVDEVICE) += avdevice
    FFLIBS-$(CONFIG_AVFILTER) += avfilter
    FFLIBS-$(CONFIG_AVFORMAT) += avformat
    FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
    FFLIBS-$(CONFIG_AVCODEC)  += avcodec
    FFLIBS-$(CONFIG_POSTPROC) += postproc
    FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
    FFLIBS-$(CONFIG_SWSCALE)  += swscale

    FFLIBS := avutil

    DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
    EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile

    SKIPHEADERS = cmdutils_common_opts.h

    include $(SRC_PATH)/common.mak

    FF_EXTRALIBS := $(FFEXTRALIBS)
    FF_DEP_LIBS  := $(DEP_LIBS)

    all: $(PROGS)

    $(PROGS): %$(EXESUF): %_g$(EXESUF)
       $(CP) $< $@
       $(STRIP) $@

    $(TOOLS): %$(EXESUF): %.o
       $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)

    tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)

    config.h: .config
    .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
       @-tput bold 2>/dev/null
       @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
       @-tput sgr0 2>/dev/null

    SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
                  ARCH_HEADERS BUILT_HEADERS SKIPHEADERS                    \
                  ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS             \
                  MMI-OBJS ALTIVEC-OBJS VIS-OBJS                            \
                  MMX-OBJS YASM-OBJS                                        \
                  MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
                  OBJS HOSTOBJS TESTOBJS

    define RESET
    $(1) :=
    $(1)-yes :=
    endef

    define DOSUBDIR
    $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
    SUBDIR := $(1)/
    include $(SRC_PATH)/$(1)/Makefile
    -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
    include $(SRC_PATH)/library.mak
    endef

    $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))

    define DOPROG
    OBJS-$(1) += $(1).o
    $(1)$(PROGSSUF)_g$(EXESUF): $(OBJS-$(1))
    $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
    $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
    $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
    -include $$(OBJS-$(1):.o=.d)
    endef

    $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))

    %$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
       $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)

    OBJDIRS += tools

    -include $(wildcard tools/*.d)

    VERSION_SH  = $(SRC_PATH)/version.sh
    GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD

    .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
    .version: M=@

    version.h .version:
       $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
       $(Q)touch .version

    # force version.sh to run whenever version might have changed
    -include .version

    ifdef PROGS
    install: install-progs install-data
    endif

    install: install-libs install-headers

    install-libs: install-libs-yes

    install-progs-yes:
    install-progs-$(CONFIG_SHARED): install-libs

    install-progs: install-progs-yes $(PROGS)
       $(Q)mkdir -p "$(BINDIR)"
       $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"

    install-data: $(DATA_FILES) $(EXAMPLES_FILES)
       $(Q)mkdir -p "$(DATADIR)/examples"
       $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
       $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"

    uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data

    uninstall-progs:
       $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))

    uninstall-data:
       $(RM) -r "$(DATADIR)"

    clean::
       $(RM) $(ALLPROGS) $(ALLPROGS_G)
       $(RM) $(CLEANSUFFIXES)
       $(RM) $(TOOLS)
       $(RM) $(CLEANSUFFIXES:%=tools/%)
       $(RM) coverage.info
       $(RM) -r coverage-html

    distclean::
       $(RM) $(DISTCLEANSUFFIXES)
       $(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h

    config:
       $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)

    # Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
    coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
       $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@

    coverage-html: coverage.info
       $(Q)mkdir -p $@
       $(Q)genhtml -o $@ $<
       $(Q)touch $@

    check: all alltools examples testprogs fate

    include $(SRC_PATH)/doc/Makefile
    include $(SRC_PATH)/tests/Makefile

    $(sort $(OBJDIRS)):
       $(Q)mkdir -p $@

    # Dummy rule to stop make trying to rebuild removed or renamed headers
    %.h:
       @:

    # Disable suffix rules.  Most of the builtin rules are suffix rules,
    # so this saves some time on slow systems.
    .SUFFIXES:

    .PHONY: all all-yes alltools check *clean config install*
    .PHONY: testprogs uninstall*
  • ffmpeg with frei0r libraries fails on os x 10.14.6

    13 novembre 2019, par Bernhard Wagner

    I’m on Mac OS X 10.14.6 (Mojave), used homebrew to install both ffmpeg and frei0r.
    If you check the output below, the option --enable-frei0r is there.

    I verified the path to the frei0r libaries and call ffmpeg like this :

    FREI0R_PATH=/usr/local/Cellar/frei0r/1.6.1/lib/frei0r-1/ ffmpeg -v debug -i running.mkv -filter:v frei0r=pixeliz0r=0.02:0.02 pixel.mkv

    however it fails the exact same way as if I hadn’t passed the env var FREI0R_PATH :

    FREI0R_PATH=/usr/local/Cellar/frei0r/1.6.1/lib/frei0r-1/ ffmpeg -y -v debug -i running.mkv -filter:v frei0r=pixeliz0r=0.02:0.02 pixel.mkv
    ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
     built with Apple clang version 11.0.0 (clang-1100.0.33.8)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
     libavutil      56. 31.100 / 56. 31.100
     libavcodec     58. 54.100 / 58. 54.100
     libavformat    58. 29.100 / 58. 29.100
     libavdevice    58.  8.100 / 58.  8.100
     libavfilter     7. 57.100 /  7. 57.100
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  5.100 /  5.  5.100
     libswresample   3.  5.100 /  3.  5.100
     libpostproc    55.  5.100 / 55.  5.100
    Splitting the commandline.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
    Reading option '-i' ... matched as input url with argument 'running.mkv'.
    Reading option '-filter:v' ... matched as option 'filter' (set stream filtergraph) with argument 'frei0r=pixeliz0r=0.02:0.02'.
    Reading option 'pixel.mkv' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option y (overwrite output files) with argument 1.
    Applying option v (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input url running.mkv.
    Successfully parsed a group of options.
    Opening an input file: running.mkv.
    [NULL @ 0x7f894e002000] Opening 'running.mkv' for reading
    [file @ 0x7f894ce20f40] Setting default whitelist 'file,crypto'
    [matroska,webm @ 0x7f894e002000] Format matroska,webm probed with size=2048 and score=100
    st:0 removing common factor 1000000 from timebase
    st:1 removing common factor 1000000 from timebase
    [matroska,webm @ 0x7f894e002000] Before avformat_find_stream_info() pos: 1021 bytes read:32768 seeks:0 nb_streams:2
    [h264 @ 0x7f894e003400] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x7f894e003400] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x7f894e003400] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x7f894e003400] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x7f894e003400] nal_unit_type: 5(IDR), nal_ref_idc: 1
    [h264 @ 0x7f894e003400] Format yuv420p chosen by get_format().
    [h264 @ 0x7f894e003400] Reinit context to 1280x720, pix_fmt: yuv420p
    [h264 @ 0x7f894e003400] no picture
    [matroska,webm @ 0x7f894e002000] All info found
    [matroska,webm @ 0x7f894e002000] After avformat_find_stream_info() pos: 26157 bytes read:32768 seeks:0 frames:5
    Input #0, matroska,webm, from 'running.mkv':
     Metadata:
       MINOR_VERSION   : 0
       COMPATIBLE_BRANDS: iso6avc1mp41
       MAJOR_BRAND     : dash
       ENCODER         : Lavf58.29.100
     Duration: 00:00:46.22, start: -0.013000, bitrate: 2189 kb/s
       Stream #0:0, 3, 1/1000: Video: h264 (Main), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 0/1, 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
       Metadata:
         HANDLER_NAME    : ISO Media file produced by Google Inc.
         DURATION        : 00:00:46.216000000
       Stream #0:1(eng), 2, 1/1000: Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
       Metadata:
         DURATION        : 00:00:46.194000000
    Successfully opened the file.
    Parsing a group of options: output url pixel.mkv.
    Applying option filter:v (set stream filtergraph) with argument frei0r=pixeliz0r=0.02:0.02.
    Successfully parsed a group of options.
    Opening an output file: pixel.mkv.
    [file @ 0x7f894ce22840] Setting default whitelist 'file,crypto'
    Successfully opened the file.
    detected 4 logical cores
    [h264 @ 0x7f894d006a00] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x7f894d006a00] nal_unit_type: 8(PPS), nal_ref_idc: 3
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (opus (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
       Last message repeated 1 times
    [opus @ 0x7f894d020000] skip 312/960 samples
    [h264 @ 0x7f894d006a00] nal_unit_type: 5(IDR), nal_ref_idc: 1
    [h264 @ 0x7f894d006a00] Format yuv420p chosen by get_format().
    [h264 @ 0x7f894d006a00] Reinit context to 1280x720, pix_fmt: yuv420p
    [graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'time_base' to value '1/48000'
    [graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'sample_rate' to value '48000'
    [h264 @ 0x7f894d006a00] no picture
    [graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'sample_fmt' to value 'fltp'
    [graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'channel_layout' to value '0x3'
    [graph_1_in_0_1 @ 0x7f894ce3f740] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
    [format_out_0_1 @ 0x7f894ce3fdc0] Setting 'sample_fmts' to value 'fltp'
    [AVFilterGraph @ 0x7f894cc07180] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
       Last message repeated 2 times
    [h264 @ 0x7f894d007000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x7f894e030800] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x7f894e030e00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
       Last message repeated 1 times
    [h264 @ 0x7f894e017c00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x7f894d006a00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
    [Parsed_frei0r_0 @ 0x7f894ce4fe40] Setting 'pixeliz0r' to value '0.02'
    [Parsed_frei0r_0 @ 0x7f894ce4fe40] Option 'pixeliz0r' not found
    [AVFilterGraph @ 0x7f894cc08340] Error initializing filter 'frei0r' with args 'pixeliz0r=0.02:0.02'
    Error reinitializing filters!
    Failed to inject frame into filter network: Option not found
    Error while processing the decoded data for stream #0:0
    [AVIOContext @ 0x7f894cc06400] Statistics: 0 seeks, 0 writeouts
    [libvorbis @ 0x7f894d800c00] 44 frames left in the queue on closing
    [AVIOContext @ 0x7f894ce21080] Statistics: 65536 bytes read, 0 seeks
    Conversion failed!
  • so Confused, why my build of libffmpeg.so > 17M ?

    24 février 2012, par ghost

    I did build ffmpeg for Android in winxp and scientific linux , ffmpeg is in dolphin player — an open source video player (http://code.google.com/p/dolphin-player/), and i just build the ffmpeg, its seems like the same as in rockplayer 1.7.0, they all use build_andriod.sh below, it worked in both winxp and linux,
    and all successfully got bin/ffmpeg (less than 5MB), but libffmpeg.so ( > 17MB), when put libffmpeg.so in dolphin-player libs , player can't work, the size 17MB is too large, the original libffmpeg.so in olphin-player libs is less than 5MB, please give some advice.

    #!/bin/bash

    ######################################################
    # FFmpeg builds script for Android+ARM platform
    #
    # This script is released under term of
    #   CDDL (http://www.opensource.org/licenses/cddl1)
    # Wrote by pinxue (~@gmail.com) from RockPlayer.com
    #                                   2010-8 ~ 2011-4
    ######################################################

    ######################################################
    # Usage:
    #   put this script in top of FFmpeg source tree
    #   ./build_android
    #
    # It generates binary for following architectures:
    #     ARMv6
    #     ARMv6+VFP
    #     ARMv7+VFM-ïd16 (Tegra2)
    #     ARMv7+Neon (Cortex-A8)
    #
    # Customizing:
    # 1. Feel free to change ./configure parameters for more features
    # 2. To adapt other ARM variants
    #       set $CPU and $OPTIMIZE_CFLAGS
    #       call build_one
    ######################################################

    export TMPDIR=D:/tmp/android
    export NDK=D:/android-ndk-r4

    #PLATFORM=$NDK/build/platforms/android-8/arch-arm/
    PLATFORM=$NDK/build/platforms/android-8/arch-arm
    #PREBUILT=$NDK/build/prebuilt/darwin-x86/arm-eabi-4.4.0
    PREBUILT=$NDK/build/prebuilt/windows/arm-eabi-4.4.0

    function build_one
    {

    # -fasm : required. Android header file uses asm keyword instead of __asm__ , but most of c dialect (like ansi,c99,gnu99) implies -fno-asm.
    #   ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/asm/byteorder.h: In function '___arch__swab32':
    #   ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/asm/byteorder.h:25: error: expected ')' before ':' token

    # -fno-short-enums : optimized.  Else FFmpeg obj will generate a huge number of warning for variable-size enums,
    #   though we may suppress them by --no-enum-size-warning, it would be better to avoid it.
    #   .../ld: warning: cmdutils.o uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail

    # --extra-libs="-lgcc" : required. Else cannot solve some runtime function symbols
    #   ... undefined reference to `__aeabi_f2uiz'

    # --enable-protocols : required. Without this option, the file open always fails mysteriously.
    #   FFmpeg's av_open_input_file will invoke file format probing functions, but because most of useful demuxers has flag of zero
    #   which cause them are ignored during file format probling and fall to url stream parsing,
    #   if protocols are disabled, the file:// url cannot be opened as well.

    # $PREBUILT/bin/arm-eabi-ar d libavcodec/libavcodec.a inverse.o : required.
    #   FFmpeg includes two copies of inverse.c both in libavutil and libavcodec for performance consideration (not sure the benifit yet)
    #   Without this step, final ld of generating libffmpeg.so will fail silently, if invoke ld through gcc, gcc will collect more reasonable error message.

    # -llog: debug only, FFmpeg itself doesn't require it at all.
    #   With this option, we may simply includes "utils/Log.h" and use LOGx() to observe FFmpeg's behavior
    #   PS, it seems the toolchain implies -DNDEBUG somewhere, it would be safer to use following syntax
    #    #ifdef NDEBUG
    #        #undef NDEBUG
    #        #define HAVE_NDEBUG
    #    #endif
    #    #include "utils/Log.h"
    #    #ifdef HAVE_NDEBUG
    #        #define NDEBUG
    #        #undef HAVE_NDEBUG
    #    #endif

    # --whole-archive : required. Else ld generate a small .so file (about 15k)

    # --no-stdlib : required. Android doesn't use standard c runtime but invited its own wheal (bionic libc) because of license consideration.

    # space before \ of configure lines: required for some options. Else next line will be merged into previous lines's content and cause problem.
    #   Especially the --extra-cflags, the next line will pass to gcc in this case and configure will say gcc cannot create executable.

    # many options mentioned by articles over internet are implied by -O2 or -O3 already, need not repeat at all.

    # two or three common optimization cflags are omitted because not sure about the trade off yet. invoke NDK build system with V=1 to find them.

    # -Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x mentioned by almost every articles over internet, but it is not required to specify at all.

    # -Dipv6mr_interface=ipv6mr_ifindex : required. Android inet header doesn't use ipv6mr_interface which is required by rfc, seems it generate this user space header file directly from kernel header file, but Linux kernel has decided to keep its own name for ever and ask user space header to use rfc name.

    # HAVE_SYS_UIO_H : required. Else:
    # In file included from ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/linux/socket.h:29,
    #                 from ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/sys/socket.h:33,
    #                 from libavformat/network.h:35,
    #                 from libavformat/utils.c:46:
    #~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/linux/uio.h:19: error: redefinition of 'struct iovec'
    #

    # --disable-doc : required because of strange bug of toolchain.
    #

    #
    #--extra-ldflags=-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib $PREBUILT/lib/gcc/arm-eabi/4.4.0/crtbegin.o $PREBUILT/lib/gcc/arm-eabi/4.4.0/crtend.o -lc -lm -ldl"
    #

    ./configure --target-os=linux \
       --prefix=$PREFIX \
       --enable-cross-compile \
       --extra-libs="-lgcc" \
       --arch=arm \
       --cc=$PREBUILT/bin/arm-eabi-gcc \
       --cross-prefix=$PREBUILT/bin/arm-eabi- \
       --nm=$PREBUILT/bin/arm-eabi-nm \
       --sysroot=$PLATFORM \
      --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums  -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
       --disable-shared \
       --enable-static \
       --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib  -nostdlib -lc -lm -ldl -llog" \
       --enable-parsers \
       --disable-encoders  \
       --enable-decoders \
       --disable-muxers \
       --enable-demuxers \
       --enable-swscale  \
       --disable-ffplay \
       --disable-ffprobe \
       --disable-ffserver \
       --enable-network \
       --enable-indevs \
       --disable-bsfs \
       --disable-filters \
       --enable-protocols  \
       --enable-asm \
       --disable-doc \
       $ADDITIONAL_CONFIGURE_FLAG

    ##make clean
    make  -j4 install


    $PREBUILT/bin/arm-eabi-ar d libavcodec/libavcodec.a inverse.o

    $PREBUILT/bin/arm-eabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a  -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-eabi/4.4.0/libgcc.a

    }


    #arm v6
    CPU=armv6
    OPTIMIZE_CFLAGS="-marm -march=$CPU"
    PREFIX=./android/$CPU
    ADDITIONAL_CONFIGURE_FLAG=
    build_one

    #arm v7vfpv3
    CPU=armv7-a
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
    PREFIX=./android/$CPU
    ADDITIONAL_CONFIGURE_FLAG=
    build_one

    #arm v7vfp
    CPU=armv7-a
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "
    PREFIX=./android/$CPU-vfp
    ADDITIONAL_CONFIGURE_FLAG=
    build_one

    #arm v7n
    CPU=armv7-a
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mtune=cortex-a8"
    PREFIX=./android/$CPU-neon
    ADDITIONAL_CONFIGURE_FLAG=--enable-neon
    build_one

    #arm v6+vfp
    CPU=armv6
    OPTIMIZE_CFLAGS="-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU"
    PREFIX=./android/${CPU}_vfp
    ADDITIONAL_CONFIGURE_FLAG=
    build_one