Jump to content

Missing AC3 stream


allanlee

Recommended Posts

Encountered a strannge problem with missing AC3 audio stream:

The channels have 2 audio streams (AC3 5.1 and MPA 2.0), but after a scan using TransEdit, the AC3 streams are missing, only MPA recognized.

However, if I manually edit the channel list in DVBViewer, i.e. duplicate the channel then change the audio PID and codec ("my dirty fix"), it could be recognized and playback & record without any problem.

 

Suspect it could be the broadcaster's fault - these "buggy" AC3 streams shown as "Private PES" in TransEdit before recording; after "my dirty fix" they show as AC3 in TransEdit but cannot be recognized by VideoRedo or TSDoctor. TMPGEnc seems to be the only software can correct these streams.

Initially I thought it was the same as this issue, but seems not the case. The plugin or fixer did not help. I checked the PES start code - it's the correct 00 00 01 BD, not sure what's wrong this time.

Here's a transponder dump using TE, and a sample of recorded file (using Media Server) after "my dirty fix" to the channel list.

 

Question - is there a way to

1. recognized the AC3 audio during scan?

2. fix the ts file "real time" when recording?

3. fix the recorded ts files?

 

Thanks very much in advance!

 

Link to comment

The problem is caused by insufficient service information (SI) data, or more specifically, the PMT (Program Map Table, read more about it here). A private PES with stream type 0x06 can contain different things, e.g. AC3 audio or teletext or DVB subtitles... so the PMT must specify what's inside, usually by adding a descriptor, as the following example shows:

 

Zwischenablage01.png

 

In your case there is no indication at all for AC3, so the only way to detect the content is looking for typical byte patterns in the elementary stream, like 0B 77, which may be the start of an AC3 audio frame. This requires an unscrambled stream, of course... eventually it comes down to "good guessing", based on a quite sophisticated analysis. DVBViewer is able to do it when reading a TS file, and also the TransEdit Analyzer in a more limited way. That's why the recorded (unscrambled) stream appears as AC3 in the PID list of the Analyzer, though there is no AC3 indication in the PMT.

 

However, a scanner only reads the SI tables, so it can't know... unfortunately there is no easy way to add the missing information on the fly. Maybe parsing the PMT and changing stream type 0x06 (Private PES) to 0x81 (ATSC stream type for AC3) in certain cases would do the trick, but after that the PMT checksum (CRC32) would be wrong and had to be recalculated - quite a lot of hassle without guarantee for success.

 

 

Link to comment

Thank you for the swift reply, Griga!

 

In this case... maybe it would be too troublesome asking for a fix regarding this particular issue. But could I get your help to check that whether the elementary streams (i.e. those AC3 PIDs) are in good order?

 

On the other hand, I'm still interested in trying to fix the PMT (probably offline) - is there any information / instruction on how to find and edit the stream type identifiers, as well as calculating & editing PMT CRC? Would like to study and maybe write a small tool fixing it.

 

Thanks again for the help.

Link to comment
1 hour ago, allanlee said:

is there any information / instruction on how to find and edit the stream type identifiers, as well as calculating & editing PMT CRC?

 

ISO/IEC 13818-1

 

A PDF with 150 pages containing technical specifications for experts, particularly the transport stream format basics. But it's not free. You need to pay for it, except if you can find it in some dark web corner... if you are not familiar with it, it will take several weeks to dig through it, understand it and find what you need for your purpose.

 

Concerning the stream type 0x06 -> 0x81 patch: Of course an ATSC stream type should not be used in a DVB transport stream. However, since some broadcasters in the DVB sphere simply adopt US streams including the SI without adjusting it, your software may be able to handle it. At least stream type 0x81 unambiguously indicates AC3 in the ATSC sphere.

 

For trying we need something that is already close to doing what we want. Otherwise it will be too costly. The DVBViewer/DMS recorder engine must adjust the PAT and PMT to the recorded content anyway, so that could be the point to intervene. However, I wouldn't like to include such a "very--special-purpose-patch-that-may-work" in the DVBViewer or DMS. There are already too many of them.

 

Maybe it can be done in TSPlayer (see download area -> tools section). Do you already know it? It is able to perform simple cutting and conversion tasks by re-recording TS files with the DVBViewer recording engine.

 

Link to comment
38 minutes ago, Griga said:

However, I wouldn't like to include such a "very--special-purpose-patch-that-may-work" in the DVBViewer or DMS. There are already too many of them.

 

Totally agree, these bad broadcasting habits are not DVBViewer's fault.

 

Initially I was thinking it might be the problem of a few bits somewhere - similar to the wrong AC3 header - that a plugin like PatchAC3StartCode.dll could help.  However it seems that this issue is much more complicated.

 

I tried TSPlayer - it does recognize the buggy AC3 stream but the re-recorded ts file still have the problematic PMT.

 

My final goal is to trim and cut the recordings with frame-accurate "smart encoding" software, e.g. VideoRedo, SmartCutter, etc. and get them playing in Kodi/VLC/iPad etc (currently none of them could recognize the AC3 stream).

 

What in my mind now is to write a small tool like BBCFixer to patch the PMT, not sure whether it's feasible or too costly... 

 

Link to comment
7 minutes ago, allanlee said:

I tried TSPlayer - it does recognize the buggy AC3 stream but the re-recorded ts file still have the problematic PMT.

 

The additional conversion had to be implemented yet. Check your PMs...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...