![]() |
|
[BUG] Incorrect handling of variable frame rate source file - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: [BUG] Incorrect handling of variable frame rate source file (/thread-4525.html) |
Incorrect handling of variable frame rate source file - The_Tinkerer - 31.10.2026 I took this over to AI first (Abacus.ai ChatLLM in Agent mode set to Max - Fable 5.1 + GPT-6 Astra) for troubleshooting. The problem is that I couldn't get smooth playback when re-encoding the source to CPS, and I also had mismatching frame totals, and mismatching frames from input file to output file when they did match. Source: General
Count : 365
Count of stream of this kind : 1
Kind of stream : General
Kind of stream : General
Stream identifier : 0
Count of video streams : 1
Count of audio streams : 1
Video formats : HEVC
Video formats (with hints) : HEVC
Codecs Video : HEVC
Audio formats : AAC LC
Audio formats (with hints) : AAC LC
Audio codecs : AAC LC
Total audio channels : 2
Complete name : E:\test_vid\Test_vid_source.mov
Folder name : E:\test_vid
File name extension : Test_vid_source.mov
File name : Test_vid_source
File extension : mov
Format : MPEG-4
Format : MPEG-4
Format/Extensions usually used : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Commercial name : MPEG-4
Format profile : Base Media
Internet media type : video/mp4
Codec ID : isom
Codec ID : isom (isom/iso2/mp41)
Codec ID/Url : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible : isom/iso2/mp41
File size : 525499133
File size : 501 MiB
File size : 501 MiB
File size : 501 MiB
File size : 501 MiB
File size : 501.2 MiB
Duration : 320189
Duration : 5 min 20 s
Duration : 5 min 20 s 189 ms
Duration : 5 min 20 s
Duration : 00:05:20.189
Duration : 00:05:18:32
Duration : 00:05:20.189 (00:05:18:32)
Overall bit rate : 13129724
Overall bit rate : 13.1 Mb/s
Frame rate : 38.870
Frame rate : 38.870 FPS
Frame count : 12434
Stream size : 427866
Stream size : 418 KiB (0%)
Stream size : 418 KiB
Stream size : 418 KiB
Stream size : 418 KiB
Stream size : 417.8 KiB
Stream size : 418 KiB (0%)
Proportion of this stream : 0.00081
HeaderSize : 427858
DataSize : 525071275
FooterSize : 0
Is streamable : Yes
Encoded date : 2025-11-29 19:04:23 UTC
Tagged date : 2025-11-29 19:05:42 UTC
File creation date : 2026-10-30 06:11:12.699 UTC
File creation date (local) : 2026-10-30 02:11:12.699
File last modification date : 2026-09-27 12:31:36.730 UTC
File last modification date (local) : 2026-09-27 08:31:36.730
major_brand : Apple QuickTime (.MOV/QT)
minor_version : 0.0.0
compatible_brands : qt
creation_time : 2025-11-29T19:04:23.000000Z
com.apple.quicktime.author : ReplayKitRecording
encoder : Lavf62.6.101
Video
Count : 402
Count of stream of this kind : 1
Kind of stream : Video
Kind of stream : Video
Stream identifier : 0
Stream order : 0
ID : 1
ID : 1
Format : HEVC
Format : HEVC
Format/Info : High Efficiency Video Coding
Format/Url : http://www.itu.int
Commercial name : HEVC
Format profile : Main@L4.1@Main
Internet media type : video/H265
Codec ID : hvc1
Codec ID/Info : High Efficiency Video Coding
Codec ID/Url : http://www.itu.int/
Duration : 319874
Duration : 5 min 19 s
Duration : 5 min 19 s 874 ms
Duration : 5 min 19 s
Duration : 00:05:19.874
Duration : 00:05:18:32
Duration : 00:05:19.874 (00:05:18:32)
Source duration : 319890
Source duration : 5 min 19 s
Source duration : 5 min 19 s 890 ms
Source duration : 5 min 19 s
Source duration : 00:05:19.890
Source duration : 00:05:18:32
Source duration : 00:05:19.890 (00:05:18:32)
Bit rate : 13005222
Bit rate : 13.0 Mb/s
Width : 886
Width : 886 pixels
Height : 1538
Height : 1 538 pixels
Stored_Width : 896
Stored height : 1552
Sampled width : 886
Sampled height : 1538
Pixel aspect ratio : 1.000
Display aspect ratio : 0.576
Display aspect ratio : 9:16
Rotation : 0.000
Frame rate mode : VFR
Frame rate mode : Variable
Frame rate : 38.870
Frame rate : 38.870 FPS
Minimum frame rate : 15.000
Minimum frame rate : 15.000 FPS
Maximum frame rate : 60.000
Maximum frame rate : 60.000 FPS
Frame count : 12434
Source frame count : 12434
Color space : YUV
Chroma subsampling : 4:2:0
Chroma subsampling : 4:2:0
Bit depth : 8
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.246
Stream size : 520030093
Stream size : 496 MiB (99%)
Stream size : 496 MiB
Stream size : 496 MiB
Stream size : 496 MiB
Stream size : 495.9 MiB
Stream size : 496 MiB (99%)
Proportion of this stream : 0.98959
Source stream size : 520030093
Source stream size : 496 MiB (99%)
Source stream size : 496 MiB
Source stream size : 496 MiB
Source stream size : 496 MiB
Source stream size : 495.9 MiB
Source stream size : 496 MiB (99%)
Source_StreamSize_Proportion : 0.98959
Title : Core Media Video
Writing library : HEVC
Writing library : HEVC
Encoded date : 2025-11-29 19:04:23 UTC
Tagged date : 2025-11-29 19:05:42 UTC
Color description present : Yes
Color description present (source) : Container / Stream
Color range : Full
Color range (source) : Container / Stream
Color primaries : BT.709
Color primaries (source) : Container / Stream
Transfer characteristics : sRGB/sYCC
Transfer characteristics (source) : Container / Stream
Matrix coefficients : BT.709
Matrix coefficients (source) : Container / Stream
Source_Delay : -100
Source_Delay_Source : Container
mdhd_Duration : 319873
Codec configuration box : hvcCIt says, "Frame rate: 38.870 FPS". Hybrid is trying to use that, when it should instead be using 60 FPS (i.e., 60,1). It is also generating an incorrect Matroska timecode v2 file with 19,173 frames instead of the input file's actual frame count of 12,434. According to the AI: Quote:Your source isn't really "38.870 fps". It's an iPhone ReplayKit capture on a 60 Hz grid. Each frame stays on screen for 1, 2 or 3 display refreshes, so the video switches between 60, 30 and 20 fps depending on how much is moving. 38.87 is just the average (12,434 frames ÷ 319.8 s). No frame in the file actually lasts 1/38.87 s. Here is the AI "bug report for the developer": ![]() Quote:Hybrid 2026.10.10.1 (64-bit), Windows 10 22H2. VFR source (iPhone ReplayKit HEVC .mov, 12,434 frames, avg 38.87 fps, actual 60 Hz cadence with 1/2/3-refresh frame durations, tbn 19200, ffmpeg-reported tbr 59.94). ffmpeg N-126512-gf7fbb1260e. Regarding the #4 "Suggestion" above, Hybrid output to the "Log" tab "Current frame rate: 59.946 differs from average time code frame rate: 38.87. This will be ignored since 'Check average fps of mkv/mp4 files' is disabled." As much as I tried, I could not find any Check average fps of mkv/mp4 files setting. I'm not sure if that would have any bearing on anything here. ![]()
Hybrid_Variable_Framerate_Issue.zip (Size: 946,94 KB / Downloads: 4)
Contents of attachment:
RE: Incorrect handling of variable frame rate source file - Selur - 31.10.2026 If your got a 'buggy' source like this the "Suggestion: CFR conversion target for VFR sources." is reasonable and Hybrid already does support this. You can tell Hybrid to work this way,
If the time codes of your source are problematic you can also try enabling "Config->Internals->Handling->Ignore all input timecodes" and if needed overwrite the input frame rate as mentioned above. If neither of those help, I would need a sample clip (~30 seconds) of such content to suggest another approach or modify on how to deal with such content. Cu Selur RE: Incorrect handling of variable frame rate source file - The_Tinkerer - 01.11.2026 Yeah, right now, I can get it to work by overwriting the input frame rate to 60/1. That's basically the fix, as it now matches the source in playback smoothness and timing. The source shows 38.870 fps, but, that's not correct. The only way you can tell this file is 60/1 is by running FFprobe on it; MediaInfo won't help here: Duration: 00:05:20.19, start: 0.000000, bitrate: 13129 kb/s
Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709/bt709/iec61966-2-1), 886x1538, 13005 kb/s, 38.87 fps, 59.94 tbr, 19200 tbn (default)The 59.94 tbr is wrong, you know that by looking at the timebase (tbn), which is 19200. 19200 / 59.94 = 320.320... not an integer, but 19200 / 60 = 320... an integer (this is the "ticks per second"). The AI thing says: Quote:The container timebase is 19200 Hz (a multiple of 60, i.e. 320 ticks per refresh). ffmpeg shows 38.87 fps, 59.94 tbr, 19200 tbn. "tbr" is only ffmpeg's guess at the base rate, and it rounds to the nearest standard value, 59.94. The real base is 60.000. That 59.94-vs-60 mismatch is part of why the bad timecode file is a pure 16/17 ms grid (13,101 × 17 ms, 6,071 × 16 ms): it's a 59.94 CFR grid and has nothing in common with the real timestamps. 10,527 of the 12,434 real timestamps don't appear in it at all. Not sure if Hybrid should be doing anything special with non-standard frame rates or not. But, one thing that is true, is that Hybrid generates timecode v2 files incorrectly for variable fps sources... it should be using FFmpeg with the -fps_mode passthrough option to create the timecode file... otherwise, variable-frame-rate support isn't declared, and FFmpeg's default auto mode switches to CFR, and the timecode v2 file is written incorrectly. This makes it impossible to re-encode the source video with variable frame rate using the timecodes from the source; Hybrid tries with the incorrect timecode v2 file it creates, and glitches out. So I would think you would probably want to at least make that change at least... i.e.: Change this call: ffmpeg.exe -y -i "input.mov" -map 0:0 -f mkvtimestamp_v2 "input.txt" To: ffmpeg.exe -y -i "input.mov" -fps_mode passthrough -map 0:0 -f mkvtimestamp_v2 "input.txt" RE: Incorrect handling of variable frame rate source file - Selur - 01.11.2026 I'm happy to look into the mov vfr issue. (don't have any vfr mov here) Can you upload such a file (30sec or so would be enough) somewhere and send me a link, so I can test with it? So something with movement and where I can see whether the result is sync. This way I wouldn't have to blindly hope that this works. Cu Selur |