【发布时间】:2014-02-27 23:06:12
【问题描述】:
我尝试使用 FFMpeg 生成 MKV 视频格式。默认情况下,FFMpeg 将使用 h264 和 libvorbis。但是当我使用ffmpeg源文件夹下的doc/examples/muxing.c时,总是报错:
[libvorbis @ 002e52a0] Specified sample format s16 is invalid or not supported
Could not open audio codec: Error number -22 occurred
我使用Zeranoe FFmpeg 并显示此错误。我还尝试在 MinGW 下从源代码编译 ffmpeg,并通过以下配置启用 libvorbis:
$ ./configure --prefix=/mingw --enable-libvpx --enable-libvorbis --enable-shared --enable-static
在make之前,我也安装了libvorbis、libogg、yasm等,但是错误依旧存在。
如果我使用 ffmpeg.exe 将视频转换为 webm 格式,它可以工作。命令如下:
ffmpeg -i test.h264 -vcodec libvpx -acodec libvorbis output.webm
生成的 output.webm 可以用 Firefox 或其他东西播放。所以我认为编译好的ffmpeg库是可以的。但是为什么我在 muxing.c 代码中不能生成 webm 文件呢?
【问题讨论】:
标签: ffmpeg