Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (112)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (15442)

  • Static Compilation of FFmpeg with x264 support

    17 février 2014, par b1izzard

    Based on the Tutorial, I tried to build the latest FFmpeg binary with x264 support for Command line execution using Android-ndk-r9c.

    I had built the x264 using the below script :

    #!/bin/bash        


    PREBUILT=/home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt
                   PLATFORM=/home/blizzard/bin/android-ndk-r9c/platforms/android-9/arch-arm
                   PREFIX=/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg


               ./configure --prefix=$PREFIX \
               --enable-static \
               --enable-pic \
               --disable-asm \
               --disable-cli \            
               --host=arm-linux \
               --cross-prefix=$PREBUILT/linux-x86_64/bin/arm-linux-androideabi- \
               --sysroot=$PLATFORM

               make
               sudo make install
               sudo ldconfig

    For building FFmpeg I had used the below script :

    #!/bin/bash                    
                 PLATFORM=/home/blizzard/bin/android-ndk-r9c/platforms/android-9/arch-arm
                 PREBUILT=/home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64
                 PREFIX=/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg

                   function build_one
                   {
                   ./configure --target-os=linux --prefix=$PREFIX \
                   --arch=arm \
                   --cpu=cortex-a8 \
                   --enable-cross-compile \
                   --enable-runtime-cpudetect \
                   --disable-asm \
                   --enable-static \
                   --disable-shared \
                   --arch=arm \
                   --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
                   --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
                   --disable-stripping \
                   --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
                   --sysroot=$PLATFORM \
                   --enable-nonfree \
                   --enable-version3 \
                   --disable-everything \
                   --enable-gpl \
                   --disable-doc \
                   --enable-avresample \
                   --enable-demuxer=rtsp \
                   --enable-muxer=rtsp \
                   --disable-ffplay \
                   --disable-ffserver \
                   --enable-ffmpeg \
                   --disable-ffprobe \
                   --enable-libx264 \
                   --enable-encoder=libx264 \
                   --enable-decoder=h264 \
                   --enable-protocol=rtp \
                   --enable-hwaccels \
                   --enable-zlib \
                   --disable-devices \
                   --disable-avdevice \
                   --extra-cflags="-I/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a" \
                   --extra-ldflags="-L/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg/lib"
                   make -j4 install

                   $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
                   $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname libffmpeg.so -shared -nostdlib  -z noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264  --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.6/libgcc.a
                   }

                   build_one

    The output of the script is

    install prefix            /home/blizzard/bin/android-ndk-r9c/sources/ffmpeg
    source path               .
    C compiler                /home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
    C library                 bionic
    host C compiler           gcc
    host C library            glibc
    ARCH                      c (cortex-a8)
    big-endian                no
    runtime cpu detection     yes
    debug symbols             yes
    strip symbols             no
    optimize for size         no
    optimizations             yes
    static                    yes
    shared                    no
    postprocessing support    yes
    new filter support        yes
    network support           yes
    threading support         pthreads
    safe bitstream reader     yes
    SDL support               no
    opencl enabled            no
    libzvbi enabled           no
    texi2html enabled         yes
    perl enabled              yes
    pod2man enabled           yes
    makeinfo enabled          no

    External libraries:
    libx264         zlib

    Enabled decoders:
    h264

    Enabled encoders:
    libx264

    Enabled hwaccels:

    Enabled parsers:

    Enabled demuxers:
    asf         mpegts          rtsp
    mov         rm

    Enabled muxers:
    rtp         rtsp

    Enabled protocols:
    http            tcp         udp
    rtp

    Enabled filters:
    aformat         format          setpts
    anull           null            trim
    atrim

    Enabled bsfs:

    Enabled indevs:

    Enabled outdevs:

    License: nonfree and unredistributable
    Creating config.mak, config.h, and doc/config.texi...
    config.h is unchanged
    libavutil/avconfig.h is unchanged

    WARNING: /home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-pkg-config not found, library detection may fail.
    INSTALL install-progs-yes
    INSTALL ffmpeg
    INSTALL presets/libvpx-1080p50_60.ffpreset
    INSTALL presets/libvpx-1080p.ffpreset
    INSTALL presets/libvpx-360p.ffpreset
    INSTALL presets/libvpx-720p50_60.ffpreset
    INSTALL presets/libvpx-720p.ffpreset
    INSTALL presets/libx264-ipod320.ffpreset
    INSTALL presets/libx264-ipod640.ffpreset
    INSTALL doc/ffprobe.xsd
    INSTALL doc/examples/decoding_encoding.c
    INSTALL doc/examples/demuxing_decoding.c
    INSTALL doc/examples/filtering_audio.c
    INSTALL doc/examples/filtering_video.c
    INSTALL doc/examples/metadata.c
    INSTALL doc/examples/muxing.c
    INSTALL doc/examples/remuxing.c
    INSTALL doc/examples/resampling_audio.c
    INSTALL doc/examples/scaling_video.c
    INSTALL doc/examples/transcode_aac.c
    INSTALL doc/examples/Makefile
    INSTALL doc/examples/README
    INSTALL libavfilter/libavfilter.a
    INSTALL libavformat/libavformat.a
    INSTALL presets/libvpx-1080p50_60.ffpreset
    INSTALL presets/libvpx-1080p.ffpreset
    INSTALL presets/libvpx-360p.ffpreset
    INSTALL presets/libvpx-720p50_60.ffpreset
    INSTALL presets/libvpx-720p.ffpreset
    INSTALL presets/libx264-ipod320.ffpreset
    INSTALL presets/libx264-ipod640.ffpreset
    INSTALL doc/ffprobe.xsd
    INSTALL doc/examples/decoding_encoding.c
    INSTALL doc/examples/demuxing_decoding.c
    INSTALL doc/examples/filtering_audio.c
    INSTALL doc/examples/filtering_video.c
    INSTALL doc/examples/metadata.c
    INSTALL doc/examples/muxing.c
    INSTALL doc/examples/remuxing.c
    INSTALL doc/examples/resampling_audio.c
    INSTALL doc/examples/scaling_video.c
    INSTALL doc/examples/transcode_aac.c
    INSTALL doc/examples/Makefile
    INSTALL doc/examples/README
    INSTALL libavresample/libavresample.a
    INSTALL libavcodec/libavcodec.a
    INSTALL libpostproc/libpostproc.a
    INSTALL libswresample/libswresample.a
    INSTALL libavutil/libavutil.a
    a
    INSTALL libavfilter/asrc_abuffer.h
    INSTALL libavfilter/avcodec.h
    INSTALL libavfilter/avfilter.h
    INSTALL libavfilter/avfiltergraph.h
    INSTALL libavfilter/buffersink.h
    INSTALL libavfilter/buffersrc.h
    INSTALL libavfilter/version.h
    INSTALL libavformat/avformat.h
    INSTALL libavformat/avio.h
    INSTALL libavformat/version.h
    INSTALL libavfilter/libavfilter.pc
    INSTALL libavformat/libavformat.pc
    INSTALL libavresample/avresample.h
    INSTALL libavresample/version.h
    INSTALL libavresample/libavresample.pc
    INSTALL libavcodec/avcodec.h
    INSTALL libavcodec/avfft.h
    INSTALL libavcodec/dxva2.h
    INSTALL libavcodec/old_codec_ids.h
    INSTALL libavcodec/vaapi.h
    INSTALL libavcodec/vda.h
    INSTALL libavcodec/vdpau.h
    INSTALL libavcodec/version.h
    INSTALL libavcodec/xvmc.h
    INSTALL libavcodec/libavcodec.pc
    INSTALL libpostproc/postprocess.h
    INSTALL libpostproc/version.h
    INSTALL libpostproc/libpostproc.pc
    INSTALL libswresample/swresample.h
    INSTALL libswresample/version.h
    INSTALL libswscale/swscale.h
    INSTALL libswscale/version.h
    INSTALL libavutil/adler32.h
    INSTALL libavutil/aes.h
    INSTALL libavutil/attributes.h
    INSTALL libavutil/audio_fifo.h
    INSTALL libavutil/audioconvert.h
    INSTALL libavutil/avassert.h
    INSTALL libavutil/avstring.h
    INSTALL libavutil/avutil.h
    INSTALL libavutil/base64.h
    INSTALL libavutil/blowfish.h
    INSTALL libavutil/bprint.h
    INSTALL libavutil/bswap.h
    INSTALL libavutil/buffer.h
    INSTALL libavutil/channel_layout.h
    INSTALL libavutil/common.h
    INSTALL libavutil/cpu.h
    INSTALL libavutil/crc.h
    INSTALL libavutil/error.h
    INSTALL libavutil/eval.h
    INSTALL libavutil/fifo.h
    INSTALL libavutil/file.h
    INSTALL libavutil/frame.h
    INSTALL libavutil/hmac.h
    INSTALL libavutil/imgutils.h
    INSTALL libavutil/intfloat.h
    INSTALL libavutil/intfloat_readwrite.h
    INSTALL libavutil/intreadwrite.h
    INSTALL libavutil/lfg.h
    INSTALL libavutil/log.h
    INSTALL libavutil/macros.h
    INSTALL libavutil/mathematics.h
    INSTALL libavutil/md5.h
    INSTALL libavutil/mem.h
    INSTALL libavutil/murmur3.h
    INSTALL libavutil/dict.h
    INSTALL libavutil/old_pix_fmts.h
    INSTALL libavutil/opt.h
    INSTALL libavutil/parseutils.h
    INSTALL libavutil/pixdesc.h
    INSTALL libavutil/pixfmt.h
    INSTALL libavutil/random_seed.h
    INSTALL libavutil/rational.h
    INSTALL libavutil/ripemd.h
    INSTALL libavutil/samplefmt.h
    INSTALL libavutil/sha.h
    INSTALL libavutil/sha512.h
    INSTALL libavutil/stereo3d.h
    INSTALL libavutil/time.h
    INSTALL libavutil/timecode.h
    INSTALL libavutil/timestamp.h
    INSTALL libavutil/version.h
    INSTALL libavutil/xtea.h
    INSTALL libavutil/avconfig.h
    INSTALL libavutil/ffversion.h
    INSTALL libswresample/libswresample.pc
    INSTALL libswscale/libswscale.pc
    INSTALL libavutil/libavutil.pc

    When I tried to execute the following command using the resulting FFmpeg binary in Android Application

    ffmpeg -y -loop 1 -r 30 -i  myImage.jpg -b:v "4096k" -vf "scale=640:480" -t 3 result.mp4

    LogCat displays the following message

    02-17 15:42:45.683: D/(14511): *******Starting FFMPEG
    02-17 15:42:45.683: D/(14511): ***ffmpeg version N-60108-gda25a65 Copyright (c) 2000-2014 the FFmpeg developers***
    02-17 15:42:45.693: D/(14511): ***  built on Feb 17 2014 15:35:20 with gcc 4.6 (GCC) 20120106 (prerelease)***
    02-17 15:42:45.693: D/(14511): ***  configuration: --target-os=linux --prefix=/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg --arch=arm --cpu=cortex-a8 --enable-cross-compile --enable-runtime-cpudetect --disable-asm --enable-static --disable-shared --arch=arm --cc=/home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --cross-prefix=/home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --disable-stripping --nm=/home/blizzard/bin/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm --sysroot=/home/blizzard/bin/android-ndk-r9c/platforms/android-9/arch-arm --enable-nonfree --enable-version3 --disable-everything --enable-gpl --disable-doc --enable-avresample --enable-demuxer=rtsp --enable-muxer=rtsp --disable-ffplay --disable-ffserver --enable-ffmpeg --disable-ffprobe --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264 --enable-protocol=rtp --enable-hwaccels --enable-zlib --disable-devices --disable-avdevice --extra-cflags='-I/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a' --extra-ldflags=-L/home/blizzard/bin/android-ndk-r9c/sources/ffmpeg/lib***
    02-17 15:42:45.693: D/(14511): ***  libavutil      52. 63.100 / 52. 63.100***
    02-17 15:42:45.693: D/(14511): ***  libavcodec     55. 49.100 / 55. 49.100***
    02-17 15:42:45.693: D/(14511): ***  libavformat    55. 25.101 / 55. 25.101***
    02-17 15:42:45.693: D/(14511): ***  libavfilter     4.  1.100 /  4.  1.100***
    02-17 15:42:45.693: D/(14511): ***  libavresample   1.  1.  0 /  1.  1.  0***
    02-17 15:42:45.693: D/(14511): ***  libswscale      2.  5.101 /  2.  5.101***
    02-17 15:42:45.693: D/(14511): ***  libswresample   0. 17.104 /  0. 17.104***
    02-17 15:42:45.693: D/(14511): ***  libpostproc    52.  3.100 / 52.  3.100***
    02-17 15:42:45.693: D/(14511): ***Unrecognized option 'loop'.***
    02-17 15:42:45.693: D/(14511): ***Error splitting the argument list: Option not found***
    02-17 15:42:45.693: D/(14511): ****ending FFMPEG****

    Can anybody help me in building the latest version of FFmpeg or Can you share the latest FFMpeg binary for Android ?

  • Build FFmpeg for All Android architecture correctly

    22 octobre 2017, par fthopkins

    I built ffmpeg libraries for all android architecture. But some details are confusing my mind. First of all let me explain step by step how i built.

    • I downloaded latest version of libx264 from
      https://www.videolan.org/developers/x264.html
    • Created and run build_all.sh script (in x264 folder) for creating libs for (almost) all android platforms. Then i got android folder in x264 folder. e.g android/arm android/arm64 android/x86 android/x86_64 in x264 folder.
    • I download the ffmpeg3.3.4 from https://ffmpeg.org/download.html
    • I created 4 copies of ffmpeg3.3.4 folder. Named them with android architectures names.
      Like ffmpeg3.3.4-arm64 ffmpeg3.3.4-arm ffmpeg3.3.4-x86 ffmpeg3.3.4-x86_64
    • Created build_(architecture-name).sh for each platforms of android. Than move each one of 'named'.sh files to the named ffmpeg folders according to their architecture names.
      E.g build_android_x86.sh => ffmpeg3.3.4-x86

    build_android_arm64.sh example

    #!/bin/bash
    #Change NDK to your Android NDK location
    NDK=$HOME/Android/Sdk/ndk-bundle
    PLATFORM=$NDK/platforms/android-21/arch-arm64/
    PREBUILT=$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64

    GENERAL="\
    --enable-small \
    --enable-cross-compile \
    --extra-libs="-lgcc" \
    --arch=aarch64 \
    --cc=$PREBUILT/bin/aarch64-linux-android-gcc \
    --cross-prefix=$PREBUILT/bin/aarch64-linux-android- \
    --nm=$PREBUILT/bin/aarch64-linux-android-nm \
    --extra-cflags="-I../x264/android/arm64/include" \
    --extra-ldflags="-L../x264/android/arm64/lib" "

    MODULES="\
    --enable-gpl \
    --enable-libx264"



    function build_arm64
    {
     ./configure \
     --logfile=conflog.txt \
     --target-os=linux \
     --prefix=./android/arm64-v8a \
     ${GENERAL} \
     --sysroot=$PLATFORM \
     --extra-cflags="" \
     --extra-ldflags="-lx264 -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \
     --enable-shared \
     --disable-static \
     --disable-doc \
     --enable-zlib \
     ${MODULES}

     make clean
     make
     make install
    }

    build_arm64


    echo Android ARM64 builds finished
    • Moved all ffmpeg3.3.4-arm64 ffmpeg3.3.4-arm ffmpeg3.3.4-x86 ffmpeg3.3.4-x86_64 folders to the NDK_PATH (C:\Users\MyName\AppData\Local\Android\sdk\ndk-bundle)
    • Put x264 folder at same level of hierarchy with ffmpeg folders
      in (C:\Users\MyName\AppData\Local\Android\sdk\ndk-bundle)
    • Run each of build_android_x86.sh, build_android_x86_64.sh.. scripts one by one in their own ffmpeg folder. Then i got android folders in ffmpeg folders. (created android folders have library folders)
      e.g ffmpeg3.3.4-x86/android/x86/(bin,inlude,lib,share)
    • Created Android.mk files for all created android folders and moved each one of them to android/armName folder. e.g Android.mk => ffmpeg3.3.4-x86/android/x86/

      LOCAL_PATH:= $(call my-dir)

      include $(CLEAR_VARS)
      LOCAL_MODULE:= libavcodec
      LOCAL_SRC_FILES:= lib/libavcodec-57.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE:= libavformat
      LOCAL_SRC_FILES:= lib/libavformat-57.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE:= libswscale
      LOCAL_SRC_FILES:= lib/libswscale-4.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE:= libavutil
      LOCAL_SRC_FILES:= lib/libavutil-55.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE:= libavfilter
      LOCAL_SRC_FILES:= lib/libavfilter-6.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE:= libswresample
      LOCAL_SRC_FILES:= lib/libswresample-2.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE := postproc
      LOCAL_SRC_FILES := lib/libpostproc-54.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)

      include $(CLEAR_VARS)
      LOCAL_MODULE := avdevice
      LOCAL_SRC_FILES := lib/libavdevice-57.so
      LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
      include $(PREBUILT_SHARED_LIBRARY)
    • Create "arm named" folders e.g x86 x86_4 arm64 arm7 in jni folder of my project (myproject/app/jni/x86, myproject/app/jni/x86_64).

    • Go to ndk path open named ffmpeg folders one by one and copy ffmpeg.c ffmpeg_filter.c ffmpeg_opt.c cmdutils.c files from ffmpeg folders to the "arm named" folders. e.g ffmpeg.c => myproject/app/jni/x86

    • Created Android.mk file in my project.

      LOCAL_PATH := $(call my-dir)
      #$(warning $(LOCAL_PATH))

      include $(CLEAR_VARS)
      LOCAL_MODULE    := videoEdit
      LOCAL_LDLIBS := -llog -ljnigraphics -lz -landroid
      LOCAL_CFLAGS := -Wdeprecated-declarations
      ANDROID_LIB := -landroid

      $(info $(TARGET_ARCH_ABI))

      ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
         LOCAL_C_INCLUDES:=/Users/MyName/AppData/Local/Android/sdk/ndk-bundle/sources/ffmpeg-3.3.4-armeabi
         LOCAL_SRC_FILES :=  videoEdit.c arm7/ffmpeg.c arm7/ffmpeg_filter.c arm7/ffmpeg_opt.c arm7/cmdutils.c
         LOCAL_CFLAGS += -lx264 -Wl,--no-merge-exidx-entries
      else

         ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
                 LOCAL_C_INCLUDES:=/Users/MyName/AppData/Local/Android/sdk/ndk-bundle/sources/ffmpeg-3.3.4-arm64-v8a
                 LOCAL_SRC_FILES :=  videoEdit.c arm64/ffmpeg.c arm64/ffmpeg_filter.c arm64/ffmpeg_opt.c arm64/cmdutils.c
                 LOCAL_CFLAGS += -funwind-tables -Wl,--no-merge-exidx-entries
         else

             ifeq ($(TARGET_ARCH_ABI),x86_64)
                    LOCAL_C_INCLUDES:=/Users/MyName/AppData/Local/Android/sdk/ndk-bundle/sources/ffmpeg3.3.4-x86_64
                    LOCAL_SRC_FILES :=  videoEdit.c x86_64/ffmpeg.c x86_64/ffmpeg_filter.c x86_64/ffmpeg_opt.c x86_64/cmdutils.c
             else
                     LOCAL_C_INCLUDES:=/Users/MyName/AppData/Local/Android/sdk/ndk-bundle/sources/ffmpeg3.3.4-x86
                     LOCAL_SRC_FILES :=  videoEdit.c x86/ffmpeg.c x86/ffmpeg_filter.c x86/ffmpeg_opt.c x86/cmdutils.c
             endif

         endif

      endif

      LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil libswresample libavfilter libavdevice libpostproc

      include $(BUILD_SHARED_LIBRARY)

      ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)

         $(call import-module,ffmpeg-3.3.4-armeabi/android/armeabi-v7a)

      else

         ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
                 $(call import-module,ffmpeg-3.3.4-arm64-v8a/android/arm64-v8a)
         else

             ifeq ($(TARGET_ARCH_ABI),x86_64)
                    $(call import-module,ffmpeg3.3.4-x86_64/android/x86_64)
             else
                 $(call import-module,ffmpeg3.3.4-x86/android/i686-diasm)
             endif

         endif

      endif
    • Created Application.mk file in my project.

      APP_ABI := armeabi-v7a, arm64-v8a, x86_64, x86
      APP_PLATFORM := android-14
    • Created videoEdit.c than run ndk-build build command.

    Built with no error. I can run ffmpeg commands but it takes too much time i think. E.g when i try to run hflip it flips the video with 15 seconds.

    Code example :

    JNIEXPORT jint JNICALL Java_com_name_app_library_VideoEditer_natives_VideoEditer_flipHorizontally
    (JNIEnv *env, jclass someclass, jstring inputFile, jstring outFile) {

       int numberOfArgs = 14;

       char** arguments = calloc(numberOfArgs, sizeof(char*));
       const char *in, *out;

       in = (*env)->GetStringUTFChars(env, inputFile, 0);
       out = (*env)->GetStringUTFChars(env, outFile, 0);

       arguments[0] = "ffmpeg";
       arguments[1] = "-i";
       arguments[2] = in;
       arguments[3] = "-c:v";
       arguments[4] = "libx264";
       arguments[5] = "-preset";
       arguments[6] = "ultrafast";
       arguments[7] = "-threads";
       arguments[8] = "5";
       arguments[9] = "-c:a";
       arguments[10] = "copy";
       arguments[11] = "-vf";
       arguments[12] = "hflip";
       arguments[13] = out;

       int i;
       for (i = 0; i < numberOfArgs; i++) {
           log_message(arguments[i]);
       }
       log_message("Printed all");

       main(numberOfArgs, arguments);
       free(arguments);
       (*env)->ReleaseStringUTFChars(env, inputFile, in);
       (*env)->ReleaseStringUTFChars(env, outFile, out);

       return 0;
    }

    Also another thing to confusing my mind is output of ./configure command.
    When i open the (e.g) ffmpeg-3.3.4-arm64-v8a folder and run ./configure command in terminal. Output says ARCH   x86 (generic). For all platform output is the same ARCH   x86 (generic). Commands run on emaulator very fast but very slow on real device.

    Output of ./configure command in ffmpeg-3.3.4-arm64-v8a folder

    install prefix            /usr/local
    source path               .
    C compiler                gcc
    C library                 glibc
    ARCH                      x86 (generic)
    big-endian                no
    runtime cpu detection     yes
    yasm                      yes
    MMX enabled               yes
    MMXEXT enabled            yes
    3DNow! enabled            yes
    3DNow! extended enabled   yes
    SSE enabled               yes
    SSSE3 enabled             yes
    AESNI enabled             yes
    AVX enabled               yes
    XOP enabled               yes
    FMA3 enabled              yes
    FMA4 enabled              yes
    i686 features enabled     yes
    CMOV is fast              yes
    EBX available             yes
    EBP available             yes
    debug symbols             yes
    strip symbols             yes
    optimize for size         no
    optimizations             yes
    static                    yes
    shared                    no
    postprocessing support    no
    network support           yes
    threading support         pthreads
    safe bitstream reader     yes
    texi2html enabled         no
    perl enabled              yes
    pod2man enabled           yes
    makeinfo enabled          no
    makeinfo supports HTML    no

    External libraries:
    iconv            xlib

    EDIT all of these steps made on ubuntu then moved all folders to the windows. So dont be confuse about paths.

    With all of these steps i want to ask is, is there anything wrong on my steps. Should i follow any other way or not ? Why the ffmpeg is running slower on real device. I guess building ffmpeg for android is bit messy and making wrong things is very easy. If you look my steps, questions and give me an advice, i will be much appreciated.

  • Translating Handbrake options to a FFMPEG command

    9 mai 2020, par Arif

    I want to convert a bunch of videos from x264 to x265, but I need to do so with ffmpeg in terminal because it's a remote server. These are my Handbrake options (listed items are ticked) :

    



    Summary tab

    



      

    • Web optimized
    • 


    • Align A/V Start
    • 


    



    Dimensions tab unchanged

    



    Filters tab

    



      

    • Sharpen - LapSharp, preset : Medium
    • 


    



    Video tab

    



      

    • Video codec - H.265 (x265)

    • 


    • Framerate (FPS) - 30 - Peak Framerate

    • 


    • Quality - Constant Quality - 28

    • 


    • Encoder preset - Medium

    • 


    • Encoder tune - None

    • 


    • Encoder profile - Auto

    • 


    



    Audio tab

    



      

    • Audio track - AAC, bitrate : 128
    • 


    



    Subtitles tab - No subtitles (remove if exists)

    



    This is the ffmpeg command that I've managed to compile so far :

    



    ffmpeg -i input.mp4 -c:v libx265 -crf 28 -c:a aac -b:a 128k -max_muxing_queue_size 400 -movflags +faststart output.mp4

    



    I have the following two questions :

    



      

    1. Does the ffmpeg command provided list all the options except the peak framerate, sharpening filter and removing subtitle ones ? How do I incorporate these three ?
    2. 


    3. Slightly unrelated, but does having -max_muxing_queue_size 400 negatively affect file size or video quality ? I've only included this because I'd ran into encoding errors in the past.
    4. 


    



    Thank you.

    



    My Handbrake log with the above options, if it helps :

    



    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.10.100
  Duration: 00:02:20.52, start: 0.000000, bitrate: 1487 kb/s
    Stream #0:0(und): Video: h264 (High) [avc1 / 0x31637661]
      yuv420p, tv, bt709/bt709/bt709
      1280x720 [PAR 1:1 DAR 16:9], 1288 kb/s, PAR 1:1 DAR 16:9
      29.97 fps, 30k tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) [mp4a / 0x6134706D]
      44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[04:26:49] scan: decoding previews for title 1
[04:26:49] scan: audio 0x1: aac, rate=44100Hz, bitrate=192025 English (AAC) (2.0 ch)
[04:26:50] scan: 10 previews, 1280x720, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[04:26:50] scan: supported video decoders: avcodec qsv
[04:26:50] libhb: scan thread found 1 valid title(s)
[04:26:50] starting job
[04:26:50] decomb filter thread started for segment 0
[04:26:50] decomb filter thread started for segment 1
[04:26:50] decomb filter thread started for segment 3
[04:26:50] decomb check thread started for segment 0
[04:26:50] decomb check thread started for segment 1
[04:26:50] yadif thread started for segment 0
[04:26:50] decomb check thread started for segment 3
[04:26:50] mask filter thread started for segment 0
[04:26:50] work: track 1, dithering not supported by codec
[04:26:50] mask filter thread started for segment 1
[04:26:50] work: only 1 chapter, disabling chapter markers
[04:26:50] job configuration:
[04:26:50]  * source
[04:26:50]    + E:\input.mp4
[04:26:50]    + title 1, chapter(s) 1 to 1
[04:26:50]    + container: mov,mp4,m4a,3gp,3g2,mj2
[04:26:50] mask filter thread started for segment 3
[04:26:50]    + data rate: 1487 kbps
[04:26:50]  * destination
[04:26:50]    + C:\Users\Hp\Desktop\output.mp4
[04:26:50]    + container: MPEG-4 (libavformat)
[04:26:50]      + optimized for HTTP streaming (fast start)
[04:26:50]      + align initial A/V stream timestamps
[04:26:50]  * video track
[04:26:50]    + decoder: h264
[04:26:50]      + bitrate 1288 kbps
[04:26:50]    + filters
[04:26:50] mask filter thread started for segment 2
[04:26:50]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[04:26:50]      + Decomb (mode=39)
[04:26:50]      + Framerate Shaper (mode=2:rate=27000000/900000)
[04:26:50]        + frame rate: 29.970 fps -> peak rate limited to 30.000 fps
[04:26:50] mask erode thread started for segment 1
[04:26:50]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[04:26:50]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[04:26:50]      + Sharpen (lapsharp) (y-strength=0.2:y-kernel=isolap:cb-strength=0.2:cb-kernel=isolap)
[04:26:50]    + Output geometry
[04:26:50]      + storage dimensions: 1280 x 720
[04:26:50]      + pixel aspect ratio: 1 : 1
[04:26:50]      + display dimensions: 1280 x 720
[04:26:50]    + encoder: H.265 (libx265)
[04:26:50]      + preset:  medium
[04:26:50]      + profile: auto
[04:26:50]      + quality: 28.00 (RF)
[04:26:50]  * audio track 1
[04:26:50] mask erode thread started for segment 2
[04:26:50]    + decoder: English (AAC) (2.0 ch) (track 1, id 0x1)
[04:26:50]      + bitrate: 192 kbps, samplerate: 44100 Hz
[04:26:50]    + mixdown: Stereo
[04:26:50]    + encoder: AAC (libavcodec)
[04:26:50]      + bitrate: 128 kbps, samplerate: 48000 Hz
[04:26:50] mask erode thread started for segment 3
[04:26:50] mask dilate thread started for segment 0
[04:26:50] mask dilate thread started for segment 1
[04:26:50] mask dilate thread started for segment 2
[04:26:50] decomb check thread started for segment 2
[04:26:50] yadif thread started for segment 1
[04:26:50] yadif thread started for segment 2
[04:26:50] yadif thread started for segment 3
[04:26:50] MTFrame thread started for segment 1
[04:26:50] MTFrame thread started for segment 2
[04:26:50] MTFrame thread started for segment 3
[04:26:50] mask dilate thread started for segment 3
[04:26:50] sync: expecting 4211 video frames
[04:26:50] mask erode thread started for segment 0
[04:26:50] decomb filter thread started for segment 2
[04:26:50] MTFrame thread started for segment 0
x265 [info]: HEVC encoder version 2.6
x265 [info]: build info [Windows][GCC 7.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(12 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 30 / 300 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing
x265 [info]: tools: lslices=4 deblock sao
[04:26:50] sync: first pts video is 0
[04:26:50] sync: "Chapter 1" (1) at frame 1 time 0
[04:26:50] sync: first pts audio 0x1 is 0
[04:40:02] reader: done. 1 scr changes
[04:40:13] work: average encoding speed for job is 5.245789 fps
[04:40:13] comb detect: heavy 3 | light 10 | uncombed 4198 | total 4211
[04:40:13] decomb: deinterlaced 3 | blended 10 | unfiltered 4198 | total 4211
[04:40:13] vfr: 4211 frames output, 0 dropped and 0 duped for CFR/PFR
[04:40:13] vfr: lost time: 0 (0 frames)
[04:40:13] vfr: gained time: 0 (0 frames) (0 not accounted for)
[04:40:13] aac-decoder done: 6052 frames, 0 decoder errors
[04:40:13] h264-decoder done: 4211 frames, 0 decoder errors
[04:40:13] sync: got 4211 frames, 4211 expected
[04:40:13] sync: framerate min 18.394 fps, max 29.970 fps, avg 29.966 fps
x265 [info]: frame I:     18, Avg QP:24.13  kb/s: 2900.85
x265 [info]: frame P:   1079, Avg QP:26.64  kb/s: 1040.14
x265 [info]: frame B:   3114, Avg QP:33.15  kb/s: 235.18
x265 [info]: Weighted P-Frames: Y:0.4% UV:0.4%
x265 [info]: consecutive B-frames: 4.0% 1.4% 20.1% 55.7% 18.8%
encoded 4211 frames in 802.93s (5.24 fps), 452.83 kb/s, Avg QP:31.44
[04:40:13] mux: track 0, 4211 frames, 7970061 bytes, 453.68 kbps, fifo 8192
[04:40:13] mux: track 1, 6588 frames, 2254132 bytes, 128.31 kbps, fifo 8192
[04:40:13] libhb: work result = 0

# Encode Completed ...