[FFmpeg-trac] #2244(avformat:new): ffmpeg creates invalid odd-byte length wav files

FFmpeg trac at avcodec.org
Thu Feb 7 04:55:18 CET 2013


#2244: ffmpeg creates invalid odd-byte length wav files
--------------------------------------+----------------------------------
               Reporter:  dericed     |                  Owner:
                   Type:  defect      |                 Status:  new
               Priority:  normal      |              Component:  avformat
                Version:  git-master  |               Keywords:  wav
             Blocked By:              |               Blocking:
Reproduced by developer:  0           |  Analyzed by developer:  0
--------------------------------------+----------------------------------
 Summary of the bug:

 When I copy the audio data with ffmpeg from wav to wav and the source has
 an odd-byte-length data chunk then the resulting file is invalid because
 the output file is missing the required padding byte. In the command below
 this results in a 144,485 byte wav file (odd length RIFF chunks are not
 allowed). I can manually make the output valid by appending a padding byte
 to the end.

 I'm attaching a sample source file: a valid wav file with mono 24 bit
 audio. The file has an odd-byte data length (this happens about half the
 time when recording 24 bit mono).

 How to reproduce:
 {{{
 ffmpeg -i oddbytedatalength.wav -c copy copied.wav
 ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
   built on Feb  6 2013 22:00:51 with Apple clang version 4.1
 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
   configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
 --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree
 --enable-hardcoded-tables --enable-avresample --cc=cc --host-cflags=
 --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame
 --enable-libxvid --enable-ffplay --enable-libopenjpeg --extra-
 cflags='-I/usr/local/Cellar/openjpeg/1.5.1/include/openjpeg-1.5 '
   libavutil      52. 17.101 / 52. 17.101
   libavcodec     54. 91.101 / 54. 91.101
   libavformat    54. 61.104 / 54. 61.104
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 35.101 /  3. 35.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, wav, from 'oddbytedatalength.wav':
   Metadata:
     encoder         : Lavf54.61.104
   Duration: 00:00:01.00, bitrate: 1153 kb/s
     Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono,
 s32, 1152 kb/s
 Output #0, wav, to 'copied.wav':
   Metadata:
     ISFT            : Lavf54.61.104
     Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono,
 1152 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 size=     141kB time=00:00:01.00 bitrate=1152.8kbits/s
 video:0kB audio:141kB subtitle:0 global headers:0kB muxing overhead
 0.070645%
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2244>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list