【问题标题】:Encode video using ffmpeg and vp8 codec on Native Client在 Native Client 上使用 ffmpeg 和 vp8 编解码器对视频进行编码
【发布时间】:2015-10-27 16:18:38
【问题描述】:

我正在尝试使用 Native Client 开发视频编码器。 我希望输出文件为 .webm,并且我使用的是 ffmpeg 示例“muxing.c”。

当我运行示例时,我收到错误消息:找不到“vp8”的编码器

错误来自这里:

*codec = avcodec_find_encoder(codec_id);
if (!(*codec)) {
    fprintf(stderr, "Could not find encoder for '%s'\n",
            avcodec_get_name(codec_id));
}

其中codec_id 的值为AV_CODEC_ID_VP8

当我将输出文件设置为 .mp4 时,它可以工作。

谁能帮帮我。 我需要为 ffmpeg naclport 启用 vp8 编码器吗? 我该怎么办?

谢谢!!

更新

@李基走了:

是的。您必须需要使用 libvpx 库编译 ffmpeg 才能进行编码 VP8/VP9。你可以通过 yum, apt 安装它。或者你可以编译它 手动。

安装 libvpx 后,在下面安装带有 libvpx 的 ffmpeg 命令:

./configure --enable-libvpx 
make -j 4
make install

我将 libvpx 的依赖项放在 build.sh 上,将 pkg_info 放在 ffmpeg naclport 上并再次构建它。现在可以了!

【问题讨论】:

  • 嗨 Victor,我很想看看你得到的结果,我想开发一个屏幕录像机,用 chrome 从桌面制作视频,然后将视频上传到 youtube。我不知道它是怎么做的。我希望你能提供一些示例代码,看看你是怎么做的

标签: ffmpeg google-nativeclient


【解决方案1】:

是的。您必须使用 libvpx 库编译 ffmpeg 才能对 vp8/vp9 进行编码。你可以通过 yum, apt 安装它。也可以手动编译。

安装 libvpx 后,使用以下命令安装 ffmpeg 和 libvpx:

./configure --enable-libvpx
make -j 4
make install

【讨论】:

  • 因为我在 nacl 中使用了 ffmpeg,所以我不得不以其他方式进行操作。我刚刚在 build.sh 和 pkg_info 上添加了 libvpx 的依赖项,并再次构建了 ffmpeg naclport。谢谢!
猜你喜欢
  • 2017-12-04
  • 1970-01-01
  • 1970-01-01
  • 2018-06-06
  • 2020-09-24
  • 2013-12-26
  • 2014-05-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多