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 8th April 2022, 21:36   #101  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Quote:
Originally Posted by tormento View Post
Can you please complete the table with THD, DTS and PCM up to 7.1?
I add the DTSHD column because some encoders need mono wavs, but I don't know the names for THD encoders and we don't need know at all the internal names and order.

Quote:
And the most important question: does FFMPEG honor that order when decoding to WAV?
Of course, all actual decoders than I know change the internal codec channel order to the wav order and fill the ChannelMask field of WAVE_FORMAT_EXTENSIBLE header.

And all actual encoders than I know read wav input ChannelMask and create the equivalent internal channel order if is available (if not show a error). If wav input have a simple header (without ChannelMask) assign a default channel map for each number of channels.

For instance for qaac encoder:
In addition to mono/stereo, following channel layouts are supported for AAC and ALAC with slight variations.
When channel layout is unknown, one of the layouts indicated by asterisk is assumed as default.
Code:
#           chn input layout                       output layout           codec
----------- --- ---------------------------------  ----------------------- ------------
3ch*         3  FL FR FC                           C L R                   LC, ALAC
4ch          4  FL FR FC BC                        C L R Cs                LC, ALAC
4ch *        4  FL FR BL BR (SL SR)                L R Ls Rs               LC, HE
5ch *        5  FL FR FC BL BR (SL SR)             C L R Ls Rs             LC, ALAC
5.1ch *      6  FL FR FC LF BL BR (SL SR)          C L R Ls Rs LFE         LC, HE, ALAC
6ch          6  FL FR FC BL BR BC (SL SR)          C L R Ls Rs Cs          LC
6.1ch *      7  FL FR FC LF BL BR BC (SL SR)       C L R Ls Rs Cs LFE      LC, ALAC
7ch          7  FL FR FC BL BR SL SR               C L R Ls Rs Rls Rrs     LC
7.1ch front  8  FL FR FC LF BL BR FLC FRC (SL SR)  C Lc Rc L R Ls Rs LFE   LC, HE, ALAC
7.1ch rear*  8  FL FR FC LF BL BR SL SR            C L R Ls Rs Rls Rrs LFE LC, HE
8ch          8  FL FR FC BL BR BC SL SR            C L R Ls Rs Rls Rrs Cs  LC
(SL SR) is accepted like BL BR to output Ls Rs
Rls Rrs is here MediaInfo Lb Rb (or wav BL BR or EAC3 Lrs Rrs)
Like you see the order and name aren't the same but the encoder do the job atomatically.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 8th April 2022 at 21:56.
tebasuna51 is offline   Reply With Quote
Old 11th April 2022, 14:52   #102  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
I make a test also with TotalCode Studio.

We can configure it like with Audition with some differences:

1) For big files like movie tracks we need rf64 input files (without support for .w64).
And need remap or use the internal remap showed in the image. We can use eac3to:

eac3to 8v341.dtshd 8v341_R.rf64 -0,1,2,3,6,7,4,5

2) The max bitrate is also 1024 Kb/s but there are different channel layouts (see the images).
Without the (L R C LFE Ls Rs Vhl Vhr) than work fine with my audio system 3D 5.2.1.

3) Is fast than Audition.
In my previous old PC (Intel i5-3550 3.30GHz, DDR3 2+2 GB PC3-10700 (667 MHz), SATA ST2000DL003-9VT166 2TB) a source file (Jurasic Park 2h 6m 37s) converted previously to rf64 take 10m 36s to be converted to .ec3.
Audition take 4m to load the .w64 and after 14m to convert it to ec3.
Attached Images
 
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 12th April 2022, 14:59   #103  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
And need remap or use the internal remap showed in the image. We can use eac3to
I prefer to use ffdshow -rf64 auto because it has updated decoders.

Would you please try to use it and tell me if I need channel remapping?

I currently have 2.0 HT here, so I encode to DD+ for archive purpose only and can't directly test.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 12th April 2022, 15:34   #104  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Quote:
Originally Posted by tormento View Post
I prefer to use ffdshow -rf64 auto because it has updated decoders.
Don't work for me:
Quote:
[NULL @ 000001c14431ee00] Unable to find a suitable output format for 'C:\tmp\8v341.dtshd_.rf64'
C:\tmp\8v341.dtshd_.rf64: Invalid argument
Quote:
Would you please try to use it and tell me if I need channel remapping?
Of course:
-filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5"
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 12th April 2022, 17:44   #105  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
Don't work for me
You need to output a WAV file, as RF64 is just a header.

Such as:

ffmpeg.exe -i whatever.thd -rf64 auto whatever.wav

Try and tell me.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 12th April 2022, 20:47   #106  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Quote:
Originally Posted by tormento View Post
You need to output a WAV file, as RF64 is just a header.
I tried with a small file and just output a wav with RIFF header.

Seems need to be a big file (>4 GB) to create a RF64 header.
No problem, if TotalCode Studio accept .wav with RF64 header, instead the .rf64 extension.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 12th April 2022 at 20:51.
tebasuna51 is offline   Reply With Quote
Old 12th April 2022, 21:00   #107  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
I tried with a small file and just output a wav with RIFF header.
Yes, that is the purpose of the auto parameter.

Unfortunately EAC3TO development is frozen, that is why I suggest to use ffmpeg, at least for the decoding part.

The command line that you gave me was for ffmpeg or EAC3TO? And for TotalCode or Audition?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 13th April 2022, 10:39   #108  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
With ffmpeg:

ffmpeg.exe -i whatever.thd -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -rf64 auto -acodec pcm_s24le whatever.wav

Needed for both, TotalCode or Audition, when the source is a standard 7.1 and the output is remapped to FL FR FC LFE SL SR BL BR in the order to obtain the EAC3 L R C LFE Ls Rs Lrs Rrs

With TotalCode you can do the remap inside the dialog 'Channels' window.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 13th April 2022 at 11:17. Reason: Add -acodec pcm_s24le, see next post
tebasuna51 is offline   Reply With Quote
Old 13th April 2022, 11:16   #109  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
WARNING:

By default the ffmpeg output is downsize to 16 bitdepth, no mather the source bitdepth:

Quote:
Input #0, dts, from 'D:\Test\MA71.dts':
Stream #0:0: Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
Stream mapping:
Stream #0:0 -> #0:0 (dts (dca) -> pcm_s16le (native))
Output #0, wav, to 'D:\Test\MA71.dts_.wav':
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 7.1, s16, 6144 kb/s
encoder : Lavc59.18.100 pcm_s16le
eac3to check the input bitdepth, even if is marked wrong, an output the correct bitdepth, you can lose precission with the actualized decoders (without changes for dtsma/thd standard for longtime ago)

With ffmpeg you must know the source bitdepth or add always -acodec pcm_s24le. Now:
Quote:
Input #0, dts, from 'D:\TestMA71.dts':
Stream #0:0: Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
Stream mapping:
Stream #0:0 -> #0:0 (dts (dca) -> pcm_s24le (native))
Output #0, wav, to 'D:\Test\MA71.dts_.wav':
Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 7.1, s32, 9216 kb/s
encoder : Lavc59.18.100 pcm_s24le
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 13th April 2022 at 13:26.
tebasuna51 is offline   Reply With Quote
Old 13th April 2022, 13:11   #110  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
How I do the job (see the image):

1) Load the input file in UsEac3to, and let use the eac3to bitdepth detection

2-4) Select (or write yourself) the desired parameters for ffmpeg

5-6) Click 'A/V Recode' and Replace the decoder by the ffmpeg parameters

7) Select output file 'WAV'
UsEac3to select like encoder "-acodec pcm_s16le" for 16 bit DTSMA or "-acodec pcm_s24le" for 24 bit DTSMA or THD by default.
Many THD are marked as 24 even when are only 16 (detected by eac3to) but if after is recoded to eac3 it is not a problem.

The command line generated is like (without paths to input and output folders):
ffmpeg -i "INPUT" -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -rf64 auto -acodec pcm_s24le "INPUT_.wav"
Attached Images
 
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 13th April 2022 at 13:21.
tebasuna51 is offline   Reply With Quote
Old 13th April 2022, 15:14   #111  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
Needed for both, TotalCode or Audition, when the source is a standard 7.1
Is it ffmpeg fault or wav format fault in your opinion?

Do we need the same remap for 7.1 DTS, 5.1 THD and 5.1 DTS?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 13th April 2022, 15:22   #112  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Is a encoder fault than ignore the channelmap stored in the wav header, writed correctly by ffmpeg.

AAC, FLAC and OPUS encoders don't need remap at all.

5.1 don't need remap, 7.1 standard always with these encoders.
The 5.1.2 in Audition don't need remap.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 15th April 2022, 14:07   #113  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
Is a encoder fault than ignore the channelmap stored in the wav header, writed correctly by ffmpeg.
Thanks!

Please explain me how to check if a encoder loses channel configuration and how to understand the proper channel "wiring" to be done.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 15th April 2022, 18:54   #114  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
UsEac3to select like encoder "-acodec pcm_s16le" for 16 bit DTSMA or "-acodec pcm_s24le" for 24 bit DTSMA or THD by default.
What does it choose for already existing EAC3?

Let us say I want to lower bitrate from 896 to 640. Would it use 24 or 16 bits?

Does it need channel remap when 7.1 or is it in the right order as wav from eac3?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 16th April 2022, 09:58   #115  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Quote:
Originally Posted by tormento View Post
What does it choose for already existing EAC3?

Let us say I want to lower bitrate from 896 to 640. Would it use 24 or 16 bits?
Only lossless encodes (TrueHD, DTS-MA, FLAC,...) have a bitdepth

Lossy encodes don't have bitdepth. Decoders work internally in float format, eac3to can output until 64 bits float, but it is enough 24 bits int (human ear can difference only to 20 bits).

Quote:
Does it need channel remap when 7.1 or is it in the right order as wav from eac3?
The correct wav order is always the same, no mather the source codec, then always must be remapped for that encoders.
Quote:
Originally Posted by tormento View Post
Thanks!

Please explain me how to check if a encoder loses channel configuration and how to understand the proper channel "wiring" to be done.
Download the channel test in https://forum.doom9.org/showthread.p...70#post1963170

If you don't have a 7.1 system to listen you always can "see" the order, the first image is the correct the second is a wrong order:
Attached Images
 
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 16th April 2022, 15:46   #116  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
Download the channel test
Thanks!

Do you know some audio editor that can open THD, DTSHD and so?

What is that one?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 16th April 2022, 20:03   #117  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Audo editors only work with uncompressed audio.

Decode anything to wav/w64 before edit.

I work with Goldwave from longtime ago, but you can use Audacity also.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 20th April 2022, 16:39   #118  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
Many THD are marked as 24 even when are only 16 (detected by eac3to) but if after is recoded to eac3 it is not a problem.
Is there a way to find the correct bitdepth?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 21st April 2022, 03:05   #119  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,980
Let eac3to decode it.
It analyze all decoded samples to see how many bits have info.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 30th May 2022, 17:38   #120  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,615
Quote:
Originally Posted by tebasuna51 View Post
Let eac3to decode it.
I have found a (I think) strange 6.1 (7?) audio DTS from Ghost in the shell 2.0 BD.

mediainfo:
Code:
Audio #1
ID                             : 4352 (0x1100)
Menu ID                        : 1 (0x1)
Format                         : DTS ES XLL
Format/Info                    : Digital Theater Systems
Commercial name                : DTS-HD Master Audio
Muxing mode                    : Stream extension
Codec ID                       : 134
Duration                       : 1 h 23 min
Bit rate mode                  : Variable / Constant / Constant
Bit rate                       : Unknown / 1 509 kb/s / 1 509 kb/s
Channel(s)                     : 7 channels / 7 channels / 6 channels
Channel layout                 : C L R Ls Rs LFE Cb / C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate                  : 48.0 kHz
Frame rate                     : 93.750 FPS (512 SPF)
Bit depth                      : 24 bits
Compression mode               : Lossless / Lossy / Lossy
Language                       : Italian
Source                         : 00009.m2ts

Audio #2
ID                             : 4353 (0x1101)
Menu ID                        : 1 (0x1)
Format                         : DTS ES XXCH XLL
Format/Info                    : Digital Theater Systems
Commercial name                : DTS-HD Master Audio
Muxing mode                    : Stream extension
Codec ID                       : 134
Duration                       : 1 h 23 min
Bit rate mode                  : Variable / Constant / Constant
Bit rate                       : Unknown / 1 509 kb/s / 1 509 kb/s
Channel(s)                     : 7 channels / 7 channels / 6 channels
Channel layout                 : C L R Ls Rs LFE Cb / C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate                  : 48.0 kHz
Frame rate                     : 93.750 FPS (512 SPF)
Bit depth                      : 16 bits
Compression mode               : Lossless / Lossy / Lossy
Language                       : Japanese
Source                         : 00009.m2ts
eac3to:
Code:
DTS Master Audio, 5.1 channels, 24 bits, 48kHz
(core: DTS-ES, 5.1 channels, 1509kbps, 48kHz)

DTS Master Audio, 6.1 channels, 16 bits, 48kHz
(core: DTS-ES, 6.1 channels, 1509kbps, 48kHz)
Can you suggest me the correct decoding channel parameters for them, in ffmpeg format?
__________________
@turment on Telegram

Last edited by tormento; 30th May 2022 at 17:42.
tormento is offline   Reply With Quote
Reply

Tags
eac3

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 08:59.


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