Log in

View Full Version : MPEG2 extension


dil
6th March 2012, 11:18
Hi all,

How can i identify whether an MPEG2 audio(layer 1, 2 or 3) has multichannel extension or not?

Thanks in advance

hello_hello
6th March 2012, 14:46
Is there such a thing as multichannel mpeg2 audio? I thought it only came in mono or stereo flavors.

MediaInfo (http://www.videohelp.com/tools/MediaInfo) should be able to tell you what you're dealing with.

LoRd_MuldeR
6th March 2012, 16:48
Is there such a thing as multichannel mpeg2 audio? I thought it only came in mono or stereo flavors.

MPEG Multichannel is an extension to the MPEG-1 Layer II audio compression specification, as defined in the MPEG-2 Audio standard (ISO/IEC 13818-3), which allows it provide up to 5.1-channels (surround sound) of audio. To maintain backwards compatibility with the older 2-channel (stereo) audio specification, it uses a channel matrixing scheme, where the additional channels are mixed into the two backwards compatible channels. Extra information in the data stream (ignored by older hardware) contains signals to process extra channels from the matrix.

hello_hello
6th March 2012, 16:54
Well you learn something every day.....
Is it ever used?

SeeMoreDigital
6th March 2012, 18:17
Well you learn something every day.....
Is it ever used?
It's use never really caught on...

As far as compressed multi-channel audio formats go, AC3 took the high ground very quickly. Most probably because hardware decoders were already available.

setarip_old
6th March 2012, 18:28
If I remember correctly, the HD-DVD release of "Rain in the Mountains" contained such an audiostream together with MPEG2 video...

dil
8th March 2012, 05:52
anyone knows how to identify the multichannel extension?

kypec
8th March 2012, 06:44
Did you try MediaInfo yet? If not then why are you bumping your thread with same question? If yes then you should post your results and possibly tell us what's wrong with that approach!

dil
8th March 2012, 08:16
I dint try mediainfo. I dont need a software instead i need a method to identify multichannel extension.
Do i get that info in any of the desciptors or should i parse the audio frame?
I dont want to parse the audio frame (except header) because it takes lots of resource in my hardware. I can parse header if required.

kypec
8th March 2012, 11:21
MediaInfo is an open-source project. If it provides info you're looking for you can look into its source code how does it do it. ;)

modus-ms325c
14th December 2023, 18:37
resurrecting the thread to provide some news

i tried MediaInfo on an actual MPEG Multichannel file, and here's what it gave me

General
Complete name : C:\[REDACTED]\ring-of-gundam[5.1ch].mp2
Format : MPEG Audio
File size : 15.4 MiB
Duration : 5 min 36 s
Overall bit rate mode : Constant
Overall bit rate : 384 kb/s

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 5 min 36 s
Bit rate mode : Constant
Bit rate : 384 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 41.667 FPS (1152 SPF)
Compression mode : Lossy
Stream size : 15.4 MiB (100%)

ReportBy : MediaInfoLib - v23.10
CreatedOn : UTC 2023-12-14 17:35:29

MediaInfo reports this as a 2-channel MPEG Audio Version 1 Layer 2 file

however, this file was encoded from a lossless 5.1ch wav file to a mp2 file using one of the MPEG Multichannel encoders available on this site (http://www.dolby.free.fr/)

j7n
15th December 2023, 02:43
Maybe look at the amount of ancillary data using Mp3GuessEnc. Other software like radio playout systems may write some extra data, but is usually less. The Fraunhofer encoder doesn't format unspent bytes as ancillary, but Lame does.

Multi channel stream : yes
MPEG-2 Audio Multichannel parameters.
Audio bitstream extension : no
LFE : yes
Channels : 3
Multi lingual channels : 0
Channel configuration : 3/2

Ancillary data
Total amount : 5984838 bytes (51.2%)
Bitrate : 196.4 kbps
Min packet : 302 bytes
Max packet : 756 bytes
Padding used : no

Ancillary data
Total amount : 580800 bytes (6.0%)
Bitrate : 19.1 kbps
Min packet : 29 bytes
Max packet : 77 bytes
Max reservoir : 0 bytes
Scalefactor scaling used : yes
Scalefactor selection information used : no
Padding used : no

Maybe this file is encoded by Fraunhofer IIS mp3Surround 5.1 encoder

Where do you encounter multichannel MPEG today or even back in 2012? It seems to have not enough bitrate for decent quality. In case of mp3, it's something akin to parametric stereo coding at only 19 kbit/s.

ivanb
15th December 2023, 03:03
however, this file was encoded from a lossless 5.1ch wav file to a mp2 file
Can you share the file so I would try to improve the analyzer?

modus-ms325c
15th December 2023, 04:33
Maybe look at the amount of ancillary data using Mp3GuessEnc. Other software like radio playout systems may write some extra data, but is usually less. The Fraunhofer encoder doesn't format unspent bytes as ancillary, but Lame does.so i just tested mp3guessenc. a modest exe inside win32 folder was all i needed. here's how that went:
Reading `C:\Users\Amon\Desktop\ffmpeg\bin\ring-of-gundam[5.1ch].mp2'...
First frame found at 0 (0x00000000).

Detected MPEG stream version 1 layer II, details follow.
File size : 16144128 bytes
Audio stream size : 16144128 bytes
Length : 0:05:36.336 (336.336 seconds)
Data rate : 384.0 kbps
Number of frames : 14014
Audio samples per frame : 1152
Audio frequency : 48000 Hz
Encoding mode : stereo
Multi channel stream : yes
MPEG-2 Audio Multichannel parameters.
Audio bitstream extension : no
LFE : yes
Channels : 3
Multi lingual channels : 0
Channel configuration : 3/2
Flags
Error protection : yes (check passed)
Copyrighted : yes
Original : yes
Emphasis : none

Ancillary data
Total amount : 8783152 bytes (54.4%)
Bitrate : 208.9 kbps
Min packet : 442 bytes
Max packet : 722 bytes
Padding used : no

Frame histogram
384 kbps : 14014 (100.0%), size distr: [14014 x1152 B]

0 header errors.


LAME only supports mono and stereo input files, so if we're taking about *other* ancillary data then we're practically being off-topic
Where do you encounter multichannel MPEG today or even back in 2012? It seems to have not enough bitrate for decent quality. In case of mp3, it's something akin to parametric stereo coding at only 19 kbit/s.this is a self-crafted file, actual multichannel MPEG are hard to come by and even then they're all reported as having only stereo (2 channels) anyways
Can you share the file so I would try to improve the analyzer?sure thing, i'll PM you shortly

j7n
15th December 2023, 04:50
Ancillary data is where extensions to the mpeg audio format are saved. If you can't parse it, you can guess by the size. MPEG multichannel has about 192 kbit/s for the stereo downmix, and 192 kbit for the extension.

Sample files: http://j7n.sytes.net/temp/mpegsurround/

I could only get the pub_enc encoder to accept a 16-bit 6ch AIFF input file.

You could look at how mp3guessenc for an example, since it is open source. It detects multichannel in Layer II.

modus-ms325c
15th December 2023, 04:53
Ancillary data is where extensions to the mpeg audio format are saved. If you can't parse it, you can guess by the size. MPEG multichannel has about 192 kbit/s for the stereo downmix, and 192 kbit for the extension.yeah i get it. ancillary data in MPEG Multichannel's case can be ignored for decoders that cannot actually decode said data, though i have yet to see a software decoder (besides what's available on that .fr site) tackle MPEG Multichannel files beyond instinctively focusing on the stereo downmix part.
I could only get the pub_enc encoder to accept a 16-bit 6ch AIFF input file.again, i used a GUI program that deals with encoding multichannel files to MPEG Multichannels ones, and relies on pub_enc to get the job done. i even linked to the site where said program can be downloaded from.
Wav2Mpg. ring a bell?

You could look at how mp3guessenc for an example, since it is open source. It detects multichannel in Layer II.i opened up a executable binary on the command-line terminal in a rush. it's how i was able to find out what that mp2 file looked like.
i tried to compile it myself (using both MSYS2 MINGW32 and MSYS2 MINGW64, respectively) but it threw up an error instead.

SeeMoreDigital
29th December 2023, 16:14
MediaInfo reports this as a 2-channel MPEG Audio Version 1 Layer 2 file

however, this file was encoded from a lossless 5.1ch wav file to a mp2 file using one of the MPEG Multichannel encoders available on this site (http://www.dolby.free.fr/)
So you got a 2-channel MP2 encode instead of a 6-Channel MP2 encode... But why anyone would want to encode multi-channel audio to MP2 instead of Dolby Digital is beyond me!

modus-ms325c
29th December 2023, 16:35
So you got a 2-channel MP2 encode instead of a 6-Channel MP2 encode... But why anyone would want to encode multi-channel audio to MP2 instead of Dolby Digital is beyond me!fun fact, that site also has a Dolby Digital encoder of its own

SeeMoreDigital
29th December 2023, 17:08
fun fact, that site also has a Dolby Digital encoder of its ownHere's another 'fun fact'... Multi-channel MP2 is rubbish and was abandoned not long after DVD players were launched - more than 25 years ago!

Even as a 2-channel format, it's rubbish!

j7n
29th December 2023, 20:25
Decoding with pub_dec from the linked site (hosted on really rare wares) yields a multichannel output with a separate LFE with low sampling rate. There is some crosstalk. And the bandwidth is limited to 14-15k, which is what you'd expect from 192 kbit/s.

This format doesn't seem to have reason for existing. At the time MPEG multichannel was created, AC-3 was already mature and widely supported, and it was a step backwards with the non discrete downmix approach. Why pick it out today, just to pick a fight. I was surprised that the mp3guessenc dev has deciphered the headers.

junh1024
30th December 2023, 04:33
At the time MPEG multichannel was created, AC-3 was already mature and widely supported, and it was a step backwards with the non discrete downmix approach.

A non discrete approach would be more efficient. mp2 surround might be more prevalent today if Dolby didn't offer financial incentives to vote for them.

https://en.wikipedia.org/wiki/MPEG_Multichannel