ffmpeg-制作干净的WAV文件 [英] ffmpeg - Making a Clean WAV file
问题描述
我希望使用ffmpeg
将一个名为Star Wars: Jedi Knight: Dark Forces II
的游戏批量转换为音频文件.我遇到的问题是ffmpeg
似乎正在执行某些操作,因此Jedi Knight
无法播放声音文件.
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 having is that ffmpeg
seems to be doing something that does so that Jedi Knight
can't play the sound file.
Jedi Knight
接受从5khz到96khz,8位和16位,单声道和立体声的各种范围的普通PCM
WAV
文件.这听起来很简单.除非使用MS Sound Recorder
创建WAV
文件,否则Jedi Knight
不能播放它.猜测是它为标头或其他内容添加了一些额外的内容.但是它可以播放由Audacity
,GoldWave
或ModPlug Tracker
创建的WAV
文件.
Jedi Knight
accepts plain old PCM
WAV
files of various ranges, from 5khz to 96khz, 8 and 16 bit, mono and stereo. This sounds plain and simple. Except for that if one were to create a WAV
file using MS Sound Recorder
, Jedi Knight
could not play it. Speculation was that it added something extra to header or something. But it can play a WAV
file created by Audacity
, GoldWave
or ModPlug Tracker
to name a few.
那为什么不ffmpeg
呢?我使用了错误的编解码器或参数吗?我从游戏中获取了一个原始声音文件,并执行了以下操作:
So why not ffmpeg
? Am I using the wrong codec or params? I took an original sound file from the game and performed the following:
ffmpeg -i "orig_thrmlpu2.wav" -f wav -acodec pcm_s16le -ar 22050 -ac 1 "ffmpeg_thrmlpu2.wav"
ffmpeg
版本不能在游戏中玩. ffprobe
表明ffmpeg
版本具有一些Metadata
,而original
没有.我应该使用什么参数来尝试获得与原始格式相同的WAV
格式?请注意,-ar
,-ac
和bits
不是重要部分.
The ffmpeg
version does not play in the game. ffprobe
shows that the ffmpeg
version has some Metadata
which the original
doesn't have. What params should I use to try and get the same WAV
format as the original? Mind you, -ar
, -ac
and bits
aren't the important parts.
以下是供您检查的文件: http://www.edwardleuf.org/Games/JK/thrmlpu2.zip
Here are the files for you to examine: http://www.edwardleuf.org/Games/JK/thrmlpu2.zip
推荐答案
FFMpeg默认在WAV输出中添加一个LIST-INFO块.添加-bitexact
会禁止它.
FFMpeg by default is adding a LIST-INFO chunk to the WAV output. Adding -bitexact
suppresses it.
所以
ffmpeg -i "orig.wav" -f wav -bitexact -acodec pcm_s16le -ar 22050 -ac 1 "ffmpeg.wav"
这篇关于ffmpeg-制作干净的WAV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!