[FFmpeg-devel] Wave header

Виталий vitalik1231 at yandex.ru
Fri Apr 19 17:15:16 CEST 2013


>The short answer: add '-flags +bitexact' to the FFmpeg command line.
>
>This inhibits the "encoder" metadata (see libavformat/mux.c:336), so
>no extra chunks will be written.
>
>It would still be interesting to know what (broken) programs do not
>accept WAV files with arbitrary chunks in the header; this is also a
>worry for -rf64 auto mode (which is currently not enabled by default).
>
>Thanks,
>-- Daniel Verkamp

It doesn't work
Source code of wavcrc32.cpp you can find from:
http://rutracker.org/forum/viewtopic.php?t=357895
http://pastebin.com/M3DxtHqX

vitalik at debian:/dev/shm/ffmpeg$ g++ -Wall wavcrc32.cpp

vitalik at debian:/dev/shm/ffmpeg$ ./ffmpeg -f s16le -ar 44100 -ac 2 -i 1.dat -flags +bitexact out.wav
ffmpeg version N-52268-g42bcc40 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 19 2013 18:01:43 with gcc 4.4.5 (Debian 4.4.5-8)
  configuration: --prefix=/dev/shm/ffmpeg
  libavutil      52. 27.100 / 52. 27.100
  libavcodec     55.  4.100 / 55.  4.100
  libavformat    55.  3.100 / 55.  3.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 58.100 /  3. 58.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[s16le @ 0x3140980] max_analyze_duration 5000000 reached at 5015510 microseconds
[s16le @ 0x3140980] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, s16le, from '1.dat':
  Duration: 00:00:10.00, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Output #0, wav, to 'out.wav':
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
size=    1723kB time=00:00:10.00 bitrate=1411.2kbits/s    
video:0kB audio:1723kB subtitle:0 global headers:0kB muxing overhead 0.002608%

vitalik at debian:/dev/shm/ffmpeg$ ./a.out out.wav
EAC wavcrc32 v0.22 (c) ]DichlofoS[ Systems, 2007
thanx to: BakLAN, siro and other beta-testers/contributors!
file opened ok
*** invalid format chunk size!

vitalik at debian:/dev/shm/ffmpeg$ mplayer -demuxer rawaudio -rawaudio rate=44100:channels=2:samplesize=2 1.dat -ao pcm
MPlayer SVN-r31918 (C) 2000-2010 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 1.dat.
rawaudio file format detected.
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
[AO PCM] File: audiodump.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Stereo Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  10.0 (10.0) of 10.0 (10.0)  0.0% 


Exiting... (End of file)

vitalik at debian:/dev/shm/ffmpeg$ ./a.out audiodump.wav
EAC wavcrc32 v0.22 (c) ]DichlofoS[ Systems, 2007
thanx to: BakLAN, siro and other beta-testers/contributors!
file opened ok
RIFF header checked ok
please wait while couning checksums...
processing 441000 samples...
file closed ok
--- used in EAC:
generic: grabbing, "no use..." off [all bytes]            : 7272666E.
generic: grabbing, "no use..." on [word nulsamples l/r]   : C3EE96CF.
waveditor [word nulsamples l]                             : 5833D7CB.
--- no used in EAC, only for reference:
byte ignore zeros                                         : 3C116930.
dword nulsamples                                          : 7272666E.


More information about the ffmpeg-devel mailing list