Auto-adjust subtitles (23.976 vs 24.000)

Hi team!

I found what I initially believed to be a bug but is actually more likely a feature request for some poorly behaving source assets. To summarize the issue, you can see this snapshot:

This is a screenshot of Next Level Chef - S03E04. Here is the mkvinfo:

+ EBML head
|+ EBML version: 1
|+ EBML read version: 1
|+ Maximum EBML ID length: 4
|+ Maximum EBML size length: 8
|+ Document type: matroska
|+ Document type version: 4
|+ Document type read version: 2
+ Segment: size 1642966515
|+ Seek head (subentries will be skipped)
|+ Tracks
| + Track
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 18430945986115536741
|  + Track type: video
|  + "Lacing" flag: 0
|  + Language: und
|  + Codec ID: V_MPEG4/ISO/AVC
|  + Language (IETF BCP 47): und
|  + Video track
|   + Pixel width: 1920
|   + Pixel height: 1080
|   + Display width: 1920
|   + Display height: 1080
|  + Codec's private data: size 43 (H.264 profile: High @L4.0)
|  + Default duration: 00:00:00.041708333 (23.976 frames/fields per second for a video track)
| + Track
|  + Track number: 2 (track ID for mkvmerge & mkvextract: 1)
|  + Track UID: 3200311558369800582
|  + Track type: audio
|  + Language: eng
|  + Codec ID: A_AAC
|  + Codec's private data: size 2
|  + Default duration: 00:00:00.042666666 (23.438 frames/fields per second for a video track)
|  + Language (IETF BCP 47): en
|  + Audio track
|   + Sampling frequency: 24000
|   + Channels: 2
| + Track
|  + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
|  + Track UID: 5761394053415090534
|  + Track type: subtitles
|  + "Lacing" flag: 0
|  + Language: eng
|  + Codec ID: S_TEXT/UTF8
|  + Language (IETF BCP 47): en
|  + "Default track" flag: 0
|+ EBML void: size 3773
|+ Segment information
| + Timestamp scale: 1000000
| + Multiplexing application: libebml v1.4.5 + libmatroska v1.7.1
| + Writing application: mkvmerge v82.0 ('I'm The President') 64-bit
| + Duration: 00:43:14.667000000
| + Date: 2024-02-16 03:36:19 UTC
| + Segment UID: 0xd1 0xfb 0xb0 0x26 0x0f 0xed 0xdd 0x9f 0xfe 0xd8 0x0d 0x0f 0x75 0x0a 0x57 0x10
|+ EBML void: size 1367
|+ Cluster

And after extracting the SRT from the MKV, this is the timed text event in question:

835

00:30:33,165 --> 00:30:36,041
Have a chat amongst yourselves,
because right now we need

Everything about this video file (not the SRT) is claiming to be a “true” 23.976 video (e.g. 24000 / 1001). During playback, however, it is ACTUALLY a “true” 24fps video (e.g. 24000 / 1000). The SRT file reflects this (accurately) but because of the MKV reporting itself as 23.976 the timing is “off”. By this point in the content, subtitle events have drifted ahead by ~43 frames.

Put another way

1 minute of content @ a true 23.976 contains 1438.56143856 frames
1 minute of content @ a true 24 contains 1440 frames

Every minute you will fall (ROUGHLY) 1.43856144 frames out of sync - by the 30 minute mark you will be 43.1568432 frames “off” and by the 90 minute mark you’ll be a whopping 129.4705296 frames off (obviously we know there are no partial frames but whatever just proving the math).

My suggestion / comment / feedback would be to somehow manually override the SRT event timing by allowing a user to decide a differing framerate. In this case, the ability to inform Infuse that the timing of the SRT should be based on a raw 24fps instead of 23.976 would correct the content.

Happy to answer any other “maths” here - I have an astonishingly stupid amount of experience regarding framerates and timing so I’m here to help.

-C

1 Like

As someone who uses subs on everything, I have wondered about this. Feels like 1 in 4 shows I watch (never movies, fwiw) has this subtitle drift problem on Infuse. I haven’t tried playing them back elsewhere.

I’m a bit confused…so the subs appear out of sync anywhere you’re playing this MKV, or just Infuse?

This seems like a mistake with the muxing. Have you tried other players? You can remux it with mkvmerge and correct the subs by stretching or dividing the track by 1.001 (I think that should work, but if not, you can demux the subs and correct them with a sub program like Subtitle Workshop).

You can also search for subs from Infuse, I often do that and haven’t had many issues, though especially for this purpose it would be nice if Infuse distinguished between 23.976 and 24 fps on subtitle search, like opensubtitles does on their website @james