Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Execute FFmpeg commands in android

    25 septembre 2013, par user2816350

    I have all the ffmpeg´s files compiled in my android project, but I don´t know how to call ffmpeg commands. How can I get the "executable" file of the compiled library? What is it exactly? Thanks!!

  • What is a good way to calculate the frame rate of a video file using ffmpeg ?

    25 septembre 2013, par user1914692

    I find two possible ways:

    (Option 1) inVStruct.inVideoStream->r_frame_rate.num / inVStruct.inVideoStream->r_frame_rate.den

    [comment:] correct for some videos. Not always correct. it is libavformats guess, not exact. (see http://ffmpeg.org/pipermail/ffmpeg-devel/2005-May/003079.html )

    (Option 2) (double) inVStruct.inCodecContext->time_base.den / inVStruct.inCodecContext->time_base.num / inVStruct.inCodecContext->ticks_per_frame);

    [comment:] correct for some videos. Not always correct.

    Please recommend one for all video files.

  • How to get video duation in seconds ?

    25 septembre 2013, par user2783132

    How can I get video duration in seconds?

    what I've tried:

    ffmpeg -i file.flv 2>&1 | grep "Duration"
      Duration: 00:39:43.08, start: 0.040000, bitrate: 386 kb/s
    
    
    mediainfo file.flv | grep Duration
    Duration : 39mn 43s
    

    this what close, but it's not so accurate, 2383 is 39.71 minutes

        ffmpeg -i file.flv 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }'
    2383
    
  • what is a good way to calculate frame rate of a video using ffmpeg ?

    25 septembre 2013, par user1914692

    I find two possible ways:

    (Option 1) inVStruct.inVideoStream->r_frame_rate.num / inVStruct.inVideoStream->r_frame_rate.den

    [comment:] correct for some videos. Not always correct. it is libavformats guess, not exact. (see http://ffmpeg.org/pipermail/ffmpeg-devel/2005-May/003079.html )

    (Option 2) (double) inVStruct.inCodecContext->time_base.den / inVStruct.inCodecContext->time_base.num / inVStruct.inCodecContext->ticks_per_frame);

    [comment:] correct for some videos. Not always correct.

    Please recommend one for all video files.

  • Extract every frame form a variable-frame-rate video with ffmpeg

    25 septembre 2013, par Xocoatzin

    I'm trying to extract all the frames on several videos. Those videos were captured on a camera that saves the output with a variable frame rate, thus, some frames are closer together in time than others (from ~27 to ~30 fps according to mediainfo)

    This frames are to be synchronized with some metadata, so I not only need to extract them but also keep the information of the [relative] time each frame of the video has been shot.

    I've been using ffmpeg to extract video frames, the challenge comes when the video frame rate is not constant any more. Any other method or program different than ffmpeg is ok as far as it can get the job done.