[FFmpeg-user] DTS discontinuity

Mark Filipak markfilipak.imdb at gmail.com
Mon Dec 25 10:36:54 EET 2023

On 12/25/23 02:05, Carl Zwanzig wrote:
> On 12/22/2023 3:24 PM, Mark Filipak wrote:
>> The log below is a version I cooked up to show 'N' only for I-frames.
> Um, what's the actual command? There aren't a lot of options to ffprobe, but it's still good to show 
> the command anyway.

Hi Carl, Happy Christmas or Happy Holidays (whatever :-)

I will give you 3 commands. But first...

I'm having weeks of difficulties making a seamless join of trims shown below -- fair use copies of 
Criterion's BD of Ingmar Bergman's FANNY AND ALEXANDER" (the 5+ hour version) that I so love. 
English subtitles are crucial of course.

h:\BDMV\STREAM\00305.m2ts: TRIM=-ss 20.062 -to 1:33:10.835
h:\BDMV\STREAM\00306.m2ts: TRIM=-ss 15.098 -to 1:15:18.472

I-frames on both ends of both trims. I tried all the easy ways and always got a 2 second stutter 
with 3 flashes (or worse) at the join (plus, MPV shows 5000+ hours of running time). The problem has 
always been the subtitle stream. Now I'm going the hard route of meticulously crafting the PTS 
offset to add to the trimmed version of 00306.m2ts to produce a perfect join, but nothing I do 
works. (Note that I'm going MKV so I can extract & SRT-convert the subs at the end.)

There's 3 cases. (Note that I'm now analyzing h:\BDMV\STREAM\00305.m2ts as that's where the problem 
seems to be.)

ffprobe -i h:\BDMV\STREAM\00305.m2ts
- This produces a suggestion to add -analyzeduration & explicit -probesize.

set PREP=-analyzeduration 240000000 -probesize 1000000000
ffprobe %PREP% -i h:\BDMV\STREAM\00305.m2ts
- Those values eliminates the suggestion but produces the 6 'DTS discontinuity' notices shown 

set PREP=-analyzeduration 5772725000 -probesize 15091101696
ffprobe %PREP% -i h:\BDMV\STREAM\00305.m2ts
- Those values produce 165 'DTS discontinuity' notices ending with packet 6027.

In the context of subtitles, what is a 'DTS discontinuity'? I thought subs were jammed into 
private_stream_2 packets inside audio PESs and just appeared at the same time as the audio. Also, 
packet 6027 is almost nothing. There has to be hundreds of thousands of packets in an hour and a 
half. Are there more discontinuities that are beyond analyzeduration 5772725000?

Also, the subtitle stream's start_pts from ffmpeg '-vf showinfo' and from ffprobe '-show_streams' 
don't match!

To top it all off, No matter what 'analyzeduration' & 'probesize' are set to, the 00305.mkv copy is 
the same (or it appears to be the same to the ffmpeg/ffprobe tools).

More information about the ffmpeg-user mailing list