Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to upgrade ffmpeg on CentOS 5.9 ? [closed]

    20 mars 2013, par Lisa

    Currenty I have CentOS 5.9 and the installed version of ffmpeg is 0.6.5

    Using Yum update ffmpeg I get the message that there are not packadges. Yet the latest version of ffmpeg is 1.2

    How is it possible to upgrade ffmpeg using yum?

  • Is there any way to compile ffmpeg library on Windows ?

    20 mars 2013, par AB1209

    Hi I have been working for weeks to compile ffmpeg library on Windows platform.But I found no way so far.Is it there any way to compile ffmpeg library on Windows 7.

    I am using Cygwin on Windows. Whenever I try to do ndk-build I get this message.

    Android NDK: ERROR:jni/yuv2rgb/Android.mk:ffmpeg-prebuilt: LOCAL_SRC_FILES points to a missing file
    Android NDK: Check that jni/ffmpeg-build/armeabi/libffmpeg.so exists  or that its path is correct
    /cygdrive/D/AndroidNDK/android-ndk-r8c/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting    .  Stop.
    

    & while searching for solution of this error I found that I will have to compile the libraries first.For compiling by using ./build_android.sh. I got this error message.

    ./build_android.sh
    ./build_android.sh: line 72: ./configure: No such file or directory
    

    Please please guide me what should I do.

  • Problems with libavcodec Audio Decoding

    20 mars 2013, par CharDev

    Can anyone point out what I'm doing wrong here? I followed the code in the examples and can't see anything wrong with my code, however, running the program with "/test/test.flac /test/test.wav" as the arguments, and then running "ffmpeg -i /test/test.wav", I get "/test/1.wav: Invalid data found when processing input".

    -Edit- I've fixed the previous issue using Multimedia Mike's answer, however now I'm having trouble with AVStream. After creating it, AVStream->codec->codec is NULL. I've updated the source code below.

    #include 
    #include 
    #include 
    #include 
    extern "C" {
        #include avutil.h>
        #include avformat.h>
        #include avcodec.h>
    }
    
    int main(int argc, char* argv[]) {
        if (argc != 3) {
            std::cout << "Syntax Error" << std::endl;
            return 1;
        }
        std::string inFilePath = argv[1];
        std::string outFilePath = argv[2];
        std::ifstream inFile;
        inFile.open(inFilePath.c_str(), std::istream::in | std::istream::binary);
        std::ofstream outFile;
        outFile.open(outFilePath.c_str(), std::istream::out | std::istream::binary);
        av_register_all();
        avcodec_register_all();
        AVFormatContext* formatContext = NULL;
        avformat_open_input(&formatContext, inFilePath.c_str(), NULL, NULL);
        AVCodecContext* codecContext = formatContext->streams[0]->codec;
        AVCodec* codec = avcodec_find_decoder(codecContext->codec_id);
        avcodec_open2(codecContext, codec, NULL);
        AVPacket* packet; av_init_packet(packet);
        AVFrame* frame = avcodec_alloc_frame();
    
        //WAV Header
        AVFormatContext* wavContext = NULL;
        avformat_alloc_output_context2(&wavContext, NULL, NULL, outFilePath.c_str());
        AVCodec* wavCodec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE);
        AVStream* wavStream = avformat_new_stream(wavContext, wavCodec);
        AVCodecContext* wavCodecContext = wavStream->codec;
        avcodec_open2(wavCodecContext, wavCodec, NULL);
        wavCodecContext->channels = codecContext->channels;
        wavCodecContext->sample_fmt = AV_SAMPLE_FMT_S16;
        wavCodecContext->bit_rate = 1411000;
        wavCodecContext->sample_rate = 44100;
        avio_open(&wavContext->pb, outFilePath.c_str(), AVIO_FLAG_WRITE);
        avformat_write_header(wavContext, NULL);
        //End WAV Header
    
        int ret = 0;
        while (av_read_frame(formatContext, packet) == 0) {
            while (packet->size > 0) {
                int len = avcodec_decode_audio4(codecContext, frame, &ret, packet);
                int datasize = av_samples_get_buffer_size(NULL, codecContext->channels, frame->nb_samples, codecContext->sample_fmt, 1);
                packet->size -= datasize;
                outFile.write((char*)frame->data[0], datasize);
            }
        }
        av_write_trailer(wavContext);
        std::cout << "Done!" << std::endl;
        return 0;
    }
    
  • ffmpeg not using wildcard properly from batch script

    20 mars 2013, par Paul Green

    What I want to do is actually super simple and is working just fine if executed from within the cmd window, though it does not work when used within a batch script. The following command would normally get all .png files with the pattern anim_xxxx.png (%04d stands for 4 numbers in ffmpeg).

    ffmpeg -f image2 -i anim_%04d.png -vcodec mjpeg -q:v 0 -r 25 foo.avi
    

    Now the error I get is with the wildcard for my image sequence and I have no clue what the problem is. Using another wildcard like * gives me the same error.

    [image2 @ 000000000033e8c0] Could find no file with with path 'anim_render.bat4d.png' and index in the range 0-4 anim_render.bat4d.png: No such file or directory

    does %04d resemble any variable in a batch file that does not exist outside of batch files? I could not find any similar cases so far.

  • Call ffmpeg overlay filter from a c++ program

    20 mars 2013, par Dan Monson

    I am writing a program and I want to implement a way to overlay an image with another image using ffmpeg. I know how to do it with the command line, but is there a way to include some ffmpeg files into my program and call the overly function?