Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5282 closed defect (invalid)

ffmpeg / ffprobe fail to detect the correct bit depth for some 24 bit DTS streams.

Reported by: mario78 Owned by:
Priority: normal Component: ffprobe
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

ffmpeg / ffprobe fail to detect the correct bit depth for some 24 bit DTS streams.

The streams are embedded in a mkv file.

MediaInfo reports the following:

Audio #1
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 58mn 13s
Bit rate mode                            : Constant
Bit rate                                 : 1 509 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Frame rate                               : 93.750 fps (512 spf)
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 628 MiB (5%)
Title                                    : DTS 5.1 @ 1509/768 Kbps
Language                                 : German
Default                                  : Yes
Forced                                   : Yes

Audio #2
ID                                       : 3
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Format profile                           : MA / Core
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 58mn 13s
Bit rate mode                            : Variable / Constant
Bit rate                                 : Unknown / 1 509 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Frame rate                               : 93.750 fps (512 spf)
Bit depth                                : 24 bits
Compression mode                         : Lossless / Lossy
Title                                    : ~ DTS-HD MA 5.1 @ 24bit
Language                                 : English
Default                                  : No
Forced                                   : No

However, ffprobe -show_streams <input> reports the following:

[STREAM]
index=1
codec_name=dca
codec_long_name=DCA (DTS Coherent Acoustics)
profile=DTS
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=s32p
sample_rate=48000
channels=6
channel_layout=5.1(side)
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=1536000
max_bit_rate=N/A
bits_per_raw_sample=24
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=1
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=ger
TAG:title=DTS 5.1 @ 1509/768 Kbps
[/STREAM]
[STREAM]
index=2
codec_name=dca
codec_long_name=DCA (DTS Coherent Acoustics)
profile=DTS-HD MA
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=s32p
sample_rate=48000
channels=6
channel_layout=5.1(side)
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=24
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:title=~ DTS-HD MA 5.1 @ 24bit
[/STREAM]

Notice especially "bits_per_sample=0" and "sample_fmt=s32p".

This is a bug very similar to this one (I think): https://trac.ffmpeg.org/ticket/3919

Why is this an issue?

Because when I try to convert these audio streams to ac3, ffmpeg creates a 32 bit audio stream which is a waste of space. More details can be found here: http://ffmpeg.gusari.org/viewtopic.php?f=11&t=2705

How to reproduce:

Unfortunately, I can't send you my audio streams, because these are from a copyright protected movie. But maybe you can just grab any blu ray movie with 24 bit DTS audio stream and try if you can reproduce the issue. If you want me to try any specific command or something on my files, just let me know.

ffmpeg version 3.0 Win64, this one.

Change History (5)

comment:1 by mario78, 8 years ago

Version: git-master

Just for the sake of completeness, the latest git-version (this one) also suffers from that issue.

comment:2 by Elon Musk, 8 years ago

Resolution: invalid
Status: newclosed

s32 is just internal representation. ffprobe reports correct bit depth in bits_per_raw_sample.

comment:3 by mario78, 8 years ago

But ffmpeg creating a 32 bit ac3 stream out of a 24 bit dts stream when I just specify "-c:a ac3 -b:a 640k" is still a bug, isn't it?

comment:4 by Hendrik, 8 years ago

ac3 is a lossy format that operates on 32-bit floating point, thats the expected format it uses.

comment:5 by Carl Eugen Hoyos, 8 years ago

Keywords: dts removed
Note: See TracTickets for help on using tickets.