ffmpeg 无法打开使用 Audacity 导出的简单 Microsoft wav 文件

标签 ffmpeg audacity

我已使用 Audacity 将声音文件导出到 microsoft wav。 我正在尝试使用 ffmpeg 打开此文件:

ffmpeg -i steps-stereo-16b-44khz.wav /tmp/test.ogg

这是我得到的输出:

fmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 12 2013 13:46:11 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[dca @ 0x7fd30c013600] Not a valid DCA frame

... SNIP ...

[dca @ 0x7fd5bc013600] Invalid bit allocation index
[dca @ 0x7fd5bc013600] error decoding block
    Last message repeated 3 times
[dca @ 0x7fd5bc013600] Didn't get subframe DSYNC
[dca @ 0x7fd5bc013600] error decoding block
[wav @ 0x7fd5bc013000] max_analyze_duration 5000000 reached at 5009070 microseconds
[wav @ 0x7fd5bc013000] decoding for stream 0 failed
[wav @ 0x7fd5bc013000] Could not find codec parameters for stream 0 (Audio: dts ([1][0][0][0] / 0x0001), 192000 Hz, 2 channels, fltp, 0 kb/s): no decodable DTS frames
Consider increasing the value for the 'analyzeduration' and 'probesize' options
steps-stereo-16b-44khz.wav: could not find codec parameters

如果我将相同的文件导出为 .ogg 或 .aiff,没问题,以下工作正常:

ffmpeg -i steps-stereo-16b-44khz.aiff /tmp/test.ogg

知道可能出了什么问题吗?

指向我的 wav file 的链接所以你可以尝试重现。

注意我的最终目标是对音频文件进行切片。我知道我可以大胆地将文件直接导出到 .ogg。这只是一个测试用例。

编辑

使用其他程序(例如 sox)获取文件信息效果很好:

sox --info steps-stereo-16b-44khz.wav

Input File     : 'steps-stereo-16b-44khz.wav'
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:02.10 = 92608 samples = 157.497 CDDA sectors
File Size      : 370k
Bit Rate       : 1.41M
Sample Encoding: 16-bit Signed Integer PCM

最佳答案

您可以通过一些额外的输入选项让 ffmpeg 识别它:

ffmpeg -acodec pcm_s16le -i steps-stereo-16b-44khz.wav output.ogg

这是 ffmpeg 中的一个错误,ticket #2810: unsupported wav ,即has been fixed不久以前。您可以compile ffmpeg或获取 recent build利用修复程序。

请注意,对于 ogg 输出,默认编码器是 flac,因此您可能需要添加 -codec:a libvorbis 作为输出选项。

关于ffmpeg 无法打开使用 Audacity 导出的简单 Microsoft wav 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17809407/

相关文章:

ffmpeg - 需要帮助解决我的 ffmpeg 命令行

ffmpeg - 使用 ffmpeg 覆盖图像无限期地运行脚本

python - 为什么 librosa 图与 matplotlib 和 audacity 不同

audio - 批量MP3噪音消除

audio - 如何获取 .wav 文件的特定频率和时间值并将值导出为 .csv

php - 使用 FFmpeg 进行视频旋转

python - 服务器 (PC) 上的实时视频流来自机器人通过 UDP 发送的图像

ffmpeg - MPEG-DASH - 多路表示问题

c - 镜像音频帧