Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG Seeking brings audio artifacts

    20 décembre 2018, par Gabriel Simões

    I'm implementing a audio decoder using ffmpeg. While reading audio and even seeking already works, I can't figure out a way to clear the buffers after seeking so I have no artifacts when the app starts reading audio right after seeking.

    avcodec_flush_buffers doesn´t seem to have any effect on the internal buffers. This issue happens with all decoders (mp3, aac, wma, ...) but PCM/WAV (which doesn´t use internal buffers to hold data to decode since the audio is not compressed).

    The code snippet is simple:

    av_seek_frame(audioFilePack->avContext, audioFilePack->stream, posInTimeFrame, AVSEEK_FLAG_ANY);
    avcodec_flush_buffers(audioFilePack->avContext->streams[audioFilePack->stream]->codec);
    

    Explaining:

    audioFilePack->avContext = FormatContext
    audioFilePack->stream = Stream Position (also used to read audio packets)
    audioFilePack->avContext->streams[audioFilePack->stream]->codec = CodecContext for the codec used
    

    Any ideas on what I should do so I can seek and get no residual audio? Thanks!

  • Getting file info with ffmpeg, object file recognized as Audio ?

    20 décembre 2018, par cpl

    I'm testing a C++ program that should iterate in a directory and find all multimedia files. I used an iteration routine, and for every file I tried using the libav functions to open the file, such as av_find_stream_info in order to find stream info. It works fine for multimedia files, such as video and images, but the problem is that it recognizes some files as audio or video, for example it sees an audio stream inside a .o file! I also tried to use av_read_frame and it worked fine, without errors! I would like to avoid filtering by extension, is there any other solution to find "playable" files?

    Thanks

  • How do I extract Xing/LAME frames using ffmpeg ?

    20 décembre 2018, par Jeff

    Using a program which already makes use of ffmpeg for audio processing, I would like to extract and parse Xing/LAME style mp3 frames.

    (unlike other mp3 metadata, xing/lame metadata is stored in dummy mp3 files in the stream)

    Unfortunately for me, av_seek_frame() only seems to support seeking to the first frame containing actual audio in the file. Even if I seek using byte-seeking mode to 0, I end up in a position in the file after the LAME/Xing frames. This is also the case if I simply open the file and begin reading frames without seeking.

    Can ffmpeg be persuaded to read the frames that I want? And, will the LAME/Xing data potentially span multiple frames?

  • Which frame does ffmpeg get when reducing the frame rate

    20 décembre 2018, par Peter

    I have some video that I would like to convert to images of frames every 2 sec.

    E.g. If the video is 7 seconds long at 15 fps I would like to get frames 1, 31, 61, 91.

    The command:

    ffmpeg -i foo.mp4 -r 0.5  -f image2 -vcodec mjpeg foo%d.jpg
    

    appears to do what I want, but which frame does it get? 1, 31, 61, 91 or 30, 60, 90 or 13, 43, 73, 103?

  • ffmpeg image generation in equal interval

    20 décembre 2018, par webkul

    I'm using ffmpeg in Ubuntu for the image creation and video conversion my problem is i want to generate image(thumbnail) at different intervals. suppose that i upload a video then it calculate the video time and generate 5 images(thumbnail) at equal intervals.(e.g. suppose that the time period of the video is 50 minutes then images obtains at 0,10,20,30,40,50 intervals)

    please help

    thanks