madshi bug tracker - eac3to
View Issue Details
0000453eac3tobugpublic2016-12-08 14:472016-12-08 15:18
0000453: Questionable gaps in AC-3 tracks of MPEG-TS DVB captures
How exactly does eac3to determine that there are gaps in the source file?

eac3to v3.31 often finds gaps in AC-3 tracks of my MPEG-TS DVB captures. The problem is that I cannot tell why. Consider this attached raw, unprocessed sample (17 MB) straight from the capture device: [^]

"eac3to -check" claims there is a 21 ms gap in this file at playtime 0:00:03. How is this calculated? PES packets which are part of stream 0x13F0 have continuous PTS, continuity counters in TS packet headers are correct, each PES packet has exactly four AC-3 frames, there are no playback issues. So where is the alleged gap?

The gap warning is displayed regardless of the AC-3 decoder used, "-no2ndpass" also does not help. What is even more confusing is that if you cut off the _last_ megabyte or so of this sample, "eac3to -check" no longer displays the message in question. This looks like a bug in eac3to.
No tags attached.
zip (7,735,835) 2016-12-08 15:06
zip (7,735,835) 2016-12-08 15:07
Issue History
2016-12-08 14:47kempniuNew Issue
2016-12-08 15:00madshiAssigned To => madshi
2016-12-08 15:00madshiStatusnew => assigned
2016-12-08 15:03madshiNote Added: 0001516
2016-12-08 15:06kempniuFile Added:
2016-12-08 15:07kempniuFile Added:
2016-12-08 15:12kempniuNote Added: 0001517
2016-12-08 15:18madshiNote Added: 0001518

2016-12-08 15:03   
It's somewhat complicated. Looking over all the timings, if the first and last audio samples are stretched too far, eac3to reports that as a gap. Where exactly the gap is can be hard to determine because there can be a lot of jitter in the timings.

I'll put this on my to do list to have a closer look at, but atm I'm mostly concentrated on madVR development, so it could take a while.

The "-no2ndpass" switch will not stop the warnings from being displayed, but at least eac3to should not try to repair the gap.
2016-12-08 15:12   
Thanks for a lightning fast response. Taking a closer look when you find the time is all I can ask for, thanks! I also appreciate the explanation of what "-no2ndpass" does, it might come in handy.

In case the SendSpace link expires, I attached the sample in question to this ticket, after jumping through some hoops to make the upload form happy. To extract the sample, download both files (yes, they are equally sized, to the byte), strip the ".zip" extension off both of them and then extract "audio-has-a-gap-of-21ms-at-playtime-0-00-03.7z.001".
2016-12-08 15:18   
Attaching is a good idea, thanks.