Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th August 2019, 15:52   #1  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
DolbyE Decoding Guide

One of the reason why I'm opening up this topic is that I wanna describe how to decode one of the most common audio format used in mezzanine files by TV Stations: DolbyE.
Although there are still no free open source DolbyE encoders yet Link, there are DolbyE decoders, however they are not very documented.

In my first attempt to index an .MXF masterfile that had a DolbyE stream, I tried to use FFAudioSource, LWLibavAudioSource and DGIndex but they all failed.
The reason why they failed is the non-standard configuration of having a DolbyE with 5.1+2.0 within the same track.
Let me explain this.
In general, whenever you have an XDCAM Masterfile, you could have the following configuration:

CH.1-2 DolbyE Dubbed Language 5.1
CH.3-4 DolbyE Original Language 5.1
CH.5-6 Stereo Downmix Dubbed Language 2.0
CH.7-8 Stereo Downmix Original Language 2.0

In this scenario, indexing the DolbyE streams (CH.1-2 and CH.3-4) works perfectly fine along with indexing the normal stereo tracks in CH.5-6 and CH.7-8, however, this configuration is hardly used.
Why? Well, that's because the playout ports generally only look for CH.1-2 and CH.3-4 as they are gonna be the ones that are gonna be re-encoded on the fly and then aired... So... what about the downmix information in the other channels? Well, by DolbyE specifications is actually possible to include 8 channels within a single stream, namely a 5.1 + 2.0 configuration which is gonna be:

- Front Left
- Front Right
- Center
- LFE
- Surround Left
- Surround Right
- Stereo Downmix Left
- Stereo Downmix Right

By doing so, broadcast engineers are generally happy as they can have the following audio configuration:

- CH.1-2 DolbyE Dubbed 5.1+2.0
- CH.3-4 DolbyE Original 5.1+2.0
- CH.5-6 PCM Stereo Downmix Dubbed 2.0
- CH.7-8 PCM Stereo Downmix Original 2.0

So, the streams in CH.1-2 and CH.3-4 are gonna be encoded on the fly and aired correctly, while CH.5-6 and CH.7-8 are just gonna be discarded and they are only gonna be kept for archival purposes in the mezzanine file.

Everything works, so we're good, right? No!
Here comes the first problem: although this way of having a 5.1+2.0 stream works for professional broadcast decoders along with the proprietary Dolby decoders, it really confuses open source indexers like FFAudioSource and LWLibavAudioSource as they think that it's a 7.1 stream and they try to decode it that way, thus getting a horrible, just horrible track full of undetermined noise. Using ffmpeg itself without Avisynth has the same result 'cause ffmpeg thinks that it's a 7.1 pcm_s24 stream and fails to decode it properly, however MediaInfo can detect that it's a DolbyE 5.1 + 2.0 stream, so... what's going on here? Something "fishy" is happening.
Well, in order to properly decode a DolbyE 5.1 + 2.0 stream, you need to first remux in a .u8 file with ffmpeg and then decode and encode it with ffmpeg, 'cause this way it's gonna be identified correctly by ffmpeg:

Code:
ffmpeg.exe  -i %1  -acodec copy  -f u8 -y out.u8
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y out1.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y out2.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y out3.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y out4.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y out5.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y out6.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y out7.wav
ffmpeg.exe  -i out.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y out8.wav

pause

That's pretty much it.
I hope it helps you folks trying to decode and re-encode DolbyE 5.1 + 2.0 streams.


As a side note, DolbyE can also be carried as 2 fake mono pairs instead of 1 fake stereo pair as above, therefore you would need to merge the two tracks before using the .u8 trick, like so:


Quote:
ffmpeg.exe -i "Input1.wav" -i "Input2.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav "DolbyE.wav"

ffmpeg.exe -i "DolbyE.wav" -map 0:0 -acodec copy -f u8 -y "out.u8"
and then it's business as usual and you can use the code above to decode the u8.


And of course, if you also want to re-encode to PCM 5.1 and PCM 2.0 you can easily do that like this:

Code:
 #Extract DolbyE track 1
    ffmpeg  -i "DolbyE.mov"  -map 0:1 -acodec copy -f u8 -y "stream1.u8"
    #Extract each channel of DolbyE 5.1
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y "FL.wav"
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y "FR.wav"
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y "CC.wav"
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y "LFE.wav"
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y "SL.wav"
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y "SR.wav"
    #Extract each channel of DolbyE 2.0
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y $jobOutputFolder:Left.wav
    ffmpeg  -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.0 -y $jobOutputFolder:Right.wav
    #Audio 5.1
    ffmpeg -i "FL.wav" -i "FR.wav" -i "CC.wav" -i "LFE.wav" -i "SL.wav" -i "SR.wav" -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-LFE|4.0-BL|5.0-BR[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav -y "Track1_51.wav"
    #Audio 2.0
    ffmpeg -i "Left.wav" -i "Right.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav -y "Track2_20.wav"

If you want to try it yourself, you can try it with those sample files:

Sample 1: DolbyE.mov

Sample 2: DolbyE.mxf

Cheers,
Frank.

Last edited by FranceBB; 20th July 2023 at 12:13.
FranceBB is offline   Reply With Quote
Old 10th August 2019, 08:55   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
Many thanks !
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 12th August 2019, 10:42   #3  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Try adding this before -i:

-guess_layout_max 0

which will cause ffmpeg to stop guessing channel order. I think it simply treats your source as 7.1, which is typical for ffmpeg and 8 channels input (which in case of DolbyE is of course causing massive issues).
You may want after mapping tell it how many ac it actually has, eg -ac 2. No idea if this is needed for DolbyE or not.
If you have not seen it already:

https://trac.ffmpeg.org/wiki/AudioChannelManipulation

very useful.

If DolbyE track is detected properly it should work. If not you may want to map it to be stereo and then decode. All can be done in 1 command I think.

Last edited by kolak; 12th August 2019 at 11:10.
kolak is offline   Reply With Quote
Old 10th March 2023, 11:06   #4  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Hi everyone,
I'm bringing this topic back to attention 'cause we've been working on a patch to fix a decoding issue for normal DolbyE streams and one to introduce DolbyED2 Atmos decoding over the last 7 months, however the FFMpeg community has been ignoring us: https://trac.ffmpeg.org/ticket/9864

This patch by Nicolas Gaullier ​https://patchwork.ffmpeg.org/project...ier@cji.paris/ should really be merged upstream 'cause it's really really important. That bug affects the 20 bits section of standard DolbyE 5.1 + 2.0 files which raises an error “Read past end of channel XX” while decoding them with FFMpeg. That is a bug 'cause it's not just a "simple warning" but rather a real error as it really truncates the audio, hence throwing away few ms. When I decode the very same file with the official Dolby DP600, however, there are no warnings and the decoding completes correctly. By applying Nicolas' patch, there's gonna be a simple warning, but data will be preserved and we're gonna avoid the few ms of mute audio. This is really important as we use DolbyE 5.1 + 2.0 in production on a daily basis, therefore it should really be merged sooner rather than later.

The last updated version is here: https://patchwork.ffmpeg.org/project...ier@cji.paris/
in which the required documentation about the decoder and the demuxer has been added.
In particular, the Dolby E audio decoder is a raw decoder without any further processing, which means the output sample rate is different from the 48KHz input sample rate. A dolby E stream is always carried in a s337m muxer, as a raw file or muxed in any format that is able to transport an AES3 or an equivalent uncompressed audio stream (stereo, 48KHz, 16/20/24 bits). Currently, only wav and raw file formats are supported. Other formats require two passes of processing: a first one to extract the s337m stream and another to decode it. In case of AES3, or if the format itself supports it, the non-PCM mode may be signaled, but in a more general manner, a stream has to be probed to be handled as dolby E rather than pcm. By default, stream probing is enabled which forbids pass-through as no s337m muxer is implemented yet. In order to pass-through a dolby E stream, @code{--non_pcm_mode copy} must be specified (see input muxer options).


The other patch we're trying to get merged upstream is the following:

https://trac.ffmpeg.org/attachment/t...-support.patch

Such a patch allows DolbyED2 5.1.4 Atmos to be decoded.
Unlike DolbyE which is carried as 1 AES (i.e 1 fake stereo pair - so 1 .wav - or 2 fake mono pairs - so 2 .wav), DolbyED2 is carried as 2 AES (i.e 2 fake stereo pairs) so either 2 separate fake stereo .wav files that need to be merged together to be decoded or 1 fake quad .wav file. If we use the same logic as DolbyE, however, without the patch the decoder doesn't recognize the file as a valid file and therefore doesn't decode it.


We contacted the FFMpeg community 7 months ago at ffmpeg-devel@ffmpeg.org and heard nothing back from them.
We also tried to contact the current maintainer, foobaz86@gmail.com, via email on 29/09/2022 and heard nothing back from him.
We tried to contact the FFMpeg community again at ffmpeg-devel@ffmpeg.org on 14/10/2022 with the following email:

Quote:
To ffmpeg-devel@ffmpeg.org
On 14/10/2022 09:30 AM

Hi everyone,
this is Frank, one of the FFAStrans maintainers.
May I bring you to attention once again the following ticket in the bug tracker https://trac.ffmpeg.org/ticket/9864 and the patch proposed by Nicolas here https://patchwork.ffmpeg.org/project...ier@cji.paris/ as it should really be merged upstream 'cause it's really important for proper DolbyE decoding. The bug he worked on to fix affects the 20 bits section of standard DolbyE 5.1 + 2.0 files which raises an error “Read past end of channel XX” while decoding them with FFMpeg. That is indeed a bug 'cause it's not just a "simple warning" but rather a real error as it really truncates the audio, hence throwing away few ms. When I decode the very same file with the official Dolby DP600, however, there are no warnings, and the decoding completes correctly. By applying Nicola's patch, there's gonna be a simple warning, but data will be preserved and we're gonna avoid the few ms of mute audio. This is really important as we (where "we" stands for the company I'm working for) use DolbyE 5.1 + 2.0 in production on a daily basis through our supply chain, therefore it should really be merged sooner rather than later 'cause as things stand, decoding is affected and in a bad way.

I'd like to ask you all guys once again if any of you could kindly review the patch and eventually merge it so that at least we're gonna have proper DolbyE decoding support in FFMpeg and we can actively use it for distribution.

The other thing that I'd like you to take a look at is indeed the other patch which allows DolbyED2 decoding, in the same thread.

Given that we're receiving an increasingly higher number of live feeds from the Champions League carrying DolbyED2 5.1.4, it would be great to at least be able to decode the beds, regardless of the metadata, and Nicolas' patch allows us to do it.

I'm sure there are plenty of other broadcasters across the globe that have the same needs, so the sooner it's merged, the better.

Besides, one of the point of contributing to open source projects is having the changes merged upstream as there no point in us compiling and maintaining our own version of FFMpeg without having everyone benefiting from the changes.

So, in a nutshell, I know it's something big to ask, but please review those patches.

p.s Richard D, if you're reading, it's me, FranceBB from Doom9, one of the Avisynth guys.


I really look forward to hearing back from you guys.


Thank you in advance,

Frank

and I've been ignored again.
I tried again to contact the ffmpeg-devel@ffmpeg.org on 16/02/2023:

Quote:
To ffmpeg-devel@ffmpeg.org
On 16/02/2023 02:42 PM

Hi there, everyone, it's me again.
It's been 6 months already since we submitted the patches that we asked you to merge and that you can find here https://trac.ffmpeg.org/attachment/t...-support.patch and here https://patchwork.ffmpeg.org/project...ier@cji.paris/ and at the following ticket: https://trac.ffmpeg.org/ticket/9864
Unfortunately, I haven't heard anything back from you over the last 6 months.
Given the very strict time constraints and given that we needed proper DolbyE and ED2 decoding in production, we're currently using our fork with the patches applied in production, however we would really like to avoid doing this and have them merged into master.
Keep in mind that I come from the Avisynth community and over there we manage everything through GitHub pull requests, so going through this process via email for FFMpeg is a bit "new" for me, which is why after opening the pull request and sending the email, I left the thing sit there for the last 6 months.
Anyway, after talking to a member of your community called Balling, he said that I should ping you and write to this email every week until the patch is applied 'cause "this is how it works" and I didn't know this, so from now on this is what I'm gonna do.
Long story short, the patches Nicolas Gaullier worked on do essentially two things: the first is fixing a bug that affects the 20 bits section of standard DolbyE 5.1 + 2.0 files which would otherwise raise an error “Read past end of channel XX” while decoding them with FFMpeg. Without the patch the decoded stream (and therefore the final file) would be shorter/truncated, which of course is a big problem. The second patch, instead, introduces DolbyED2 decoding support.

It's been 6 months. We've been ignored so far.
Please give us some feedback as I'd like to avoid following Balling's suggestion of sending an email as a reminder every week.

Kind regards,
Frank


Needless to say, I've been ignored once again.

Days passed and today, 10/03/2023 I wrote again to the FFMpeg community:


Quote:
To ffmpeg-devel@ffmpeg.org
On 10/03/2023 09:27AM

Morning, everyone,
I'm Frank from Sky, again, and I'm joined today by my other fellow Sky colleagues, by Nicolas from CJI Paris, by Benjamin from Centreville TV and by Steinar from NRK. We're all professional working in different broadcasting companies all over Europe.
The reason why I'm contacting you is about the DolbyE patch again to let you know that the very last bit has been completed, namely the documentation.
So much so that Nicolas added the required documentation about the decoder and the Demuxer.
The patch can now be considered fully completed by all means and you can find the last updated version here: https://patchwork.ffmpeg.org/project...ier@cji.paris/
We also kept track of the whole process in the following ticket: https://trac.ffmpeg.org/ticket/9864 over the last 7 months.
Please may I ask you, once again, as one of the FFAStrans maintainers, to review the patch and eventually merge the pull request to the mainline ffmpeg master?
We haven't got any feedback over the last 7 months, so please let us know as this is very important for us going forward.
I'm sure you'll understand the amount of effort and dedication we all spent in getting this done, in particular Nicolas for providing the official implementation and Steinar and the others for integrating it within FFAStrans.
We would love to have it merged upstream in your master so that we can stop compiling our own fork every single time.
The code is there, the comments are there, the documentation is there, now everything is ready, please give us some kind of feedback.

I'm confident you'll find some time to review it and merge it after 7 months.

I look forward to hearing back from you.

Kind regards,
Frank



Let's see if they'll keep ignoring us...
Needless to say such a thing would never happen in the Avisynth community where everyone is always available and kind and actually bothers to reply.
I wish there were people like Ferenc, DTL, qyot, jpsdr etc in the ffmpeg community too...
FranceBB is offline   Reply With Quote
Old 11th March 2023, 00:18   #5  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Are you aware that none of your mails ever even arrived on the mailing list? Should've probably checked that, its easy to ignore mails that noone sees.

Additionally, the patchset you are referring to in your latest "mail" (dolby e in s337m in wav, or something) was just re-submitted yesterday. Before that, it was on the mailing list three weeks ago and was actually being reviewed by Tomas Härdin. Nothing about that indicates in any way that the patches are being "ignored". They got reviewed, and only a day ago, a revised version was posted, presumably with fixes from said review. So... everything is working as designed so far?
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 11th March 2023 at 00:30.
nevcairiel is offline   Reply With Quote
Old 11th March 2023, 10:28   #6  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by nevcairiel View Post
the patchset you are referring to in your latest "mail" (dolby e in s337m in wav, or something) was just re-submitted yesterday.
Yes, an updated version was resubmitted yesterday (version 7/7) only because we added the documentation but nothing else was changed.

Quote:
Originally Posted by nevcairiel View Post
Before that, it was on the mailing list three weeks ago and was actually being reviewed by Tomas Härdin.
Why didn't he reply to the ticket, though?
Last time around, the argument was that it was the responsibility of the "current" maintainer so we contacted the current maintainer directly to his email, namely foobaz86@gmail.com but heard nothing back.

Quote:
Originally Posted by nevcairiel View Post
only a day ago, a revised version was posted, presumably with fixes from said review.
Nope, Nicolas did it on his own. We only got someone to reply once at the very beginning months ago, then silence. All the new updated version were posted with no feedback whatsoever and were made independently by Nicolas as we were trying to see whether it would finally be accepted or not.
I even tried to ask for an explanation on LinkedIn in the official ffmpeg page and got ignored, while on the bug tracker the only one who is still replying is Balling who unfortunately is not a maintainer and cannot merge it anyway.

Quote:
Originally Posted by nevcairiel View Post
So... everything is working as designed so far?
I still find this whole email thing much harder to follow and work with than the simple GitHub pull requests we have here on Doom9 for Avisynth.

I'm gonna add one last thing which I didn't post before but for the sake of transparency I will.
In one of my attempts while sending an email, this was what one of the Devs commented in their own chat:

Quote:
There are many codecs and container formats that are annoying to support: "industrial" formats like MXF have their own Internet of documentation. Previously it was enthusiasts fixing their own problem (usually with transcoding or playing back an anime rip). Nowadays it's mostly people sending work-related stuff from their corporate mails. I've had enough of them.
Not cool, man. Not cool... And it's a bit personal too.
The reason is that back in the days those people were kids, I was young myself when I started watching anime in 2006. Then I eventually joined crunchyroll and then viewster and then Sky in 2016. The same happened for other people who were enthusiast first and then got a professional position across different broadcasting companies and streaming platforms. They should be proud that open source software is currently being used by companies across the world and certainly from the support I constantly get from the Avisynth community I feel like they are, but apparently it's not quite the same for ffmpeg...
FranceBB is offline   Reply With Quote
Old 11th March 2023, 10:40   #7  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by nevcairiel View Post
Are you aware that none of your mails ever even arrived on the mailing list? Should've probably checked that, its easy to ignore mails that noone sees.
I'm much more concerned about this, though.
Why? I mean how?
I'm subscribed to the mailing list so I should be allowed to send.
Does it mean that everyone I put in cc has to be registered too for the email to go through?
FranceBB is offline   Reply With Quote
Old 11th March 2023, 18:43   #8  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Quote:
Originally Posted by FranceBB View Post
Why didn't he reply to the ticket, though?
Last time around, the argument was that it was the responsibility of the "current" maintainer so we contacted the current maintainer directly to his email, namely foobaz86@gmail.com but heard nothing back.

---
Nope, Nicolas did it on his own. We only got someone to reply once at the very beginning months ago, then silence. All the new updated version were posted with no feedback whatsoever and were made independently by Nicolas as we were trying to see whether it would finally be accepted or not.
Trac is not a primary part of our development/review process. That all happens on the ML.

Refer to the ML archive from February (which you can also use to see that I could not find any mails from you):
http://ffmpeg.org/pipermail/ffmpeg-d...ry/thread.html

There is numerous back and forth on the patchset between Nicolas and Tomas Härdin, reviewing the patchset.


I'm not sure what you are stating here? "No feedback whatsoever"?
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 11th March 2023 at 18:46.
nevcairiel is offline   Reply With Quote
Old 11th March 2023, 19:33   #9  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by nevcairiel View Post
I'm not sure what you are stating here? "No feedback whatsoever"?
I was supposed to be in cc, but neither I nor my colleagues got anything either and it's not in spam (I checked).
Uhmmm something is broken, it looks like something is filtering our mails in and out when we use our office 365 emails...

I think I got the culprit and they should be ok now, I'll try once again to ping on Monday and see whether this time it goes through.
Thanks for helping me out, by the way.
No one else ever bothered before.
If I knew I would have asked you 7 months ago instead of wasting all this time.
Fingers crossed.


p.s this is why I said that we didn't get a reply: http://ffmpeg.org/pipermail/ffmpeg-d...ch/307293.html

To quote Nicolas:

Quote:
The only modification since this initial patch is a cosmetic line split
to prevent an overly long line and the "Please wrap lines" warning.

I did not get any message, I don't know what to do to get a review ?
If I missed something obvious, tell me.
The fact is the official maintainer disappeared, so it does not make this easy.
The darkness of the official proprietary implementation is certainly an "issue",
but the technology behind the dolby_e codec seems very similar to all other audio codecs,
so it does not seem that critical for simple maintenance.

Last edited by FranceBB; 11th March 2023 at 21:26.
FranceBB is offline   Reply With Quote
Old 2nd April 2023, 16:06   #10  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 541
> our office 365 emails

Microsoft 365. They renamed it.
Balling is offline   Reply With Quote
Old 3rd April 2023, 08:19   #11  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by Balling View Post

Microsoft 365. They renamed it.
Right! They even changed the logo.
Now there's this thing here:



which I don't particularly like, but anyway...
FranceBB is offline   Reply With Quote
Old 4th April 2023, 23:31   #12  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
Now how original is that?
That moeboid came before:
https://en.wikipedia.org/wiki/File:L...12-2014%29.svg
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 22nd June 2023, 18:20   #13  |  Link
bbc
Registered User
 
Join Date: Jun 2023
Posts: 12
I have a feed recording from BT sport 4K, please guide me how to convert Dolby E

Quote:
General
ID : 1 (0x1)
Complete name : E:\Video\1.ts
Format : MPEG-TS
File size : 2.06 GiB
Duration : 4 min 40 s
Overall bit rate mode : Variable
Overall bit rate : 63.1 Mb/s
Frame rate : 50.000 FPS

Video
ID : 512 (0x200)
Menu ID : 1 (0x1)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Format Range@L5.1@High
HDR format : SMPTE ST 2086, HDR10 compatible
Codec ID : 36
Duration : 4 min 40 s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primar : BT.2020
Mastering display luminance : min: 0.0000 cd/m2, max: 1200 cd/m2

Audio #1
ID : 4112 (0x1010)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 4 min 40 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
Delay relative to video : -20 ms
Stream size : 12.8 MiB (1%)
Language : English

Audio #2
ID : 4128 (0x1020)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 4 min 40 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
Delay relative to video : -20 ms
Stream size : 12.8 MiB (1%)

Audio #3
ID : 4144 (0x1030)-1
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 43.2 MiB (2%)
Title : BT T23 M1

Audio #4
ID : 4144 (0x1030)-2
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 16.9 MiB (1%)
Title : Rrogram.T23 BT M1

Audio #5
ID : 4160 (0x1040)-1
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 43.2 MiB (2%)
Title : BT T23 M2

Audio #6
ID : 4160 (0x1040)-2
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 16.9 MiB (1%)
Title : Program 2

Audio #7
ID : 4176 (0x1050)
Menu ID : 1 (0x1)
Format : PCM
Codec ID : 6

Audio #8
ID : 4192 (0x1060)-1
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : C X X X X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 1

Audio #9
ID : 4192 (0x1060)-2
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X C X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 2

Audio #10
ID : 4192 (0x1060)-3
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X C X X X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 3

Audio #11
ID : 4192 (0x1060)-4
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X X C X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 4

Audio #12
ID : 4192 (0x1060)-5
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X C X X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 5

Audio #13
ID : 4192 (0x1060)-6
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X X X C X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 6

Audio #14
ID : 4192 (0x1060)-7
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X C X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 7

Audio #15
ID : 4192 (0x1060)-8
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X X X X C
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -20 ms
Stream size : 7.40 MiB (0%)
Title : Program 8

Last edited by bbc; 22nd June 2023 at 18:26. Reason: add link
bbc is offline   Reply With Quote
Old 23rd June 2023, 12:44   #14  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
I saw that game. Inter tried its best to contain City but they just couldn't and in the end they went 1 down and never managed to recover.
Anyway, in Italy we aired that game in BT2020 HLG at 1000 nits 50p, I didn't know that the BT Sport master was actually PQ BT2020 1200 nits.

Well, moving on to the DolbyE part, looks like we're dealing with:

CH.1-2 MP2 Stereo English Full Mix
CH.3-4 MP2 Stereo International Full Mix
CH.5-6 DolbyE 5.1 + 2.0 English
CH.7-8 DolbyE 5.1 + 2.0 International


however, DolbyE was NOT muxed as a standard SMPTE ST 337 but rather as SMPTE ST 302.
This makes things a bit more difficult 'cause we need to first remux as SMPTE ST337 and then work with the stream.



Step 1:
Decode the first MP2 stereo audio track and save it as PCM lossless stereo 48000Hz .wav with Avisynth + Virtualdub and save it as "stream1.wav":


Quote:
video=LWLibavVideoSource("A:\Ingest\MEDIA\temp\1.ts")
audio=LWLibavAudioSource("A:\Ingest\MEDIA\temp\1.ts", stream_index=1)
AudioDub(video, audio)

Decode the second MP2 stereo audio track and save it as PCM lossless stereo 48000Hz .wav with Avisynth + Virtualdub and save it as "stream2.wav":

Quote:
video=LWLibavVideoSource("A:\Ingest\MEDIA\temp\1.ts")
audio=LWLibavAudioSource("A:\Ingest\MEDIA\temp\1.ts", stream_index=2)
AudioDub(video, audio)

Index the first DolbyE 5.1 + 2.0 SMPTE ST 302 track and remux it as DolbyE 5.1 + 2.0 SMPTE ST 337.wav (it's carried as a fake PCM 48000Hz 32bit stereo track) and save it as "stream3.wav":


Quote:
video=LWLibavVideoSource("A:\Ingest\MEDIA\temp\1.ts")
audio=LWLibavAudioSource("A:\Ingest\MEDIA\temp\1.ts", stream_index=3)
AudioDub(video, audio)

Index the second DolbyE 5.1 + 2.0 SMPTE ST 302 track and remux it as DolbyE 5.1 + 2.0 SMPTE ST 337.wav (it's carried as a fake PCM 48000Hz 32bit stereo track) and save it as "stream4.wav":


Quote:
video=LWLibavVideoSource("A:\Ingest\MEDIA\temp\1.ts")
audio=LWLibavAudioSource("A:\Ingest\MEDIA\temp\1.ts", stream_index=4)
AudioDub(video, audio)


This will therefore give us the following files:

CH.1-2 Stereo PCM 48'000Hz 16bit
Stream1.wav

Quote:
General
Complete name : A:\Ingest\MEDIA\temp\stream1.wav
Format : Wave
Format settings : PcmWaveformat
File size : 51.4 MiB
Duration : 4 min 40 s
Overall bit rate mode : Constant
Overall bit rate : 1 536 kb/s

Audio
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 536 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Bit depth : 16 bits
Stream size : 51.4 MiB (100%)

CH.3-4 Stereo PCM 48'000Hz 16bit
Stream2.wav

Quote:
General
Complete name : A:\Ingest\MEDIA\temp\stream2.wav
Format : Wave
Format settings : PcmWaveformat
File size : 51.4 MiB
Duration : 4 min 40 s
Overall bit rate mode : Constant
Overall bit rate : 1 536 kb/s

Audio
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 536 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Bit depth : 16 bits
Stream size : 51.4 MiB (100%)

CH.5-6 DolbyE 5.1 + 2.0 48000Hz 20bit
Stream3.wav

Quote:
General
Complete name : A:\Ingest\MEDIA\temp\stream3.wav
Format : Wave
Format settings : PcmWaveformat
File size : 103 MiB
Duration : 4 min 40 s
Overall bit rate mode : Constant
Overall bit rate : 3 072 kb/s

Audio #1
ID : 1
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 337
Codec ID : 1
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Stream size : 43.2 MiB (42%)
Title : BT T23 M1

Audio #2
ID : 2
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 337
Codec ID : 1
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Stream size : 16.9 MiB (16%)
Title : Rrogram.T23 BT M1

CH.7-8 DolbyE 5.1 + 2.0 48000Hz 20bit
Stream4.wav


Quote:
General
Complete name : A:\Ingest\MEDIA\temp\stream4.wav
Format : Wave
Format settings : PcmWaveformat
File size : 103 MiB
Duration : 4 min 40 s
Overall bit rate mode : Constant
Overall bit rate : 3 072 kb/s

Audio #1
ID : 1
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 337
Codec ID : 1
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Stream size : 43.2 MiB (42%)
Title : BT T23 M2

Audio #2
ID : 2
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 337
Codec ID : 1
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Stream size : 16.9 MiB (16%)
Title : Program 2


Step 2:
Get rid of the zero padding in stream3.wav and stream4.wav.
Given that the DolbyE decoder inside FFMpeg is very picky about the input, it will NOT like zero filled streams and, when we remuxed from SMPTE ST 302 to SMPTE ST 337 with VirtualDub after going through LWLibavAudioSource() as indexer, we zero filled a 24bit stream into 32bit, so we gotta get rid of those zeroes.

To do that, we remux from 32bit wav to 24bit wav like so:

Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3.wav" -acodec pcm_s24le -y "A:\MEDIA\temp\stream3_v2.wav"

ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4.wav" -acodec pcm_s24le -y "A:\MEDIA\temp\stream4_v2.wav"


Step 3:
create the u8 that will be used to feed the decoder from the newly created 24bit stream3_v2.wav and stream4_v2.wav


Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.wav" -acodec copy -f u8 -y "A:\MEDIA\temp\stream3_v2.u8"

ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.wav" -acodec copy -f u8 -y "A:\MEDIA\temp\stream4_v2.u8"

Step 4:
Decode DolbyE to get the relative 16 channels (5.1 + 2.0 downmix of stream 3 and 5.1 + 2.0 downmix of stream 4):


Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y "A:\MEDIA\temp\out1.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y "A:\MEDIA\temp\out2.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y "A:\MEDIA\temp\out3.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y "A:\MEDIA\temp\out4.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y "A:\MEDIA\temp\out5.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y "A:\MEDIA\temp\out6.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y "A:\MEDIA\temp\out7.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y "A:\MEDIA\temp\out8.wav"




ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y "A:\MEDIA\temp\out9.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y "A:\MEDIA\temp\out10.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y "A:\MEDIA\temp\out11.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y "A:\MEDIA\temp\out12.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y "A:\MEDIA\temp\out13.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y "A:\MEDIA\temp\out14.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y "A:\MEDIA\temp\out15.wav"
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream4_v2.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y "A:\MEDIA\temp\out16.wav"

Step 5:
Put the 16 PCM decoded discrete separate channels together to create two 5.1 tracks and two stereo tracks



Quote:
ffmpeg.exe -i "A:\MEDIA\temp\out1.wav" -i "A:\MEDIA\temp\out2.wav" -i "A:\MEDIA\temp\out3.wav" -i "A:\MEDIA\temp\out4.wav" -i "A:\MEDIA\temp\out5.wav" -i "A:\MEDIA\temp\out6.wav" -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-LFE|4.0-BL|5.0-BR[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -y "A:\MEDIA\temp\stream3_51_PCM.wav"


ffmpeg.exe -i "A:\MEDIA\temp\out9.wav" -i "A:\MEDIA\temp\out10.wav" -i "A:\MEDIA\temp\out11.wav" -i "A:\MEDIA\temp\out12.wav" -i "A:\MEDIA\temp\out13.wav" -i "A:\MEDIA\temp\out14.wav" -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-LFE|4.0-BL|5.0-BR[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -y "A:\MEDIA\temp\stream4_51_PCM.wav"


ffmpeg.exe -i "A:\MEDIA\temp\out7.wav" -i "A:\MEDIA\temp\out8.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -y "A:\MEDIA\temp\stream3_20_PCM.wav"



ffmpeg.exe -i "A:\MEDIA\temp\out15.wav" -i "A:\MEDIA\temp\out16.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -y "A:\MEDIA\temp\stream4_20_PCM.wav"



Step 6:
Remux everything to .mkv with MKVToolnix so that we're gonna have the following file:


Video: UHD H.265 50 Mbit/s High Profile Level 5.1 4:2:2 10bit BT2020 HDR PQ 1200 nit

Audio Track 1: PCM Stereo 48000Hz 16bit English
Audio Track 2: PCM Stereo 48000Hz 16bit International
Audio Track 3: PCM 5.1 48000Hz 24bit English
Audio Track 4: PCM Stereo downmix 48000Hz 24bit English
Audio Track 5: PCM 5.1 48000Hz 24bit International
Audio Track 6: PCM Stereo downmix 48000Hz 24bit International




Quote:
General
Unique ID : 30475736573489579965539438304253785370 (0x16ED69D2400FD1C8B4323D25E81D351A)
Complete name : A:\Ingest\MEDIA\temp\Man_City_vs_Inter_UHD_Remux.mkv
Format : Matroska
Format version : Version 4
File size : 2.39 GiB
Duration : 4 min 40 s
Overall bit rate : 73.0 Mb/s
Frame rate : 50.000 FPS
Encoded date : 2023-06-23 11:33:56 UTC
Writing application : mkvmerge v73.0.0 ('25 or 6 to 4') 64-bit
Writing library : libebml v1.4.4 + libmatroska v1.7.1

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Format Range@L5.1@High
HDR format : SMPTE ST 2086, HDR10 compatible
Codec ID : V_MPEGH/ISO/HEVC
Duration : 4 min 40 s
Bit rate : 51.5 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 50.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.124
Stream size : 1.68 GiB (71%)
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : BT.2020
Mastering display luminance : min: 0.0000 cd/m2, max: 1200 cd/m2

Audio #1
ID : 2
Format : PCM
Format settings : Little / Signed
Codec ID : A_PCM/INT/LIT
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 536 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 25.002 FPS (1920 SPF)
Bit depth : 16 bits
Stream size : 51.4 MiB (2%)
Language : English
Default : Yes
Forced : No

Audio #2
ID : 3
Format : PCM
Format settings : Little / Signed
Codec ID : A_PCM/INT/LIT
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 1 536 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 25.002 FPS (1920 SPF)
Bit depth : 16 bits
Stream size : 51.4 MiB (2%)
Language : zxx
Default : Yes
Forced : No

Audio #3
ID : 4
Format : PCM
Format settings : Little / Signed
Codec ID : A_PCM/INT/LIT
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 6 912 kb/s
Channel(s) : 6 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 231 MiB (9%)
Language : English
Default : Yes
Forced : No

Audio #4
ID : 5
Format : PCM
Format settings : Little / Signed
Codec ID : A_PCM/INT/LIT
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 2 304 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 77.1 MiB (3%)
Language : English
Default : Yes
Forced : No

Audio #5
ID : 6
Format : PCM
Format settings : Little / Signed
Codec ID : A_PCM/INT/LIT
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 6 912 kb/s
Channel(s) : 6 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 231 MiB (9%)
Language : zxx
Default : Yes
Forced : No

Audio #6
ID : 7
Format : PCM
Format settings : Little / Signed
Codec ID : A_PCM/INT/LIT
Duration : 4 min 40 s
Bit rate mode : Constant
Bit rate : 2 304 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 77.1 MiB (3%)
Language : zxx
Default : Yes
Forced : No




Here are the individual PCM.wav decoded audio tracks, namely stream1.wav stream2.wav stream3_51.wav stream3_20.wav stream4_51.wav stream4_20.wav:

https://we.tl/t-9LFKrwYIlo

(link valid for 7 days)



Here's is out1, out2.wav, out3.wav, out4.wav, out5.wav, out6.wav, out7.wav, out8.wav, out9.wav, out10.wav, out11.wav, out12.wav, out13.wav, out14.wav, out15.wav, out16.wav in case you wanted them as mono channels straight from the DolbyE decoding:

https://we.tl/t-FTJoy8iI1q

(link valid for 7 days)


Here's the remuxed mkv with video and all the PCM audio:

https://www.transfernow.net/dl/2023062347isW8vn

(link valid for 7 days)




Open source rocks

Last edited by FranceBB; 23rd June 2023 at 12:49.
FranceBB is offline   Reply With Quote
Old 23rd June 2023, 18:21   #15  |  Link
bbc
Registered User
 
Join Date: Jun 2023
Posts: 12
thanks for the guide , i will try it tomorrow . I have a 4K feed version from UEFA . it also has multiple Dolby E audio tracks. Can you write a tutorial, if possible. In addition, I want to convert to EAC3 (DD+) because PCM audio can't be decoded on some TV devices.

Quote:
General
ID : 160 (0xA0)
Complete name : E:\mc_int_hdr.ts
Format : MPEG-TS
File size : 3.41 GiB
Duration : 8 min 14 s
Overall bit rate mode : Variable
Overall bit rate : 59.2 Mb/s
Frame rate : 50.000 FPS

Video
ID : 512 (0x200)
Menu ID : 1 (0x1)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Format Range@L5.1@Main
Codec ID : 36
Duration : 8 min 14 s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:2 (Type 2)
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : HLG
Matrix coefficients : BT.2020 non-constant

Audio #1
ID : 4112 (0x1010)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Format settings : Dual mono
Codec ID : 3
Duration : 8 min 14 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
Delay relative to video : 14 ms
Stream size : 22.6 MiB (1%)
Language : English
Language, more info : Clean effects

Audio #2
ID : 4128 (0x1020)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Format settings : Dual mono
Codec ID : 3
Duration : 8 min 14 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
Delay relative to video : 14 ms
Stream size : 22.6 MiB (1%)
Language : English
Language, more info : Clean effects

Audio #3
ID : 4144 (0x1030)-1
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 76.1 MiB (2%)
Language : English
Language, more info : Clean effects

Audio #4
ID : 4144 (0x1030)-2
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 29.8 MiB (1%)
Language : English
Language, more info : Clean effects

Audio #5
ID : 4160 (0x1040)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Format settings : Dual mono
Codec ID : 3
Duration : 8 min 14 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
Delay relative to video : 14 ms
Stream size : 22.6 MiB (1%)
Language : English
Language, more info : Clean effects

Audio #6
ID : 4176 (0x1050)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Format settings : Dual mono
Codec ID : 3
Duration : 8 min 14 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
Delay relative to video : 14 ms
Stream size : 22.6 MiB (1%)
Language : English
Language, more info : Clean effects

Audio #7
ID : 4192 (0x1060)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Format settings : Dual mono
Codec ID : 3
Duration : 8 min 14 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
Delay relative to video : 14 ms
Stream size : 22.6 MiB (1%)
Language : English
Language, more info : Clean effects

Audio #8
ID : 4208 (0x1070)
Menu ID : 1 (0x1)
Format : PCM
Codec ID : 6
Language : English
Language, more info : Clean effects

Audio #9
ID : 4224 (0x1080)-1
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : C X X X X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 1
Language : English
Language, more info : Clean effects

Audio #10
ID : 4224 (0x1080)-2
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X C X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 2
Language : English
Language, more info : Clean effects

Audio #11
ID : 4224 (0x1080)-3
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X C X X X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 3
Language : English
Language, more info : Clean effects

Audio #12
ID : 4224 (0x1080)-4
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X X C X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 4
Language : English
Language, more info : Clean effects

Audio #13
ID : 4224 (0x1080)-5
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X C X X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 5
Language : English
Language, more info : Clean effects

Audio #14
ID : 4224 (0x1080)-6
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X X X C X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 6
Language : English
Language, more info : Clean effects

Audio #15
ID : 4224 (0x1080)-7
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X C X X X X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 7
Language : English
Language, more info : Clean effects

Audio #16
ID : 4224 (0x1080)-8
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 8 min 14 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 1 channel
Channel layout : X X X X X X X C
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : 20 ms
Stream size : 13.0 MiB (0%)
Title : Program 8
Language : English
Language, more info : Clean effects
bbc is offline   Reply With Quote
Old 24th June 2023, 16:13   #16  |  Link
bbc
Registered User
 
Join Date: Jun 2023
Posts: 12


I get this error when using VirtualDub
bbc is offline   Reply With Quote
Old 24th June 2023, 18:35   #17  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Use VirtualDub2:
https://www.videohelp.com/software/VirtualDub2
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 24th June 2023, 18:48   #18  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Steps 1 to 3 are a workaround to obtain a DolbyE stream than can be decoded by ffmpeg, until a better support of DolbyE muxed in containers.

If you want recode the DolbyE stream to eac3 the steps 4 and 5 can be replaced by:

ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -filter_complex "asplit [s][d]; [s] pan=5.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c4|c5=c5 [ss]; [d] pan=stereo|c0=c6|c1=c7 [dd]" -map "[ss]" -ar 48000 -acodec eac3 -ab 640k 1_51.eac3 -map "[dd]" -ar 48000 -acodec eac3 -ab 256k 1_20.eac3

The same for stream4_v2.u8, of course you can change the bitrates.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 25th June 2023, 06:35   #19  |  Link
bbc
Registered User
 
Join Date: Jun 2023
Posts: 12
Quote:
Originally Posted by tebasuna51 View Post
Steps 1 to 3 are a workaround to obtain a DolbyE stream than can be decoded by ffmpeg, until a better support of DolbyE muxed in containers.

If you want recode the DolbyE stream to eac3 the steps 4 and 5 can be replaced by:

ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3_v2.u8" -filter_complex "asplit [s][d]; [s] pan=5.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c4|c5=c5 [ss]; [d] pan=stereo|c0=c6|c1=c7 [dd]" -map "[ss]" -ar 48000 -acodec eac3 -ab 640k 1_51.eac3 -map "[dd]" -ar 48000 -acodec eac3 -ab 256k 1_20.eac3

The same for stream4_v2.u8, of course you can change the bitrates.

I get this error : Filesize 5191465062 invalid for wav, output file will be broken

bbc is offline   Reply With Quote
Old 25th June 2023, 10:12   #20  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by bbc View Post
I get this error : Filesize 5191465062 invalid for wav, output file will be broken
Maybe in step 2?, after:

ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\stream3.wav" -acodec pcm_s24le -y "A:\MEDIA\temp\stream3_v2.wav"

Of course wav files greater 4 GB can be broken.

I haven't big files to test it, and I don't know if output can be used in step 3, but continue with it ignoring the warning.

If the output .u8 is recognized by ffmpeg like DolbyE can work fine. Something like:
Quote:
ffmpeg.exe -hide_banner -i "C:\tmp\1_3.u8" -filter_complex "asplit [s][d]; [s] pan=5.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c4|c5=c5 [ss]; [d] pan=stereo|c0=c6|c1=c7 [dd]" -map "[ss]" -ar 48000 -acodec eac3 -ab 640k 1_3_51.eac3 -map "[dd]" -ar 48000 -acodec eac3 -ab 256k 1_3_20.eac3
[dolby_e @ 000001685a6724c0] Stream has 2 programs (configuration 0), channels will be output in native order.

Input #0, s337m, from 'C:\tmp\1_3.u8':
Stream #0:0: Audio: dolby_e, 44800 Hz, 7.1, fltp
Stream mapping:
Stream #0:0 (dolby_e) -> asplit:default
pan:default -> Stream #0:0 (eac3)
pan:default -> Stream #1:0 (eac3)
[dolby_e @ 000001685a6b71c0] Stream has 2 programs (configuration 0), channels will be output in native order.
[Parsed_pan_1 @ 000001685a8f7280] Pure channel mapping detected: 0 1 2 3 4 5
[Parsed_pan_2 @ 000001685a9008c0] Pure channel mapping detected: 6 7

Output #0, eac3, to '1_3_51.eac3':
Stream #0:0: Audio: eac3, 48000 Hz, 5.1, fltp, 640 kb/s
Output #1, eac3, to '1_3_20.eac3':
Stream #1:0: Audio: eac3, 48000 Hz, stereo, fltp, 256 kb/s

size= 21920kB time=00:04:40.53 bitrate= 640.1kbits/s speed=78.1x...
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 25th June 2023 at 10:43. Reason: add info
tebasuna51 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.