Posts: 164
Threads: 9
Joined: 2015 May
Thanks: 264
Given 37 thank(s) in 25 post(s)
Country:
Hi, Guys! I was wanting to know if anyone can tell me how to losslessly convert DTS-HD audio to LPCM without any quality loss at all? Is it possible? I am working on some movie corrections and would love to be able to do this. Thanx!
Posts: 2,810
Threads: 50
Joined: 2015 Jan
Thanks: 1882
Given 1012 thank(s) in 650 post(s)
I think it's easy you just import the files in audacity (after having configured audacity to accept DD and DTS)
Posts: 7,151
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1497 thank(s) in 969 post(s)
Country:
Posts: 164
Threads: 9
Joined: 2015 May
Thanks: 264
Given 37 thank(s) in 25 post(s)
Country:
2019-03-29, 10:51 AM
(This post was last modified: 2019-03-29, 11:04 AM by crampedmisfit1990.)
Posts: 7,151
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1497 thank(s) in 969 post(s)
Country:
Posts: 164
Threads: 9
Joined: 2015 May
Thanks: 264
Given 37 thank(s) in 25 post(s)
Country:
deleted user
Unregistered
Thanks:
Given thank(s) in post(s)
I spent a few days researching this a year ago or so. The absolutely simplest, fastest, most fool-proof and definitively lossless way is to use ffmpeg with this commandline:
Code: ffmpeg -i "source-audio.dtshd" output.flac
It's as simple as that. ffmpeg's dts library supports the HD MA extension as well as other HD extensions like HD HRA etc., tested it myself.
In eac3to, last time I checked you could choose between some kind of "hack" with a dll from some official decoder, but that one had different bugs depending on version.
And then there was a better one for eac3to called libdcadec.
But here's the plottwist. Here's the libdcadec github repository: https://github.com/foo86/dcadec
As you can see, it hasn't been updated for years. That's because the code has been integrated into ffmpeg and is being maintained there.
So with ffmpeg you pretty much get the absolutely best dts decoder there currently is.
I've never tried the Audacity route, but it sounds like a bit of a waste of time and a potential error source to me tbh, the commandline does not require you to load and then re-save the file, it transcodes it on-the-fly. It can even read it straight out of a video file, but in that case I recommend adding "-vn" before "output.flac" as an option to make it not process the video stream, otherwise it will slow it down.
It will also automatically save it as either 16 bit or 24 bit FLAC depending on the bit depth of the source DTS HD MA file, to guarantee a lossless perfect representation.
There is a single downside: If you do not transcode to FLAC, but to WAV instead, it will always default to 16 bit for some reason. If you want to transcode a 24-bit DTS-HD MA file directly to WAV instead of FLAC, add "-acodec pcm_s24le" before "output.wav".
Also, if you have a 24 bit DTS-HD MA file with a lot of channels and want to output to WAV instead of FLAC, you may realize the file becomes bigger than 4GB. Since WAV files do not really support this, you will get an error message and likely be unable to properly open it anywhere. In this case I recommend to save as ".w64" instead. It's the Wave64 file format, which is basically just a normal WAV file format, except it can save >4GB of data. Compatibility is a bit limited though, not every software can open it, for example video editing software sometimes can't read these. Audio editors usually can tho. Otherwise the same caveat with 24 bit that goes for WAV also goes for W64, you have to specify 24 bit manually.
Again, safest simplest way is to convert straight to FLAC and you don't have to worry about a thing, and you can always transcode the FLAC to WAV later if you need it too, it's a lossless codec after all. And it's relatively widely supported tho. And it needs less space than a WAV. 
Posts: 164
Threads: 9
Joined: 2015 May
Thanks: 264
Given 37 thank(s) in 25 post(s)
Country:
Thanks, Tom! That was a lot of useful info. I researched a lot of this awhile back and it gave me a headache. Haha
Posts: 164
Threads: 9
Joined: 2015 May
Thanks: 264
Given 37 thank(s) in 25 post(s)
Country:
2019-03-29, 11:12 PM
(This post was last modified: 2019-03-29, 11:15 PM by crampedmisfit1990.)
For the first time in my life... I just got ffmpeg installed on my pc correctly. I am already starting to understand it more and I think I will be able to test it soon. I really appreciate all the help, guys! I am eager to get some projects going and share them with everyone. They won't be huge projects at first but as I get more experience they will expand.
Posts: 164
Threads: 9
Joined: 2015 May
Thanks: 264
Given 37 thank(s) in 25 post(s)
Country:
2019-03-30, 03:40 AM
(This post was last modified: 2019-03-30, 04:07 AM by crampedmisfit1990.)
Ok, I just got home from work and tried this code on one of my DTS-HD tracks and after messing around with it a bit I figured it out and it converted it to .flac without a problem! Thank you so much, Tom!
PS: Is it normal that the .flac is less than half the size of the DTS-HD track? Also, Is it ok to convert the .flac to PCM 16 & 24 bit after in Audacity or do I do that another way? I will always want it as .wav but without quality loss when converting from the .flac.
|