MediaArea / MediaInfo

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://MediaArea.net/MediaInfo
BSD 2-Clause "Simplified" License
1.38k stars 160 forks source link

PCM WAV detected as Digital Theater Systems (DTS) #135

Open aevernon opened 7 years ago

aevernon commented 7 years ago

I've attached an example of a PCM Wave file that MediaInfo 0.7.91 incorrectly detects as 3/2-channel Digital Theater Systems (DTS). ffprobe and soxi both identify it as 1-channel 16-bit signed integer PCM.

0C97F897-4C11-4F65-9D3B-2F1BE80D2095.zip

$ mediainfo --version
MediaInfo Command line, 
MediaInfoLib - v0.7.91

$ mediainfo 0C97F897-4C11-4F65-9D3B-2F1BE80D2095.wav
General
Complete name                            : 0C97F897-4C11-4F65-9D3B-2F1BE80D2095.wav
Format                                   : Wave
File size                                : 338 KiB
Duration                                 : 21 s 630 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 128 kb/s

Audio
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Format profile                           : ES Matrix / Core
Mode                                     : 14
Format settings, Endianness              : Little
Codec ID                                 : 1
Duration                                 : 21 s 630 ms
Bit rate mode                            : Constant
Bit rate                                 : 0 b/s
Channel(s)                               : 3 channels / 2 channels
Channel positions                        : Debug, Core_Core_AMODE=0, Core_Core_LFF=3 / Front: C, LFE
Sampling rate                            : 0 Hz
Frame rate                               : 2.155 FPS (3712 spf)
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 338 KiB (100%)

$ ffprobe 0C97F897-4C11-4F65-9D3B-2F1BE80D2095.wav
ffprobe version 3.1.7 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 6.3.1 (GCC) 20161221 (Red Hat 6.3.1-1)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, wav, from '0C97F897-4C11-4F65-9D3B-2F1BE80D2095.wav':
  Duration: 00:00:21.63, bitrate: 128 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1 channels, s16, 128 kb/s

$ soxi 0C97F897-4C11-4F65-9D3B-2F1BE80D2095.wav
Input File     : '0C97F897-4C11-4F65-9D3B-2F1BE80D2095.wav'
Channels       : 1
Sample Rate    : 8000
Precision      : 16-bit
Duration       : 00:00:21.63 = 173040 samples ~ 1622.25 CDDA sectors
File Size      : 346k
Bit Rate       : 128k
Sample Encoding: 16-bit Signed Integer PCM
JeromeMartinez commented 7 years ago

looks like a false positive, I need to add more tests

obruchez commented 7 years ago

We have the same problem with one of our WAV files. It's not a DTS stream, but it is detected as a DTS stream and all the other information (sample rate, etc.) is wrong.

Is there any way to disable the DTS detection algorithm altogether?

Are there other similar detections that are attempted on PCM streams? If so, can they be disabled as well?

obruchez commented 7 years ago

Here's the minimal truncation of our WAV file that causes the problem.

test2.raw.wav.zip

JeromeMartinez commented 7 years ago

Sorry, I always delayed the work on this issue, so it is still present, right. Still on my ToDo-list (low priority due to lack of sponsorship), I add the 2nd file to the list of files to check.

It is currently not possible to disable non-PCM streams in WAV flagged as PCM, it is possible to add such feature but it would not be with free support.

SMPTE ST 337 (which usually transport Dolby E) is also probed.