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
+ Reply to Thread
Results 1 to 7 of 7
-
-
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.
-
-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.
-
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. -
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.
As you suggested, "-vf fps=30" does indeed deliver CFR at 30 fps with VP9 in WEBM, ie, duplicate frames.
Similar Threads
-
Avisynth+ and grabbing x frames every y frames? I'd like to sample a clip
By Msuix in forum EditingReplies: 2Last Post: 11th May 2021, 15:41 -
29.97FPS video with many duplicated frames, convert for YouTube upload
By abolibibelot in forum Video ConversionReplies: 13Last Post: 19th Aug 2019, 11:16 -
MPC-HC duplicated audio devices
By amowba_pro in forum Newbie / General discussionsReplies: 1Last Post: 5th Dec 2018, 17:36 -
Every 6th frame is duplicated
By jorge69696 in forum Video ConversionReplies: 13Last Post: 29th Oct 2018, 12:27 -
Replace random duplicate frames with black frames (AVISYNTH)
By benzio in forum EditingReplies: 7Last Post: 31st Jan 2018, 16:43