【问题标题】:FFMpeg Can't find libvorbis under WindowsFFMpeg 在 Windows 下找不到 libvorbis
【发布时间】: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


    【解决方案1】:

    从文件 libvorbisenc.c 中可以看出,libvorbis 库仅支持 AV_SAMPLE_FMT_FLTPfloat plane 数据)输入格式。

    例如,您必须使用来自 ffmpeg 的 SwResample 库来转换音频数据。

    【讨论】:

      【解决方案2】:

      尝试使用以下代码编译 libvorbis 包:

      LDFLAGS="-static" \
      LIBS="-logg" \
      ./configure \
      --prefix=$INSTALL_PREFIX \
      --with-gnu-ld \
      --with-pic \
      --enable-static \
      --disable-shared \
      --disable-oggtest
      

      【讨论】:

        猜你喜欢
        • 2013-10-27
        • 2017-06-11
        • 1970-01-01
        • 2014-02-13
        • 2014-09-20
        • 1970-01-01
        • 2021-02-13
        • 2022-08-23
        • 2014-09-11
        相关资源
        最近更新 更多