Log in

View Full Version : Command to Decode TrueHD to RAW?


wswartzendruber
22nd June 2009, 13:47
Word is that FFMPEG has a Dolby TrueHD decoder. I can't figure out how to use it to decode a TrueHD track into raw PCM. I used tsMuxeR to extract the complete audio track.

Any help would be appreciated.

TinTime
22nd June 2009, 13:55
I'd use eac3to to do this.

tebasuna51
22nd June 2009, 19:26
You can use eac3to to extract (from container without use TsMuxer) and convert to .pcm (maybe better to .wav or .w64 with raw audio data and a header)

wswartzendruber
24th June 2009, 18:07
Okay, so I would put in:

eac3to input.thd output.raw
Now I suppose all I need to determine is TrueHD's channel order.

TinTime
24th June 2009, 18:32
Do you definitely need to convert to pcm or can you use wav/wav64 as suggested by tebasuna51? You don't need to worry about channel mappings then.

Also I'd go from the source with eac3to (again as suggested by tebasuna51) because it will be quicker (no separate demux and convert steps) and eac3to will correct any audio overlaps or delays.

wswartzendruber
24th June 2009, 23:07
TrueHD is supposed to be lossless, so 64-bit WAV wouldn't really do anything for me, since 64-bit and 24-bit aren't the same.

EDIT: This will be getting piped into either FLAC or Vorbis (AOTUV quality 5), so I prefer raw PCM.

Inspector.Gadget
24th June 2009, 23:11
TrueHD is supposed to be lossless, so 64-bit WAV wouldn't really do anything for me, since 64-bit and 24-bit aren't the same.

64-bit refers to the address space, not audio bit depth.

TinTime
24th June 2009, 23:17
This will be getting piped into either FLAC or Vorbis (AOTUV quality 5).

Right, eac3to will convert to FLAC too. You can also pipe out of it.

tebasuna51
24th June 2009, 23:25
The audio data from .raw, .wav and .w64 are exact.
.wav have a little header with bitdepth, channels and samplerate valid if the size is <4GB (2^32)
.w64 have the header with the same data valid for size until 2^64

All is lossless, of course you can use also .flac like output directly (with half size more or less):
eac3to input.thd output.flac

TinTime
25th June 2009, 02:19
FLAC is covered by eac3to but does your Vorbis encoder accept >4GB or piped wav files? Some kind of ignore length option?
You could do

eac3to.exe input.thd stdout.wav | ogg encoder...

The wavformat extensible header will take care of channel mappings.

Otherwise do

eac3to.exe input.thd stdout.pcm | ogg encoder...

But I'd still recommend you go straight from your source (Blu-Ray?) rather than demuxing the TrueHD first.

tebasuna51
25th June 2009, 11:34
FLAC is covered by eac3to but does your Vorbis encoder accept >4GB or piped wav files? Some kind of ignore length option?
You could do

eac3to.exe input.thd stdout.wav | ogg encoder...

The wavformat extensible header will take care of channel mappings.

Otherwise do

eac3to.exe input.thd stdout.pcm | ogg encoder...

But I'd still recommend you go straight from your source (Blu-Ray?) rather than demuxing the TrueHD first.
The new oggenc2.85-1.2.2 (http://www.rarewares.org/ogg-oggenc.php) accept the --ignorelength parameter and also WAVE_FORMAT_EXTENSIBLE header but if the MaskChannel don't match with the ogg valid multichannels options reject the value and use the internal channel order.

Then you can use:
eac3to input.thd stdout.wav -0,2,1,4,5,3 | OggEnc2 -q 3 --ignorelength -o output.ogg -
Or
eac3to input.thd stdout.wav -0,2,1,4,5,3 -simple | OggEnc2 -q 3 --ignorelength -o output.ogg -

But this don't work:
eac3to input.thd stdout.wav | OggEnc2 -q 3 --ignorelength -o output.ogg -
because the eac3to MaskChannel 1551 (FL FR FC LF SL SR) isn't accepted, for 5.1 need the channelmask 63 (FL FR FC LF BL BR)