Log in

View Full Version : VFR to CFR conversion without re-encoding?


vin97
11th June 2020, 16:57
Is there a way to convert variable framerate H.264 videos to constant framerate without re-encoding?
So detecting duplicate or dropped frames and adjusting the metadata (if that's the right word) accordingly.
I'm talking about relatively small variations in framerate here (approx. between 59.5 and 60fps).

poisondeathray
11th June 2020, 18:35
Is there a way to convert variable framerate H.264 videos to constant framerate without re-encoding?
So detecting duplicate or dropped frames and adjusting the metadata (if that's the right word) accordingly.
I'm talking about relatively small variations in framerate here (approx. between 59.5 and 60fps).

You edit the timecodes as constant . But if it's minimally variable, it can go slightly in and out of sync in sections, but it's probably negligible for your example

eg. You can do this with mkvtoolnix / mkvmerge for mkv , or mp4fpsmod for mp4

vin97
12th June 2020, 00:56
Thanks!

I guess I will just set the framerate as to match the audio duration then to be safe.

benwaggoner
15th June 2020, 00:04
Thanks!

I guess I will just set the framerate as to match the audio duration then to be safe.
It depends on why the source is VFR. Sometimes VFR has all the frame rates at a multiple of the base fps. So if there are five identical frames, VFR might have a single frame with 5x the default duration. In CFR, the frames are all the same duration, and the repeated frame would be followed by 4 frame_repeat tags. The right solution would be to convert long duration frames into that frame followed by repeat frames. If that's the case with your content, spreading the fps over the whole file can cause some obvious lip sync issues.

If it is VFR because 1 out of 120 frames getting randomly dropped, evening out the frames would work better.