ffmpeg fails to identify DTS WAV files.

Bug #305315 reported by Adam Buchbinder
2
Affects Status Importance Assigned to Milestone
FFmpeg
New
Unknown
ffmpeg (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Consider any DTS WAV file from http://www.diatonis.com/downloads_dts_ac3.html. (They're quite large, which is why I'm not attaching one.) I can play them in mplayer, which uses libdca to decode them, without specifying any command-line options or forcing a particular codec. However, ffplay and ffmpeg assume that they're PCM WAV files, and output white noise. This version of ffmpeg supposedly does support DTS audio:

$ ffmpeg -formats 2>/dev/null|grep dts
  E adts ADTS AAC
 D dts raw dts

What I expected: I expected ffmpeg to decode the sound file as a DTS file, and ffplay to play it as one.

What happened: ffmpeg decoded/played it as a PCM WAV file, resulting in white noise.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 8.10
Package: ffmpeg 3:0.svn20080206-12ubuntu3
ProcEnviron:
 SHELL=/bin/bash
 PATH=/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
SourcePackage: ffmpeg-debian
Uname: Linux 2.6.27-7-generic i686

Tags: apport-bug
Revision history for this message
Adam Buchbinder (adam-buchbinder) wrote :
Revision history for this message
Reinhard Tartler (siretart) wrote :

I've creating an upstream bugtask, but this still needs forwarding upstream.

See http://ffmpeg.org/bugreports.html for guidelines how to do that.

Revision history for this message
Adam Buchbinder (adam-buchbinder) wrote :

On further investigation it's already open upstream. This problem arises because the relevant file's "fmt " chunk specifies type 0x01 (it's in little-endian format, two bytes at offset 0x14), which is uncompressed PCM data.

http://www.sonicspot.com/guide/wavefiles.html#fmt

$ hexdump -x diatonis_dts_secret-universe.wav -n 2 -s 0x14
0000014 0001
0000016

Using hexedit to change the bytes at offset 0x14 from 01 00 to 01 20 (0x2001 in little-endian format):

$ hexdump -x diatonis_dts_secret-universe.wav -n 2 -s 0x14
0000014 2001
0000016

The file now plays properly in ffplay, and ffmpeg can decode it properly.

I would consider this a problem with the file, but according to the following thread on ffmpeg-devel, it's standard for programs writing DTS audio to do so with a broken header to maintain compatibility with broken CD burning programs. There was a patch proposed, but it wasn't adopted at the time.

http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-February/007703.html

As an aside, there's a workaround which I had thought didn't work because I was specifying the options in the wrong order. Using "ffplay -f dts file.wav" or "ffmpeg -f dts -i file.wav output.ogg" skips the codec detection, and works properly.

Changed in ffmpeg:
importance: Undecided → Unknown
status: New → Unknown
Changed in ffmpeg:
status: Unknown → Confirmed
Revision history for this message
Adam Buchbinder (adam-buchbinder) wrote :

I should add that I'm leaving the task open even though it's about dealing with broken files, as (1) the broken files are near-universal--that is, it's apparently more common to find DTS files that claim to be Microsoft PCM than DTS files claiming to be DTS--and (2) mplayer has working detection code, which seems to indicate that it's at least possible.

Changed in ffmpeg-debian:
status: New → Confirmed
Changed in ffmpeg:
status: Confirmed → New
affects: ffmpeg-debian (Ubuntu) → ffmpeg (Ubuntu)
Changed in ffmpeg (Ubuntu):
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ffmpeg - 4:0.6~svn20100505-1ubuntu1

---------------
ffmpeg (4:0.6~svn20100505-1ubuntu1) maverick; urgency=low

  * merge from debian/experimental. remaining changes:
    - don't disable encoders
    - don't build against libfaad, libdirac and libopenjpeg (all in universe)

ffmpeg (4:0.6~svn20100505-1) experimental; urgency=low

  * update to new upstream. Closes: #569727
    - fixes various segfaults and other minor feature improvements
      Closes: #374931, #522449, #501891, #559712, #420231, #369127, #538082,
              #298095, #294422, #561553, #525385, #495274, #420230
      LP: #305286, #457106, #529200, #301723, #305315, #336479, #420230,
          #412063, #428912, #432181, #440591, #453732, #453732, #453732,
      #514259, #515243, #521472, #530186, #530186, #197842, #483317,
     #483317, #539407, #280098, #331255, #566107, #569823, #570305,
     #573190
  * Fixup lintian overrides for new upstream snapshot
  * Bump Standards-Version to 3.8.4
  * Many upstream changes, see upstream Changelog for details
 -- Reinhard Tartler <email address hidden> Wed, 26 May 2010 00:01:17 +0200

Changed in ffmpeg (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.