Reject DTS-HD MA

2

I have couple of video files containing both regular DTS as well as DTS-HD MA audio tracks. I want to get rid of the DTS-HD MA audio streams during transcoding, but have not figured out how to do so. I have tried -c:a:codec:DTS copy, but this also copies over the DTS-HD tracks.
The streams are arranged something like this:

    Stream #0:1(deu): Audio: dts (DTS-HD MA), 48000 Hz, stereo, s32p (24 bit) (default)
Metadata:
  title           : Stereo
  BPS-eng         : 1714423
  DURATION-eng    : 01:26:25.973333333
  NUMBER_OF_FRAMES-eng: 486185
  NUMBER_OF_BYTES-eng: 1111369156
  SOURCE_ID-eng   : 001100
  _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.8 linux(x64-release)
  _STATISTICS_WRITING_DATE_UTC-eng: 2017-12-03 16:23:57
  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream #0:2(deu): Audio: dts (DTS), 48000 Hz, stereo, fltp, 768 kb/s
Metadata:
  title           : Stereo
  BPS-eng         : 768000
  DURATION-eng    : 01:26:25.973333333
  NUMBER_OF_FRAMES-eng: 486185
  NUMBER_OF_BYTES-eng: 497853440
  SOURCE_ID-eng   : 001100
  _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.8 linux(x64-release)
  _STATISTICS_WRITING_DATE_UTC-eng: 2017-12-03 16:23:57
  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream #0:3(jpn): Audio: dts (DTS-HD MA), 48000 Hz, stereo, s32p (24 bit)
Metadata:
  title           : Stereo
  BPS-eng         : 1014690
  DURATION-eng    : 01:26:25.973333333
  NUMBER_OF_FRAMES-eng: 486185
  NUMBER_OF_BYTES-eng: 657769964
  SOURCE_ID-eng   : 001101
  _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.8 linux(x64-release)
  _STATISTICS_WRITING_DATE_UTC-eng: 2017-12-03 16:23:57
  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream #0:4(jpn): Audio: dts (DTS), 48000 Hz, stereo, fltp, 768 kb/s
Metadata:
  title           : Stereo
  BPS-eng         : 768000
  DURATION-eng    : 01:26:25.973333333
  NUMBER_OF_FRAMES-eng: 486185
  NUMBER_OF_BYTES-eng: 497853440
  SOURCE_ID-eng   : 001101
  _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.8 linux(x64-release)
  _STATISTICS_WRITING_DATE_UTC-eng: 2017-12-03 16:23:57
  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID

I have a bunch of files to process so I'd rather not figure out the mappings fore each file manually. How do I reject the DTS-HD streams / only select DTS? I've tried How do I extract DTS core from a DTS-HD MA track using ffmpeg or alternative linux based tool? which does not filter the HD tracks out.

Matthias

Posted 2017-12-11T02:13:37.963

Reputation: 43

Answers

2

If your regular DTS tracks have a fixed bitrate as shown below,

Metadata:
  title           : Stereo
  BPS-eng         : 768000
  DURATION-eng    : 01:26:25.973333333

you can use

ffmpeg -in.mkv -c copy -map 0:v -map 0:m:BPS-eng:768000 -map 0:s? out.mkv

Gyan

Posted 2017-12-11T02:13:37.963

Reputation: 21 016

Oh, that's some outside the box thinking... +1 for that. I actually don't know whether that's true for all my files. I'll try it but won't accept your answer for now as it's not really the answer. Thanks! EDIT: I cant vote for your answer, yet :( – Matthias – 2017-12-12T18:05:02.007

Hrm, any way to use the m:<key>:<value> syntax to compare against non-TAG: stream attributes like profile? (as returned by ffprobe -show_streams -show_format) – genpfault – 2019-09-18T20:07:39.040

Something like -map -0:m:profile:'DTS-HD MA'. Except functional. – genpfault – 2019-09-18T20:10:47.707