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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd July 2024, 19:18   #41  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,384
Oh wow, that's a very long feed... I mean, you're gambling a lot when you leave the recording go for such a long time, it's pretty insane and risky.
On EVS Ingest Scheduler (xtaccess hardware encoder), we generally record at blocks of 1h to be safe (max 2h) to avoid corruption and we definitely never exceed the 4h mark.
Recording an 8h feed in one single part is a pretty bold move.
Anyway, welcome to Doom9!

By the way, you should update your Mediainfo installation 'cause Jerome has now introduced all the proprietary DolbyE metadata detection, including the dialnorm etc.
In an official Dolby decoder, the dialnorm is interpreted to output the audio to the level described there. In other words, the audio inside could be at any level (let's say -18 LUFS), but if the dialnorm says -23 LUFS the decoder would output it to -23. This is the same kind of logic that is used in AC3, in fact AC3 and DolbyE share the same kind of metadata.
Anyway, I always ignore the dialnorm value and decode the audio as-is, then I decide myself whether I wanna do something with it or not.
This is the mediainfo of the source using Mediainfo 24.06 which includes the DolbyE metadata detection patch:

Quote:
General
ID : 0 (0x0)
Complete name : A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts
Format : MPEG-TS
File size : 75.6 GiB
Duration : 7 h 43 min
Overall bit rate mode : Variable
Overall bit rate : 23.4 Mb/s
Frame rate : 25.000 FPS

Video
ID : 512 (0x200)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings : CABAC / 3 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 3 frames
Format settings, Slice count : 2 slices per frame
Codec ID : 27
Duration : 7 h 43 min
Bit rate mode : Constant
Bit rate : 19.1 Mb/s
Nominal bit rate : 20.1 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Scan type, store method : Interleaved fields
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.369
Stream size : 61.8 GiB (82%)
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio #1
ID : 4112 (0x1010)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 7 h 43 min
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 : -424 ms
Stream size : 1.24 GiB (2%)
Conformance errors : 1 / 1
MPEG-Audio : Yes
General compliance : Bitstream synchronisation is lost (time 07:42:55.976, offset 0x12E4BCC1F0)
MPEG-PS : Yes
General compliance : Bitstream synchronisation is lost (time 07:42:53.064+07:42:53.400+07:42:53.472+07:42:53.544+
07:42:53.640+07:42:53.808+07:42:53.904+07:42:53.976+
07:42:54.072+07:42:54.456+07:42:57.168+07:42:57.240+
07:42:57.312+07:42:57.408+07:42:55.976+07:42:57.504+
07:42:57.552+07:42:57.672+07:42:57.720+07:42:57.816+
07:43:06.264+07:43:06.336+07:43:06.432+07:43:06.504+
07:43:06.600+07:43:06.672+07:43:06.744+07:43:06.840+
07:43:06.912+07:43:07.248+07:43:07.344+07:43:07.416+
..., offset
0x12E46557F4+0x12E4682BC8+0x12E46AF714+0x12E46D8
B48+0x12E470F08C+0x12E476DB7A+0x12E47A762A+0x12E
47D7884+0x12E4812254+0x12E48408C6+0x12E4B2A94E+0
x12E4B58AA0+0x12E4B8E984+0x12E4BC1734+0x12E4BDAA
36+0x12E4BF73A4+0x12E4C14FC4+0x12E4C55D6E+0x12E4
C711A8+0x12E4CA7DC4+0x12E531E334+0x12E5348F48+0x
12E5381DE8+0x12E53AFD2C+0x12E53E3628+0x12E540AA1
A+0x12E5434C80+0x12E546BF58+0x12E5490EE0+0x12E54
BFFDA+0x12E54F9981+0x12E5528074+...)

Audio #2
ID : 4128 (0x1020)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 7 h 43 min
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 : -424 ms
Stream size : 1.24 GiB (2%)
Conformance errors : 1 / 1
MPEG-Audio : Yes
General compliance : Bitstream synchronisation is lost (time
07:43:06.816+07:43:01.783, offset
0x12E545DF49+0x12E559FC26)
MPEG-PS : Yes
General compliance : Bitstream synchronisation is lost (time
07:42:53.064+07:42:53.400+07:42:53.472+07:42:53.544+
07:42:53.640+07:42:53.712+07:42:53.808+07:42:53.904+
07:42:53.976+07:42:54.048+07:42:54.456+07:42:54.528+
07:42:57.168+07:42:57.216+07:42:57.312+07:42:57.384+
07:42:57.480+07:42:57.552+07:42:57.648+07:42:57.720+
07:42:57.816+07:42:57.888+07:43:06.264+07:43:06.336+
07:43:06.408+07:43:06.504+07:43:06.576+07:43:06.648+
07:43:06.672+07:43:06.744+07:43:06.816+07:43:06.912+..., offset
0x12E4653F74+0x12E4683B34+0x12E46AD608+0x12E46DC
E1C+0x12E4711870+0x12E4739178+0x12E476FD94+0x12E
47AD5A0+0x12E47D4984+0x12E4803620+0x12E48460E4+0
x12E4868E48+0x12E4B2B64A+0x12E4B4B084+0x12E4B861
A6+0x12E4BB3214+0x12E4BEC16C+0x12E4C15B2C+0x12E
4C4BBE0+0x12E4C7A3C8+0x12E4CAAC84+0x12E4CC4387+
0x12E531F00C+0x12E534B864+0x12E5372F41+0x12E53B1
0D8+0x12E53D8F82+0x12E53F9A60+0x12E540C1E4+0x12E
54449EC+0x12E546C8C0+0x12E54986D0+...)

Audio #3
ID : 4144 (0x1030)-1
Menu ID : 1 (0x1)
Format : Dolby E
Format settings : Dolby Surround / Little
Muxing mode : SMPTE ST 302 / SMPTE ST 337
Codec ID : 6
Duration : 7 h 42 min
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 : -400 ms
Stream size : 4.17 GiB (6%)
Title : CTV OB9 3
AC-3 metadata : Yes
Service kind : Complete Main
Channel layout : L R C LFE Ls Rs
Dialog Normalization : -23 dB
RF (compr) profile : Film Standard
Line (dynrng) profile : Film Standard
cmixlev : -3.0 dB
surmixlev : -3 dB
dmixmod : Lo/Ro
ltrtcmixlev : -3.0 dB
ltrtsurmixlev : -6.0 dB
lorocmixlev : -3.0 dB
lorosurmixlev : -6.0 dB
hpfon : Yes
bwlpfon : Yes
lfelpfon : Yes
sur90on : No
suratton : No
rfpremphon : No
GuardBand_Before : 688
GuardBand_After : 1271
Conformance errors : 1
MPEG-PS : Yes
General compliance : Bitstream synchronisation is lost (time
07:42:53.360+07:42:53.440+07:42:53.600+07:42:53.680+
07:42:53.920+07:42:54.000+07:42:54.440+07:42:54.680+
07:42:54.920+07:42:56.208+07:42:56.280+07:42:56.440+
07:42:56.520+07:42:56.720+07:42:56.800+07:42:57.200+
07:42:57.280+07:42:57.440+07:42:57.520+07:42:57.760+
07:43:00.720+07:43:00.920+07:43:01.200+07:43:01.440+
07:43:02.520+07:43:02.800+07:43:03.080+07:43:03.600+
07:43:03.880+07:43:05.240+07:43:05.480+07:43:06.280+
..., offset
0x12E4674EF0+0x12E46A6576+0x12E4704BD1+0x12E4731
3BA+0x12E47BC44C+0x12E47EE246+0x12E483F562+0x12E
48C6071+0x12E494197B+0x12E49A8412+0x12E49D17AB+0
x12E4A237DC+0x12E4A50FF7+0x12E4AC080B+0x12E4AF33
E1+0x12E4B4CB32+0x12E4B7E4CC+0x12E4BDE81B+0x12E
4C12F74+0x12E4C9865C+0x12E4CE98A6+0x12E4D53E2E+0
x12E4DDB262+0x12E4E54302+0x12E4E83B04+0x12E4F181
26+0x12E4FABCAE+0x12E50170B6+0x12E509DB83+0x12E5
1CDB06+0x12E524EF3A+0x12E5339FF6+...)

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 : 7 h 42 min
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 : -400 ms
Stream size : 1.63 GiB (2%)
Title : Program 2
AC-3 metadata : Yes
Service kind : Complete Main
Channel layout : L R
Dialog Normalization : -27 dB
RF (compr) profile : Film Standard
Line (dynrng) profile : Film Standard
cmixlev : -3.0 dB
surmixlev : -3 dB
dmixmod : Lt/Rt
ltrtcmixlev : -3.0 dB
ltrtsurmixlev : -3.0 dB
lorocmixlev : -3.0 dB
lorosurmixlev : -3.0 dB
hpfon : Yes
bwlpfon : Yes
lfelpfon : No
sur90on : No
suratton : No
rfpremphon : No
GuardBand_Before : 688
GuardBand_After : 1271

Menu
ID : 2048 (0x800)
Menu ID : 1 (0x1)
Format : AVC / MPEG Audio / MPEG Audio / Dolby E
List : 512 (0x200) (AVC) / 4112 (0x1010) (MPEG Audio) / 4128 (0x1020) (MPEG Audio) / 4144 (0x1030) (Dolby E)

Now, as we can see, we have a pretty standard file with:

Video:
FULL HD H.264 20 Mbit/s 4:2:0 25i Limited TV Range 8bit planar BT709 SDR

Audio:
CH.1-2 MP2 384 kbit/s 2ch 48000Hz English Full Mix
CH.3-4 MP2 384 kbit/s 2ch 48000Hz Mute
CH.5-6 DolbyE 5.1 + 2.0 (1300 kbit/s + 505 kbit/s)

I started indexing with LWLibavVideoSource() and LWLibavAudioSource() and I've got 781375 frames, namely 08:40:55.00

This is when I indexed the video and CH.1-2:

Quote:
video=LWLibavVideoSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts")
audio=LWLibavAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts", stream_index=1)
AudioDub(video, audio)
while this is CH.3-4:

Quote:
video=LWLibavVideoSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts")
audio=LWLibavAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts", stream_index=2)
AudioDub(video, audio)

The audio tracks seem to be having some problem, though.
This is expected given how lengthy the recording was.
When I try to index CH.1-2, I get 07:26:48.28 before it crashes, while when I try to index CH.3-4 I get 07:26:48.68 before it crashes. A part of those also seems to be corrupted.

Anyway, I decoded and re-encoded them both to PCM 24 bit 48000Hz muxed as RF64 wav:

Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts_CH12.avs" -c:a pcm_s24le -ar 48000 -rf64 always -f wav "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH12.wav"

ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts_CH34.avs" -c:a pcm_s24le -ar 48000 -rf64 always -f wav "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH34.wav"

pause
This resulted in the following two stereo files:

Quote:
General
Complete name : A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH12.wav
Format : Wave
Format profile : RF64
Format settings : WaveFormatExtensible
File size : 7.19 GiB
Duration : 7 h 26 min
Overall bit rate mode : Constant
Overall bit rate : 2 304 kb/s
Writing application : Lavf60.16.100

Audio
Format : PCM
Format settings : Little / Signed
Codec ID : 00000001-0000-0010-8000-00AA00389B71
Duration : 7 h 26 min
Bit rate mode : Constant
Bit rate : 2 304 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Stream size : 7.19 GiB (100%)
Quote:
General
Complete name : A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH34.wav
Format : Wave
Format profile : RF64
Format settings : WaveFormatExtensible
File size : 7.19 GiB
Duration : 7 h 26 min
Overall bit rate mode : Constant
Overall bit rate : 2 304 kb/s
Writing application : Lavf60.16.100

Audio
Format : PCM
Format settings : Little / Signed
Codec ID : 00000001-0000-0010-8000-00AA00389B71
Duration : 7 h 26 min
Bit rate mode : Constant
Bit rate : 2 304 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Stream size : 7.19 GiB (100%)

At this point I had to deal with CH.5-6, which is the DolbyE 5.1 + 2.0 track.
I noticed that you tried to decode it with the u8 procedure yourself, however keep in mind that we're talking about a .ts container, not about an .mxf container.
This means that the DolbyE track wasn't muxed as a standard SMPTE ST 337 but rather as SMPTE ST 302. This means that we have to index the DolbyE 5.1 + 2.0 SMPTE ST 302 track and remux it as DolbyE 5.1 + 2.0 SMPTE ST 337.wav before we can decode it 'cause FFMpeg only expects SMPTE ST337.
To do this, we need to index CH.5-6 (i.e stream 3) and save it, however, since it's corrupted/truncated, when I do this:

Quote:
video=LWLibavVideoSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts")
audio=LWLibavAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts", stream_index=3)
AudioDub(video, audio)
and save with:

Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts.avs" -c:a pcm_s24le -ar 48000 -f wav "A:\MEDIA\temp\stream1_CH56.wav"

pause

it gets stuck without outputting anything.
It just... stalls.

I tried to use

Quote:
BestAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts", track=3)
but then FFMpeg complained with the following error:

Quote:
S302 non PCM mode with data type 28 not supported
This is because BestAudioSource() doesn't seem to be supporting s302m streams.

As to FFAudioSource(), I tried with

Quote:
FFAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts", track=3)
but unfortunately it also failed with:

Quote:
FFAudioSource: Audio track contains no audio frames
Error opening input: Unknown error occurred
Remuxing it with FFMpeg initially didn't work either as this:


Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts" -map 0:3 -vn -c:a copy -f wav -y "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_Stream1_CH56.wav"

pause
failed with:

Quote:
Could not find codec parameters for stream 3 (Audio: s302m (BSSD / 0x44535342), stereo, s32 (20 bit), 2304 kb/s)
So I had to change to

Quote:
ffmpeg.exe -hide_banner -non_pcm_mode copy -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts" -map 0:3 -c:a pcm_s24le -f s24le -y "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56.wav"

pause
and although it started copying the stream, FFMpeg started outputting a lot of errors complaining about invalid headers in the s302m frames, PES packet size mismatch and packet corruption. This all points to the fact that there have been issues while receiving the stream on such a lengthy recording and unfortunately this COULD result in CRC errors with DolbyE.

Last edited by FranceBB; 3rd July 2024 at 19:25.
FranceBB is offline   Reply With Quote
Old 3rd July 2024, 19:19   #42  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,384
Anyway, we got closer to the end result as we've now got a 7h 20m DolbyE 5.1 + 2.0 file muxed in wav as SMPTE ST337.

Quote:
General
Complete name : A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56.wav
Format : SMPTE ST 337
File size : 7.09 GiB
Duration : 7 h 20 min
Overall bit rate mode : Constant
Overall bit rate : 2 304 kb/s

Audio #1
ID : 1
Format : Dolby E
Format settings : Dolby Surround / Little
Duration : 7 h 20 min
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 : 3.97 GiB (56%)
Title : CTV OB9 3
AC-3 metadata : Yes
Service kind : Complete Main
Channel layout : L R C LFE Ls Rs
Dialog Normalization : -23 dB
RF (compr) profile : Film Standard
Line (dynrng) profile : Film Standard
cmixlev : -3.0 dB
surmixlev : -3 dB
dmixmod : Lo/Ro
ltrtcmixlev : -3.0 dB
ltrtsurmixlev : -6.0 dB
lorocmixlev : -3.0 dB
lorosurmixlev : -6.0 dB
hpfon : Yes
bwlpfon : Yes
lfelpfon : Yes
sur90on : No
suratton : No
rfpremphon : No
GuardBand_Before : 688
GuardBand_After : 1271

Audio #2
ID : 2
Format : Dolby E
Format settings : Little
Duration : 7 h 20 min
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 : 1.55 GiB (22%)
Title : Program 2
AC-3 metadata : Yes
Service kind : Complete Main
Channel layout : L R
Dialog Normalization : -27 dB
RF (compr) profile : Film Standard
Line (dynrng) profile : Film Standard
cmixlev : -3.0 dB
surmixlev : -3 dB
dmixmod : Lt/Rt
ltrtcmixlev : -3.0 dB
ltrtsurmixlev : -3.0 dB
lorocmixlev : -3.0 dB
lorosurmixlev : -3.0 dB
hpfon : Yes
bwlpfon : Yes
lfelpfon : No
sur90on : No
suratton : No
rfpremphon : No
GuardBand_Before : 688
GuardBand_After : 1271

Now this is what we can decode 'cause it's muxed as SMPTE ST 337.
Even just playing it with MPV works:




Now, before we go on with this, I know what you meant when you said that you couldn't get past 6h 30m.
This is because if we apply the u8 trick on that file like this:

Quote:
ffmpeg.exe -hide_banner -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56.wav" -c:a copy -f u8 -y "A:\MEDIA\temp\stream1.u8"
we end up with the following issue:

Dolby E data size 1037087 in SMPTE 337M is not implemented.

so, effectively, it stops after 06:30:31.48.



What we can however do is use Avisynth to decode it and the GetChannels() function to get the 5.1 first and the + 2.0 then.

In other words:

Quote:
video=LWLibavVideoSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts")
audio=LWLibavAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56.wav")
AudioDub(video, audio)

GetChannels(1,2,3,4,5,6)

ResampleAudio(48000)

By looking at this with VideoTek() we can see that the channels are correctly presented as FL FR CC LFE LS RS:





I thought "nice, so at this point it's just a matter of saving the decoded output", but no.

Unfortunately LWLibavAudioSource() also suffers from the same limitation affecting FFMpeg 'cause they're both based on libav.
In other words, after 6h 30m, everything is silent.

As for WAVSource(), it just fails to decode it, while BestAudioSource() decodes it completely silently, so does DirectShowSource() using the LAV Decoder.

PotPlayer does play it, though, so at this point I wonder whether it can go past the 6h 30m mark.
When I seek forward on MPV, it does allow me to decode past the 6h 30m mark, here I am at 6h 50m and I can guarantee you that there's sound:




I'll try to do something more about this tomorrow, but right now I'm uploading the following files:

- Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56.wav

This is the full DolbyE 5.1 + 2.0 stream extracted from the .ts file.

- Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH12.wav

This is the decoded MP2 Stereo of CH.1-2.

- Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH34.wav

This is the decoded MP2 Stereo of CH.3-4.

- Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH56_51_Truncated.wav

This is the decoded DolbyE 5.1 of CH.5-6 but truncated to 6h 30m when the decoder chokes and gives up.
In theory it should be possible to trim it and then decode it in two parts, but I have to think about a way to do this.

Link: https://gofile.io/d/b8JYyA

Last edited by FranceBB; 4th July 2024 at 08:13.
FranceBB is offline   Reply With Quote
Old 4th July 2024, 09:18   #43  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,384
I'm a bit at a loss, 'cause I thought: "well, I could simply trim this".
You see, one of the properties of DolbyE is that - as long as the guardband (i.e the frame loc / line positioning) is in a valid position - any application can trim it without compromising its integrity, regardless on whether it understands DolbyE or not. This is because DolbyE is carried in chunks and basically the guardband value tells you the position of the chunks in the stream and whether you can trim them or not. Different framerate and resolution files need different guardband and so on. For instance, FULL HD 25i files generally desire a guardband at around line 22, while UHD 50p ones desire one at around line 42.



In the case of this recording, the guardband is at line 33, which is not ideal, but still in a valid position, so we can trim.
What I've done then is split the file in two and essentially create a second part starting from 6h 30m 31s like so:

Quote:
ffmpeg.exe -hide_banner -non_pcm_mode copy -ss 06:30:31 -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts" -map 0:3 -c:a pcm_s24le -f s24le -y "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56_part2.wav"

which led to the following 50 min 45 seconds DolbyE file containing the last part of the concert:

Quote:
General
Complete name : A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56_part2.wav
Format : SMPTE ST 337
File size : 837 MiB
Duration : 50 min 45 s
Overall bit rate mode : Constant
Overall bit rate : 2 304 kb/s

Audio #1
ID : 1
Format : Dolby E
Format settings : Dolby Surround / Little
Duration : 50 min 45 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 : 469 MiB (56%)
Title : CTV OB9 3
AC-3 metadata : Yes
Service kind : Complete Main
Channel layout : L R C LFE Ls Rs
Dialog Normalization : -23 dB
RF (compr) profile : Film Standard
Line (dynrng) profile : Film Standard
cmixlev : -3.0 dB
surmixlev : -3 dB
dmixmod : Lo/Ro
ltrtcmixlev : -3.0 dB
ltrtsurmixlev : -6.0 dB
lorocmixlev : -3.0 dB
lorosurmixlev : -6.0 dB
hpfon : Yes
bwlpfon : Yes
lfelpfon : Yes
sur90on : No
suratton : No
rfpremphon : No
GuardBand_Before : 688
GuardBand_After : 1271

Audio #2
ID : 2
Format : Dolby E
Format settings : Little
Duration : 50 min 45 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 : 183 MiB (22%)
Title : Program 2
AC-3 metadata : Yes
Service kind : Complete Main
Channel layout : L R
Dialog Normalization : -27 dB
RF (compr) profile : Film Standard
Line (dynrng) profile : Film Standard
cmixlev : -3.0 dB
surmixlev : -3 dB
dmixmod : Lt/Rt
ltrtcmixlev : -3.0 dB
ltrtsurmixlev : -3.0 dB
lorocmixlev : -3.0 dB
lorosurmixlev : -3.0 dB
hpfon : Yes
bwlpfon : Yes
lfelpfon : No
sur90on : No
suratton : No
rfpremphon : No
GuardBand_Before : 688
GuardBand_After : 1271

At this point I tried to decode it like so:

Quote:
bogus_video=BlankClip(length=900000, fps=25)
audio=LWLibavAudioSource("A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56_part2.wav")
AudioDub(bogus_video, audio)

GetChannels(1,2,3,4,5,6)
When I saw it working I said "job done"



but no, the decoder chokes quickly after and crashes after as little as 1 minute. At this point I'm at a bit of a loss.
I mean, with MPV I can play it all the way through, so there MUST be a way to do this, but I'm still thinking...


Still, armed with a lot of good will, I decided to use the official Dolby DP600 to decode the stream and see where it would get me.
I therefore remuxed the audio in a proper RF64 wav container like so:

Quote:
ffmpeg.exe -hide_banner -non_pcm_mode copy -i "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E).ts" -map 0:3 -c:a pcm_s24le -rf64 always -f wav -y "A:\MEDIA\temp\Isle of Wight Festival (21-6-24) (1080i) (Feed) (Dolby-E)_stream1_CH56_DolbyE.wav"

pause
And then I submitted the file to the DP600 which detected the following info:

Program Configuration: 5.1 + 2
Frame Rate: 25 fps
Bit Depth: 20-bit
Guard Band: line 33
Program 1 Description: CTV OB9 3
Program 2 Description: Program 2


Unfortunately, however, when I started the decoding process it immediately failed with:

Audio Extract Started
Audio Extract Ended
Dolby E Decoding Started
Error: Unable to read Dolby-E Metadata



So... looks like not even an official Dolby product can properly decode this file (although it could be the fact that I remuxed it with FFMpeg as I can't feed .ts directly to the DP600)...


Anyway, I've opened a ticket in the FFMpeg bug tracker https://trac.ffmpeg.org/ticket/11084
Hopefully someone will take a look at that.

Last edited by FranceBB; 4th July 2024 at 11:00.
FranceBB is offline   Reply With Quote
Old 4th July 2024, 12:09   #44  |  Link
richardpl
Guest
 
Posts: n/a
Sure, right on it!
  Reply With Quote
Old 4th July 2024, 14:33   #45  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,384
Well... well... well... I've got very good news for you, @r3sistant, I got it. I managed to decode it.




So... first thing first: what happened was that you had a signal issue while you were recording the file. This led to a CRC error in the DolbyE bitstream.
Now, when DolbyE is recorded, it's generally played back via hardware playback ports that create a stream that is transmitted via SDI, then it goes into a Dolby hardware decoder which decodes it as PCM discrete mono and last but not least the signal goes into an hardware encoder that creates the final AC3 before everything is multiplexed and beamed for consumers.
When you have an issue with the bitstream, you have a CRC error, namely an "absence of coding". Given that the decoding is done via hardware, this simply leads to a moment in time in which there's silence (i.e mute) in the decoded PCM and therefore silence (i.e mute) in the re-encoded AC3 that it's sent to consumers. When the bitstream comes back and the DolbyE coding is restored at the next chunk, the decoder goes on decoding it and everything is back to normal. This "silence" would be just as long as the CRC error is, ranging from a few frames up to several seconds. Now, here we're not playing anything, we're decoding it via software using the decoder inside FFMpeg, which means that we're doing a software decoding instead. This in turn means that once we get to the point in which there's a CRC error, the decoder simply crashes. What I said in the previous post, however, still holds true, namely that - as long as the guardband / frame loc / line position is within a legal value - we can trim a DolbyE bitstream wherever we want without having to care about screwing it up and this is exactly what I've done as the file had a line positioning of 33 which is valid (albeit not recommended for FULL HD 25i).
I found the affected parts in which you had a CRC error in the recording, trimmed them out until the next chunk was there, and then I fed it to the decoder, then, I appended all trimmed parts together and I've got the final file.


Out of 7h and 20 minutes, the final file was 07:12:09.88, which means that overall 480 seconds (i.e 8 minutes) were lost due to CRC errors.

Here's the final link: https://gofile.io/d/yCQf7L

- Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH12.wav
- Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH34.wav
- Isle of Wight Festival (21-6-24) (1080i) (Feed)_CH56.wav

There you can find CH.1-2 2.0, CH.3-4 2.0, CH.5-6 5.1, all nicely decoded as PCM 24 bit little endian 48000Hz muxed as RF64 wav.

Another day, another mystery solved, another DolbyE file decoded.

Open source rocks.
FranceBB is offline   Reply With Quote
Old 15th August 2024, 21:14   #46  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,384
I updated the guide in the main page to include the commands for FFMpeg 7.x given that -map_channel was deprecated in favor of the pan audio filter.
It will still be valid for FFMpeg 6.x and older, though, but it won't work with FFMpeg 7.x and newer as it requires the use of the pan audio filter.


For FFMpeg 6.x or older:

Quote:
#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 "Left.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.0 -y "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"
For FFMpeg 7.x or newer:

Quote:
#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 -af "pan=mono|c0=c0" -y "FL.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c1" -y "FR.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c2" -y "CC.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c3" -y "LFE.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c4" -y "SL.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c5" -y "SR.wav"
#Extract each channel of DolbyE 2.0
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c6" -y "Left.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c7" -y "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"
FranceBB is offline   Reply With Quote
Old 4th September 2024, 04:39   #47  |  Link
bbc
Registered User
 
Join Date: Jun 2023
Posts: 13
bbc is offline   Reply With Quote
Old 10th October 2025, 17:03   #48  |  Link
leoenc
Registered User
 
Join Date: Mar 2007
Posts: 202
@FranceBB,

This doesn't seem to work with ffmpeg 8.x.
I've tried these steps:

Code:
ffmpeg -i "XDCAM50_DolbyE_51_20.mxf" -map 0:1 -acodec pcm_u8 -f u8 -y "stream1.u8"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -af "pan=mono|c0=c0" -y "FL.wav"
but getting the error: Invalid data found when processing input.

Tried with both your MXF and MOV sample files.

Note that when using -acodec copy as you wrote, it produces the error: "u8 muxer supports only codec pcm_u8 for type audio", therefore I used acodec pcm_u8.

Last edited by leoenc; 12th October 2025 at 18:39.
leoenc is offline   Reply With Quote
Old 29th January 2026, 17:01   #49  |  Link
emcodem
Registered User
 
Join Date: Dec 2020
Posts: 22
Quote:
Originally Posted by leoenc View Post
@FranceBB,

This doesn't seem to work with ffmpeg 8.x.
Yeah frankie should never have used pcm_u8, it worked until now but it was always wrong (there is no 8 bit stuff whatsoever involved).

Quote:
Originally Posted by leoenc View Post
therefore I used acodec pcm_u8.
What this does is to actively downconvert the input audio to 8 bit which destroys the encoded dolby bitstream thats hiding in the original PCM audio.

Correct is to use -c:a pcm_s16le -f s16le if your dolbyE stream is 16bit and -c:a pcm_s24le -f s24le if your dolbyE stream is 20 bit.
The following batch should decode dolbyE from any input file in one go and write the decoded channels into a multichannel mkv output.
After saving this to a .bat file on windows, just drag/drop a file on the batch. Make sure ffmpeg is in the PATH (or write the path to ffmpeg in the batch)

Quote:
REM This batch attempts all possible Channel/Track configurations that are possible to carry DolbyE up to 8 Tracks
REM If the DBE decoder was able to do something, you will find a mkv file with the decoded channels in a single track next to the source file.
REM Note that we have to try everything with 16 and 24bit PCM Codec because the ffmpeg DBE decoder cannot decode 16bit dolbyE in 24bit PCM

REM DolbyE is in Mono PCM Tracks, e.g. XDCAMHD, XAVC...
ffmpeg -i %1 -filter_complex "[0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -ar 48000 -f s16le - |ffmpeg -y -i - -codec pcm_s16le "%~dpn1_12.mkv"
ffmpeg -i %1 -filter_complex "[0:a:2][0:a:3]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -ar 48000 -f s16le - |ffmpeg -y -i - -codec pcm_s16le "%~dpn1_34.mkv"
ffmpeg -i %1 -filter_complex "[0:a:4][0:a:5]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -ar 48000 -f s16le - |ffmpeg -y -i - -codec pcm_s16le "%~dpn1_56.mkv"
ffmpeg -i %1 -filter_complex "[0:a:6][0:a:7]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -ar 48000 -f s16le - |ffmpeg -y -i - -codec pcm_s16le "%~dpn1_78.mkv"
REM same with 24bit
ffmpeg -i %1 -filter_complex "[0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f s24le - |ffmpeg -y -i - -codec pcm_s24le "%~dpn1_12.mkv"
ffmpeg -i %1 -filter_complex "[0:a:2][0:a:3]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f s24le - |ffmpeg -y -i - -codec pcm_s24le "%~dpn1_34.mkv"
ffmpeg -i %1 -filter_complex "[0:a:4][0:a:5]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f s24le - |ffmpeg -y -i - -codec pcm_s24le "%~dpn1_56.mkv"
ffmpeg -i %1 -filter_complex "[0:a:6][0:a:7]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f s24le - |ffmpeg -y -i - -codec pcm_s24le "%~dpn1_78.mkv"

REM DolbyE is in a multichannel Track (e.g. IMX-D10 SD Files with 4 channels, 1 track)
ffmpeg -i %1 -filter_complex "channelmap=map=0|1" -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -c:a pcm_s16le "%~dpn1_12.mkv"
ffmpeg -i %1 -filter_complex "channelmap=map=2|3" -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -c:a pcm_s16le "%~dpn1_34.mkv"
ffmpeg -i %1 -filter_complex "channelmap=map=4|5" -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -c:a pcm_s16le "%~dpn1_56.mkv"
ffmpeg -i %1 -filter_complex "channelmap=map=6|7" -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -c:a pcm_s16le "%~dpn1_78.mkv"
REM same with 24 bit
ffmpeg -i %1 -filter_complex "channelmap=map=0|1" -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -c:a pcm_s24le "%~dpn1_12.mkv"
ffmpeg -i %1 -filter_complex "channelmap=map=2|3" -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -c:a pcm_s24le "%~dpn1_34.mkv"
ffmpeg -i %1 -filter_complex "channelmap=map=4|5" -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -c:a pcm_s24le "%~dpn1_56.mkv"
ffmpeg -i %1 -filter_complex "channelmap=map=6|7" -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -c:a pcm_s24le "%~dpn1_78.mkv"

REM DolbyE is in a separate "stereo" track
ffmpeg -i %1 -map 0:1 -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -codec pcm_s16le "%~dpn1_12.mkv"
ffmpeg -i %1 -map 0:2 -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -codec pcm_s16le "%~dpn1_34.mkv"
ffmpeg -i %1 -map 0:3 -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -codec pcm_s16le "%~dpn1_56.mkv"
ffmpeg -i %1 -map 0:4 -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -codec pcm_s16le "%~dpn1_78.mkv"
REM same with 24bit
ffmpeg -i %1 -map 0:1 -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -codec pcm_s24le "%~dpn1_12.mkv"
ffmpeg -i %1 -map 0:2 -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -codec pcm_s24le "%~dpn1_34.mkv"
ffmpeg -i %1 -map 0:3 -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -codec pcm_s24le "%~dpn1_56.mkv"
ffmpeg -i %1 -map 0:4 -c:a pcm_s24le -ar 48000 -f s24le - | ffmpeg -y -i - -codec pcm_s24le "%~dpn1_78.mkv"
pause

Last edited by emcodem; 31st January 2026 at 22:48.
emcodem 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 10:35.


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