Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • “Hook” libMMS to FFmpeg for iPhone Streaming

    8 novembre 2011, par Xie Xingwei

    These days, I was researching the software architechture for iPhone Streaming (Base on MMS protocol).

    As we know, in order to playback MMS audio stream, we should call libMMS to read wma stream data from remote media server, and then call FFmpeg to decode the stream data from wma format into PCM data buffer, and finally, enqueue the PCM data buffer into iPhone’s audioqueue to generate real sound.

    The introduction above just describe the working process of iPhone streaming. If we only need to implement this simple functionality, that is not difficult. Just follow the introduction above to call libMMS, FFMpeg and audioqueue step by step, we can achieve the streaming function. Actually, I have implemented the code last week.

    But, what I need is not only a simple streaming function! I need a software architechture makes FFmpeg accessing libMMS just like accessing local filesystem!

    Does anybody know how to hook the libMMS interfaces like mms_read/mms_seek onto FFmpeg filesystem interfaces like av_read_frame/av_seek_frame?

  • FFmpeg static keyframe rate

    7 novembre 2011, par 2di

    I have a question about ffmpeg usage. Every time when I trying to convert video files into some different format, output file getting static keyframe sequence.

    What I mean is that keyframes appear at the distance of 12 frames. I know that its controllerd by parameter -g that you can change to any other number.

    ffmpeg -i 1.avi -vcodec mpeg4 -b 2000000  out.avi
    

    I believe there should be some way to make keyframes appear on uneven intervals. These interval should be calculated by codec, and it should be based on image changes in the video file. So keyframes should be inserted only when they needed, but not consistently after N frames.

    Can somebody please explain to me how this "smart" encoding can be done with ffmpeg ? Thank you

    SOLUTION: ok what I'ev been looking for has very simple solution. If you set -g to zero, ffmpeg will choose keyframes based on the video shots and bitrate

  • Error when run the command ./build.sh in FFmpeg decoder in Android [closed]

    7 novembre 2011, par fargath

    Possible Duplicate:
    Android-NDK building using the Bambuser source
    Error while compile ffmpeg on cygwin for android

    I have try to implement the ffmpeg decoding library in my android project.Dowload FFmpeg.I got the ffmpeg library from the bambuser client version and unpack that into the project jni folder.Then i run the extract command(./extract.sh) in cygwin compiler tool(its becoz am using windows os) after that am trying to build ffmpeg library using the command ./build.sh

    I have googled a lot but i cant make it work. Please help me out from this.

    NDK version: NDKr5b Cygwin tool version: 1.7

    my build.sh file is

    ***********Command starts here**********
    
     #!/bin/bash
    if [ "$NDK" = "" ]; then
        echo NDK variable not set, assuming ${HOME}/android-ndk
        export NDK=${HOME}/android-ndk
    fi
    
    SYSROOT=$NDK/platforms/android-8/arch-arm
     # Expand the prebuilt/* path into the correct one
    TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows`
    export PATH=$TOOLCHAIN/bin:$PATH
    
    rm -rf build/ffmpeg
    mkdir -p build/ffmpeg
    cd ffmpeg
    
     # Don't build any neon version for now
    for version in armv5te armv7a; do
    
    DEST=../build/ffmpeg
    FLAGS="--target-os=linux --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- --arch=arm  --cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc"
    FLAGS="$FLAGS --sysroot=$SYSROOT"
    FLAGS="$FLAGS --soname-prefix=/data/data/org.sample.ffmpegsample/lib/"
    FLAGS="$FLAGS --enable-shared --disable-symver --enable-cross-compile"
    FLAGS="$FLAGS --enable-small --enable-version3 --optimization-flags=-O2"
    FLAGS="$FLAGS --nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm"
    FLAGS="$FLAGS --ar=$TOOLCHAIN/bin/arm-linux-androideabi-ar"
    FLAGS="$FLAGS --enable-gpl --enable-nonfree --disable-stripping"
    FLAGS="$FLAGS --enable-encoder=mpeg2video --enable-encoder=nellymoser"
    $ADDITIONAL_CONFIGURE_FLAG
    
    case "$version" in
        neon)
            EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
            EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
            # Runtime choosing neon vs non-neon requires
            # renamed files
            ABI="armeabi-v7a"
            ;;
        armv7a)
            EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp"
            EXTRA_LDFLAGS=""
            ABI="armeabi-v7a"
            ;;
        *)
            EXTRA_CFLAGS=""
            EXTRA_LDFLAGS=""
            ABI="armeabi"
            ;;
    esac
    DEST="$DEST/$ABI"
    FLAGS="$FLAGS --prefix=$DEST"
    
    mkdir -p $DEST
    echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt
    ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt
    [ $PIPESTATUS == 0 ] || exit 1
    make clean
    make -j4 || exit 1
    make install || exit 1
    done
    
    ***********Command ends here**********
    

    Here I attach my cygwin command tool screenshot, Thanks in advance.

    http://www.mediafire.com/?xc3511m9miyknia

  • Error while compile ffmpeg on cygwin for android [closed]

    7 novembre 2011, par Satheesh

    Possible Duplicate:
    Error when run the command ./build.sh in FFmpeg decoder in Android

    I have try to implement the ffmpeg decoding library in my android project.Dowload FFmpeg.I got the ffmpeg library from the bambuser client version and unpack that into the project jni folder.Then i run the extract command(./extract.sh) in cygwin compiler tool(its becoz am using windows os) after that am trying to build ffmpeg library using the command ./build.sh

    I have googled a lot but i cant make it work. Please help me out from this.

    NDK version: NDKr5b Cygwin tool version: 1.7

    My build.sh file is

    /************Command starts here******************/
    
     #!/bin/bash
    
    if [ "$NDK" = "" ]; then
        echo NDK variable not set, assuming ${HOME}/android-ndk
        export NDK=${HOME}/android-ndk
    fi
    
    SYSROOT=$NDK/platforms/android-8/arch-arm
     # Expand the prebuilt/* path into the correct one
    TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows`
    export PATH=$TOOLCHAIN/bin:$PATH
    
    rm -rf build/ffmpeg
    mkdir -p build/ffmpeg
    cd ffmpeg
    
     # Don't build any neon version for now
    for version in armv5te armv7a
    do
    
        DEST=../build/ffmpeg
        FLAGS="--target-os=linux --arch=arm"
        FLAGS="$FLAGS --cross-prefix=arm-linux-androideabi- --arch=arm"
        FLAGS="$FLAGS --sysroot=$SYSROOT"
        FLAGS="$FLAGS --soname-prefix=/data/data/org.rifluxyss.androiddev.livewallpapaerffmpeg/lib/"
        FLAGS="$FLAGS --enable-cross-compile --cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc"
        FLAGS="$FLAGS --enable-shared --disable-symver"
        FLAGS="$FLAGS --nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm"
        FLAGS="$FLAGS --ar=$TOOLCHAIN/bin/arm-linux-androideabi-ar"
        FLAGS="$FLAGS --ranlib=$TOOLCHAIN/bin/arm-linux-androideabi-ranlib"
        FLAGS="$FLAGS --enable-small --optimization-flags=-O2"
        FLAGS="$FLAGS --enable-encoder=mpeg2video --enable-encoder=nellymoser --enable-memalign-hack "
        FLAGS="$FLAGS --disable-ffmpeg --disable-ffplay"
        FLAGS="$FLAGS --disable-ffserver --disable-ffprobe --disable-encoders"
        FLAGS="$FLAGS --disable-muxers --disable-devices --disable-protocols"
        FLAGS="$FLAGS --enable-protocol=file --enable-avfilter"
        FLAGS="$FLAGS --disable-network --enable-pthreads --enable-avutil"
        FLAGS="$FLAGS --disable-avdevice --disable-asm --extra-libs=-lgcc"
    
        case "$version" in
            neon)
                EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
                EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
                # Runtime choosing neon vs non-neon requires
                # renamed files
                ABI="armeabi-v7a"
                ;;
            armv7a)
                EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp"
                EXTRA_LDFLAGS=""
                ABI="armeabi-v7a"
                ;;
            *)
                EXTRA_CFLAGS=""
                EXTRA_LDFLAGS=""
                ABI="armeabi"
                ;;
        esac
        DEST="$DEST/$ABI"
        FLAGS="$FLAGS --prefix=$DEST"
    
        mkdir -p $DEST
        echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt
        ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt
        [ $PIPESTATUS == 0 ] || exit 1
        make clean
        make -j4 || exit 1
        make install || exit 1
    
    done
    
    /****************Command ends here************************/
    

    While compiling this am getting error when linking the archive files into .so files.

    The error is look like "arm-linux-androideabi/bin/ld.exe: cannot find -lavutil Collect2:ld returned 1 exit status make:[libaswscale/libswscale.so] Error 1 make: waititng for unfinished jobs...."

    Please anyone help me to out from this.

  • Linker error when compiling ffmpeg for Android

    7 novembre 2011, par Satheesh

    I have try to implement the ffmpeg decoding library in my android project.Dowload FFmpeg.I got the ffmpeg library from the bambuser client version and unpack that into the project jni folder.Then i run the extract command(./extract.sh) in cygwin compiler tool(its becoz am using windows os) after that am trying to build ffmpeg library using the command ./build.sh

    I have googled a lot but i cant make it work. Please help me out from this.

    NDK version: NDKr5b Cygwin tool version: 1.7

    My build.sh file is

    /************Command starts here******************/
    
     #!/bin/bash
    
    if [ "$NDK" = "" ]; then
        echo NDK variable not set, assuming ${HOME}/android-ndk
        export NDK=${HOME}/android-ndk
    fi
    
    SYSROOT=$NDK/platforms/android-8/arch-arm
     # Expand the prebuilt/* path into the correct one
    TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows`
    export PATH=$TOOLCHAIN/bin:$PATH
    
    rm -rf build/ffmpeg
    mkdir -p build/ffmpeg
    cd ffmpeg
    
     # Don't build any neon version for now
    for version in armv5te armv7a
    do
    
        DEST=../build/ffmpeg
        FLAGS="--target-os=linux --arch=arm"
        FLAGS="$FLAGS --cross-prefix=arm-linux-androideabi- --arch=arm"
        FLAGS="$FLAGS --sysroot=$SYSROOT"
        FLAGS="$FLAGS --soname-prefix=/data/data/org.rifluxyss.androiddev.livewallpapaerffmpeg/lib/"
        FLAGS="$FLAGS --enable-cross-compile --cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc"
        FLAGS="$FLAGS --enable-shared --disable-symver"
        FLAGS="$FLAGS --nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm"
        FLAGS="$FLAGS --ar=$TOOLCHAIN/bin/arm-linux-androideabi-ar"
        FLAGS="$FLAGS --ranlib=$TOOLCHAIN/bin/arm-linux-androideabi-ranlib"
        FLAGS="$FLAGS --enable-small --optimization-flags=-O2"
        FLAGS="$FLAGS --enable-encoder=mpeg2video --enable-encoder=nellymoser --enable-memalign-hack "
        FLAGS="$FLAGS --disable-ffmpeg --disable-ffplay"
        FLAGS="$FLAGS --disable-ffserver --disable-ffprobe --disable-encoders"
        FLAGS="$FLAGS --disable-muxers --disable-devices --disable-protocols"
        FLAGS="$FLAGS --enable-protocol=file --enable-avfilter"
        FLAGS="$FLAGS --disable-network --enable-pthreads --enable-avutil"
        FLAGS="$FLAGS --disable-avdevice --disable-asm --extra-libs=-lgcc"
    
        case "$version" in
            neon)
                EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
                EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
                # Runtime choosing neon vs non-neon requires
                # renamed files
                ABI="armeabi-v7a"
                ;;
            armv7a)
                EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp"
                EXTRA_LDFLAGS=""
                ABI="armeabi-v7a"
                ;;
            *)
                EXTRA_CFLAGS=""
                EXTRA_LDFLAGS=""
                ABI="armeabi"
                ;;
        esac
        DEST="$DEST/$ABI"
        FLAGS="$FLAGS --prefix=$DEST"
    
        mkdir -p $DEST
        echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt
        ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt
        [ $PIPESTATUS == 0 ] || exit 1
        make clean
        make -j4 || exit 1
        make install || exit 1
    
    done
    
    /****************Command ends here************************/
    

    While compiling this am getting error when linking the archive files into .so files.

    The error is look like "arm-linux-androideabi/bin/ld.exe: cannot find -lavutil Collect2:ld returned 1 exit status make:[libaswscale/libswscale.so] Error 1 make: waititng for unfinished jobs...."

    Please anyone help me to out from this. Thanks in advance