1 frame info screen

Please post here for issues related to DVD discs
Post Reply
Anuskuss
Posts: 8
Joined: Thu Apr 04, 2024 12:20 am

1 frame info screen

Post by Anuskuss »

I have this DVD which has an extra that first shows a text panel before the actual video. The video data for that is only 1 frame but through the use of timestamps (DTS) they stretch it to 15 seconds. MakeMKV doesn't handle this and instead "fixes" the timestamps so the image only shows up for that 1 frame and the actual video starts at frame 2. This makes the text unreadable (you only get 40ms :P) and causes there to be no audio for 15 seconds. After that the video is fine and (miraculously) in sync.

Note that most players don't know how to handle this either. Leawo Blu-ray Player exhibits the same behaviour (software that specializes in physical media playback), so does mpv:

Code: Select all

Invalid video timestamp: 0.000000 -> -0.049444
# wait 15 seconds
Invalid audio PTS: 14.976000 -> -0.049444
Reset playback due to audio timestamp reset.
VLC media player just shows an empty (not even black, empty) video for 15 seconds (until the audio data comes in). The only player I found that can properly show it is CyberLink PowerDVD.

ffmpeg doesn't do to well either; it just wants to "fix" the problem:

Code: Select all

[vist#0:1/mpeg2video @ 0x56309c7b3d00] timestamp discontinuity (stream id=480): 14961444, new offset= 0
[aist#0:2/ac3 @ 0x56309c7b2a80] timestamp discontinuity (stream id=128): -14929444, new offset= 14929444
[vist#0:1/mpeg2video @ 0x56309c7b3d00] timestamp discontinuity (stream id=480): 14929444, new offset= 0
[aist#0:2/ac3 @ 0x56309c7b2a80] timestamp discontinuity (stream id=128): -14897444, new offset= 14897444
[vist#0:1/mpeg2video @ 0x56309c7b3d00] timestamp discontinuity (stream id=480): 14897444, new offset= 0
[aist#0:2/ac3 @ 0x56309c7b2a80] timestamp discontinuity (stream id=128): -14865444, new offset= 14865444
[vist#0:1/mpeg2video @ 0x56309c7b3d00] timestamp discontinuity (stream id=480): 14865444, new offset= 0
[aist#0:2/ac3 @ 0x56309c7b2a80] timestamp discontinuity (stream id=128): -14833444, new offset= 14833444
[aac @ 0x56309c7fa040] Queue input is backward in time
[aost#0:1/aac @ 0x56309c80ba40] Non-monotonic DTS; previous: 717824, current: 717312; changing to 717825. This may result in incorrect timestamps in the output file.
I tried messing with the fps_mode and the fflags (e.g. genpts, igndts) but that didn't help either (note that the goal here is to do it losslessly).

Is this out of scope for MakeMKV? The only other software I tried was DGMPGDec but that also couldn't deal with this. I'll probably check out other software at some point, although I doubt that they'll do any better; this just smells like it needs some custom code because I'm thinking that all demultiplexers will just assume that the timestamps are bad.

I also have some ideas about how to (losslessly) fix the problem: Since the timestamps in the MKV are "good" I can just extract the first frame and duplicate it to the desired length. I don't know how to access the missing audio data though so I might have to take that from another source and transcode it to AC3. But before I jump through any hoops I'd first like to get your feedback. I can also post a 12 MiB sample if a dev is interested (it'll only be ~20 seconds so it should be legal to post on here).
flojo
Posts: 254
Joined: Thu Jun 22, 2023 4:27 am
Location: El Paso

Re: 1 frame info screen

Post by flojo »

Anuskuss wrote:
Mon Sep 15, 2025 6:09 am
Is this out of scope for MakeMKV?
Yes. Since you understand what is going on, I think you understand that it's an interpretation for the player. That said, there might be an option with mkvmerge (used by MKVToolNix), but I don't know it and that isn't MakeMKV anyhow.

Sadly, none of the media players or containers have advanced much in the last 20 years... Blu-ray menus are still considered "advanced" :-/.

Since that 1 frame is undoubtedly a keyframe, you could dupe it how ever many times and prepend/append it back to the video stream (at least this wouldn't be a lossy operation).

Hopefully I'm wrong everything and there's a easy fix, good luck!
Post Reply