ffmpeg - Making a Clean WAV file

前端 未结 2 1729
忘掉有多难
忘掉有多难 2021-02-11 04:36

I\'m looking to batch convert a number of files to audio files using ffmpeg for a game called Star Wars: Jedi Knight: Dark Forces II. The problem I\'m

相关标签:
2条回答
  • 2021-02-11 05:16

    According to this feature request for ffmpeg to change its wav header files, the problem is 2 optional bytes. cbSize which are only supposed to be used for non-pcm data.

    https://ffmpeg.org/pipermail/ffmpeg-devel/2013-April/142576.html

    The header ffmpeg was writing as of 2013 was "80 bytes or 46 if you manage to suppress the LIST-INFO chunk."

    The solution written there is to used these arguments when using ffmpeg.

    > I must use ffmpeg -i ... -f s16le tmp.dat and then mplayer -demuxer rawaudio -rawaudio rate=44100:channels=2:samplesize=2 -ao pcm tmp.dat to get "normal" wav file, many program can't read ffmpeg's wav file, they read 44 bytes of header, and others data use as sound, sometimes it caused broken byteorder, or they say that file is broken and can't read file at all. So I want get "correct" wav from ffmpeg directly. Sorry for my bad english :)

    The method listed there might work if -bitexact is not applicable. For example when converting wav to wav in order to fix the header.

    0 讨论(0)
  • 2021-02-11 05:30

    FFMpeg by default is adding a LIST-INFO chunk to the WAV output. Adding -bitexact suppresses it.

    So,

    ffmpeg -i "orig.wav" -f wav -bitexact -acodec pcm_s16le -ar 22050 -ac 1 "ffmpeg.wav"
    
    0 讨论(0)
提交回复
热议问题