VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. hi

    i have cut a piece from a video of 1 min. the source file is 1.mp4
    the file i have cut is 2.mp4.

    i have used

    ./ffmpeg -ss 00:00:00.00 -to 00:01:00.00 -i 1.mp4 -c:v copy -c:a copy 2.mp4

    now i transcoded 2.mp4 to 2.webm using

    ./ffmpeg -r 24 -i 2.mp4 -c:v vp9 -profile:v 3 -pix_fmt yuv422p10le -c:a libopus -r 30 2.webm



    ./ffprobe -show_streams -show_format -count_frames 2.webm > ffprobe2.webm.txt

    shows ffmpeg is not duplicating frames when it transcodes 2.mp4 to 2.webm as it is changing 24 to 30 fps.

    why is this the case?

    attached files

    ffprobe1.mp4.txt
    ffprobe2.mp4.txt
    ffprobe2.webm.txt

    ffmpegversion.txt

    ty
    Image Attached Files
    Quote Quote  
  2. The new file is variable frame rate. The number of frames are the same but the timestamps were changed. In the old file each frame was displayed for 1/24 second. In the new file some are displayed for 1/30 second, some for 2/30 second.
    Quote Quote  
  3. ty very much

    is there a way that i can force ffmpeg to duplicate the frames?
    Quote Quote  
  4. -r produces duplicate frames but when the vp9 encoder sees the duplicates it extends the timestamp rather than creating a new frame. I don't know how to stop it from doing that. One trick you can use is to output to a container that doesn't support VFR (eg AVI) then remux to webm.
    Quote Quote  
  5. Originally Posted by oduodui View Post
    is there a way that i can force ffmpeg to duplicate the frames?

    You would use -vf fps=30

    https://ffmpeg.org/ffmpeg-filters.html#fps-1
    Convert the video to specified constant frame rate by duplicating or dropping frames as necessary.

    But 24 to 30fps using duplication inserts a frame every 5 frames. Motion looks very bad and choppy . It's almost never done that way.
    Quote Quote  
  6. Originally Posted by poisondeathray View Post
    You would use -vf fps=30
    I didn't try that because I thought -r 30 did the same thing. But I guess it's not that simple:

    For an output format like MP4, which defaults to constant frame rate (CFR), -r will generate a CFR stream. For variable frame rate formats, like Matroska, the -r value acts as a ceiling, so that a lower frame rate input stream will pass through, and a higher frame rate stream, will have frames dropped, in order to match the target rate.
    https://trac.ffmpeg.org/wiki/ChangingFrameRate

    As you suggested, "-vf fps=30" does indeed deliver CFR at 30 fps with VP9 in WEBM, ie, duplicate frames.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!