Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
GarfGlider
Posts: 5
Joined: Thu May 26, 2022 12:43 am

Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by GarfGlider »

Description of problem or question:
When attempting to convert a .mkv file from OBS to an .mp4 file, it changes the framerate of the file from 59.94 constant fps to 59.92-59.96 variable fps. It creates a constant ramerate file when using a 60fps setting, but would heavily desync the audio when dealing with a 40-minute clip.

The end goal is to get the clip into Premiere to edit at its original framerate, so I can place effects on it without Premiere getting angy and taking ~5-10 seconds to load every time I move the playhead

Things I've tried:
1. removing the audio tracks from the re-encode
2. Skipping the first 5-10 seconds of the video via the range selector in Handbrake, as the first ~5 seconds of the first video I encoded appear to be at least slightly corrupted, as Windows's base video player seems to struggle with playing that section's video back
3. Switching to 60fps instead of 59.94
4. Recording a second video from the same source with the same settings
5. Changing from my custom preset to a pre-made one (Production Proxy 540p) and changing nothing (as well as another test with the framerate changed to 59.94 instead of "same as source"



Steps to reproduce the problem (If Applicable):
1. Input .mkv file into handbrake, generated from these OBS settings
2. Set up a preset with constant framerate and select 59.94
3. Encode
4. Check file using MediaInfo or some other program that can detect whether or not a file has a variable frame rate


HandBrake version (e.g., 1.0.0):
1.5.1 (2022011000)
This also happened on 1.3.1 earlier today, updated to attempt to fix the problem, no dice



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 Home version 1909 OS build 18363.1556



HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

[url=https://pastebin.com/DWm5SiNy] Here's my pastebin of the activity log[/url]
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by JohnAStebbins »

What tool are you using to measure HandBrake's output framerate?
GarfGlider
Posts: 5
Joined: Thu May 26, 2022 12:43 am

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by GarfGlider »

I'm using MediaInfo: https://mediaarea.net/en/MediaInfo
Premiere also says "variable frame rate detected" when I right click>properties on the clip.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by mduell »

On a 90kHz timebase, you'd expect 59.94 fps to jitter every frame between 1501 cycles and 1502 cycles. That's as constant as it gets with HB's 90kHz timebase.
GarfGlider
Posts: 5
Joined: Thu May 26, 2022 12:43 am

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by GarfGlider »

So in other words, I'm going to have to find another program to work with or only deal with 60fps proper and desync my audio?
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by Ritsuka »

Yes, unfortunately Premiere is stuck in the '90, it's the only editor I know that has this kind of issue.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by mduell »

If you make it 60fps in HB it won't desync the audio, it will insert a duplicate frame once every 1000 frames.
GarfGlider
Posts: 5
Joined: Thu May 26, 2022 12:43 am

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by GarfGlider »

Very glad I checked the thread again.
Am I understanding your post correctly in saying that since it's inserting a duplicate frame every 1000 frames, it does a similar operation to the audio tracks to compensate?
Deleted User 11865

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by Deleted User 11865 »

No, it's reducing the durations of the video frames to compensate.

So, every 1001 seconds, you go from 60,000 frames with a duration of 1.001 / 60 second per frame to 60,000 + 60 = 60,060 frames with a duration of 1.000 / 60 second per frame (final duration identical at 1001 seconds).

(note that "59.94" fps is actually 60,000 / 1001 frames per second)
GarfGlider
Posts: 5
Joined: Thu May 26, 2022 12:43 am

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by GarfGlider »

Oh, duh. Thanks for spelling that out for me!
ugury3806
New User
Posts: 3
Joined: Sat Oct 22, 2022 5:51 pm

Re: Handbrake converting 59.94fps video to variable frame rate when set to constant frame rate

Post by ugury3806 »

I don't know why but seems like HandBrake has a problem. Whenever I select "constant frame rate" on MP4 conversations it ends up with variable frame rate (according to MediaInfo) but when I convert it to MKV with using MKVToolNix it becomes constant frame rate. MPV Player also does not show any frame rate change while playing it. I also tried to convert video with FFmpeg and it does not have this problem.
Post Reply