Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Frames per second Conceptual Details

    25 février 2014, par Whoami

    i am a newbie and trying to understand the concepts behind ffmpeg/video.

    FPS means frame per second , for example

    25fps -> 25 frames captured in a second
    

    From the display perpective

    25 frames need to be displayed in a second.
    

    correct me if i am wrong?

    Now i have written a simple video player in ffmpeg to display. i read frames by av_read_frame(), if fps is 25, then does

     av_read_frame()
    

    returns 25 frames per second? how can i relate it?

  • Using FFmpeg and IPython

    25 février 2014, par Kreger51

    I am relatively new to Python (I used MATLAB a lot more). I essentially want to be able to make and save animations. So I went and checked how it's done and found this : http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/

    I straight up copied/pasted the code in an IPython Notebook.

    I understand that ffmpeg must be installed, which I thought I did (according to http://www.wikihow.com/Install-FFmpeg-on-Windows). The path is C:/ffmpeg. It does work when I try ffmpeg -version in the command prompt. It also works in WinPython's command prompt. I don't know if it helps, but the path for Ipython is : C:\Users\Sal\WinPython-32bit-3.3.2.3\python-3.3.2\Scripts /

    However, it still doesn't work. The error given is : AttributeError: 'str' object has no attribute 'saving' This error occurs at the .save command of course. I even tried to add what's below. Doesn't do anything extra. writer = 'ffmpeg'

    I am using Windows 7, WinPython3.3.

    Thank you very much

  • Can I determine the reference frame while I encoding images into a video in ffmpeg ?

    25 février 2014, par user3346886

    everyone. I recently needed to encode some images into a video. Can I determine which image is a I-frame during the process of encoding images into a video or determine which image is its reference frame while encoding P-frame? The first method come to my mind is to use ffmpeg to implement.The reason is that it seems be easy for beginners. In ffmpeg I use libx264 as encoding library. I have used google to search some introductions about using libx264 in ffmpeg. Until now I just found the parameter related about this is "ref" which can determine the number of reference frame. But I can't find any parameter about what I wanted. Can anyone help me about this? Thank you very much! BTW.If I violate rules in stackoverflow Forum.Please tell me.Thamks.

  • How to show audio bitrate information

    25 février 2014, par poc

    The ffmpeg only shows the video bitrate.How can I show the audio bitrate when I dump a streaming to file

    ffmpeg -i rtsp://172.19.1.40/live.sdp -acodec copy -vcodec copy export.avi

    enter image description here

    enter image description here

  • How to get current frame number using ffmpeg c++

    25 février 2014, par John Simpson

    Usually, I use the below code to get the current frame number when decoding a video.

    while(av_read_frame(pFormatCtx, &packet)>=0) {
        if(packet.stream_index==videoStream) {
          // Decode video frame
          avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
    
          // Did we get a video frame?
          if(frameFinished) {
        int currentFrameNumber = pFrame->coded_picture_number; 
        }
        /* Free the packet that was allocated by av_read_frame*/
        av_free_packet(&packet);
      }
    

    Then, when I implemented seeking feature, I add av_seek_frame to seek to a desired position like this:

    if(av_seek_frame(pFormatCtx, -1, seekTarget, 0 )<0){
             LOG("log","error when seeking");
    }
    while(av_read_frame(pFormatCtx, &packet)>=0) {
            if(packet.stream_index==videoStream) {
              // Decode video frame
              avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
    
              // Did we get a video frame?
              if(frameFinished) {
            int currentFrameNumber = pFrame->coded_picture_number; 
            }
            /* Free the packet that was allocated by av_read_frame*/
            av_free_packet(&packet);
     }
    

    This is when the problem arises. pFrame->coded_picture_number returns incorrect value. My question is how I cam get the current frame given I have a decoded frame pFrame ?