Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Can't convert DTS-HD MA 96k without downsampling to 24k (Read 10287 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can't convert DTS-HD MA 96k without downsampling to 24k

I don't know if this is the right place or the right audience, but fingers crossed and apologies if not (long time reader, 1st time posting ;) ).

I have a BluRay Audio (BD-A) extraction (currently an .mkv) where the audio is in 6-channel (5.1) DTS-HD MA, 96k/24bit.  However, all the tools I have at hand (ffmpeg, ffprobe, MakeMKV, mediainfo, Kodi (all on Linux)) report the audio stream as DTS-HD MA 48k.  However, if I use Kodi over HDMI to pass this to my processor (which does *all* formats), the pre-pro sees it as 5.1 DTS-HD MA 96k! (which is what I was expecting) (I read somewhere that the "core" details are what get reported when you query the container, but the core and "HD" extension streams inside the container gets decoded together and that's what actually gets played by the processor (hence the processor displays the 96k details).

Usually, there is an LPCM stream on the disc so at this point, I copy the LPCM 24bit/96k stream using the ffmpeg option -acodec pcm_s24le into a WAV container.  If I attempt to do this from the DTS-HD MA stream (which is the only one on this disc), I was expecting it to decode the 96k DTS-HD MA steam into RAW PCM and then write this as a 24bit/96k LPCM stream into the WAV container.  However, what seems to happen is, it extracts the "Core" DTS stream, which is 24bit/48k and put that into the WAV container instead:

Audio: pcm_s24le, 48000 Hz, 5.1, s32, 6912 kb/s

If I use the -acodec copy switch with ffmpeg, I end up with a WAV file container, with the DTS-HD MA stream inside, which reports as 48k, but plays correctly at 96k (according to my processor):

Audio: dca (DTS-HD MA), 48000 Hz, 5.1, fltp, 1536 kb/s

So it seems that you can re-package a DTS-HD MA stream into a WAV container, without touching the stream, but you can't "decode" the DTS-HD MA to PCM (which is what the processor is doing), and store the PCM (inside a WAV container), and keep the lossless 96k part of the stream!?

Usually, once I have the WAV with PCM or LPCM, I go on to convert it to FLAC, for storage and tagging purposes, but that's not actually relevant to this problem.

Any ideas, anyone?

Cheers,

Matt.

Re: Can't convert DTS-HD MA 96k without downsampling to 24k

Reply #1
Which version of ffmpeg? old versions can't properly decode DTS-HD MA
Last version has no problem with decoding any variant of DTS-HD  to pcm. But wav in ffmpeg by defaul uses 16 bit even if source is 24 bit. So it is better/safer to decode to FLAC.  When ecoding to flac ffmpeg automatically tries to preserve original bitdepth and samplerate.
inputfile.mkv -acodec flac outputfile.flac

Re: Can't convert DTS-HD MA 96k without downsampling to 24k

Reply #2
Many Thanks.  The latest ffmpeg I have is 2.8.8, which shows the same problem.  What version are you talking about? (bearing in mind, Kodi v16 is using I think ffmpeg 2.8 and that decodes it just fine (or perhaps, actually, Kodi may not be decoding it, it's passing it straight through, but Kodi is presumably using this version of ffmpeg to get the details of the file (though, here also, it gets it wrong and reports it as 192k 24bit))).

Do you have a file with DTS-HD MA 96k in it that you can use ffprobe to report back what it gets described as with the version you are running?

Up until now, I've not had the problem because when I specify the -acodec pcm_24le switch, that has usually preserved both the 24bit depth and the sample rate.

All very odd! :(

Re: Can't convert DTS-HD MA 96k without downsampling to 24k

Reply #3
The latest ffmpeg I have is 2.8.8, which shows the same problem.  What version are you talking about?
I use latest git-version (windows build from Zeranoe - https://ffmpeg.zeranoe.com/builds/). Looking at changelog (https://git.videolan.org/?p=ffmpeg.git;a=blob_plain;f=Changelog) it seems that "new DCA decoder with full support for DTS-HD extensions" was implemented in  version 3.0.

Do you have a file with DTS-HD MA 96k in it that you can use ffprobe to report back what it gets described as with the version you are running?
Yes. And ffprobe detects it correctly as dts (DTS-HD MA), 96000 Hz, stereo, s32p (24 bit), But also mediainfo 0.7.95 detects it correctly
Code: [Select]
Audio
ID                                       : 1
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Format profile                           : MA / Core
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 3 min 36 s
Bit rate mode                            : Variable / Constant
Bit rate                                 : 3 840 kb/s / 1 509 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 96.0 kHz / 48.0 kHz
Frame rate                               : 93.750 FPS (512 spf)
Bit depth                                : 24 bits
Compression mode                         : Lossless / Lossy
Stream size                              : 101 MiB (100%)
Default                                  : Yes
Forced                                   : No

 

Re: Can't convert DTS-HD MA 96k without downsampling to 24k

Reply #4
Many Thanks! :)

Using ffmpeg 3.3 I have now carried out what I was originally attempting, correctly (new version of mediainfo also now concurs as well)

Top man, thanks again! :)