[vlc-devel] Mpeg2 TS Stream LPCM decoding

Guy Bonneau gbonneau at matrox.com
Fri Jan 18 19:49:53 CET 2008


I have tried to decode a LPCM DVD like compliant audio stream with VLC Media
player inside an Mpeg2 program stream. And VLC Media Player nicely
recognized the audio stream and played it as well as the accompanied Mpeg2
Video stream in the Mpeg2 program stream. 

 

I used LiveMedia testMPEG1or2ProgramToTransportStream.cpp testing
application to create a transport stream wrapping the Mpeg2 DVD like program
stream. Using an Mpeg2 Stream Analyser from Elecard I was able to find that
LiveMedia created the properly Mpeg2 Transport stream around the program
stream.

 

I have tried to playback the created Mpeg2 Transport Stream with VLC and
though the video played nicely the audio wasn't decoded. I Opened the
Message Dialog Box of VLC and found that the LPCM Audio Codec wasn't
instantied this time.

 

I downloaded VLC source code and began investigating the problem. I checked
through the file "ts.c" trying to find what going on. I quickly found the
code where the private type 0x06 of the packetized elementary stream is
checked to find what data is carried. My understanding of the code is that
LPCM audio is detected inside a private stream when the Mpeg-2 descriptor is
matched with "BSSD" (Line 2961 of ts.c).

 

Now looking at the Website:

 

http://www.smpte-ra.org/mpegreg/mpegreg.html

http://www.smpte-ra.org/mpegreg/bssd.html

 

I found that BSSD is associated to the mapping of audio data as specified in
SMPTE Standard SMPTE 302M-1998 for Television which is "Mapping of AES3 Data
into MPEG-2 Transport Stream".  This is a LPCM audio stream formatted
according to AES3.

 

I have found that LiveMedia doesn't add the descriptor when wrapping the
transport stream. Then for sure the audio will never be recognized.

 

Now will adding the BSSD descriptor solve the problem? Well I did not try it
but I expect it will properly decode the audio stream. 

 

However when doing that I will create an improperly association between the
audio data and the BSSD descriptor and thus have an illegal Mpeg2 Transport
Stream that won't be recognized by other decoder. Why ? Because the BSSD
description create an association with an audio AES3 formatted LPCM P-ES
stream. Not a DVD-Video audio LPCM formatted P-ES. They do not share the
same formatting. The LPCM audio codec "lpcm.c" used by VLC is clearly a
formatted DVD-Video audio LPCM codec. Not an AES3 LPCM formatted audio
codec.

 

I suspect that the descriptor to be used to create the properly association
is: "DVDF". Please check:

 

http://www.smpte-ra.org/mpegreg/dvdf.html

 

Unfortunately I do not have any stream sample of a DVDF Mpeg-2 transports
stream to double check my finding. But I believe this is an issue that will
prevent the decoding of a complient DVDF Mpeg-2 transport stream.

 

Anyone having a DVDF compliant stream could confirm my finding please ?

 

Guy Bonneau

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080118/5eb3176c/attachment.html>


More information about the vlc-devel mailing list