ffmpeg - 如何使用 ffmpeg 对 H.264 中的视频进行编码?

标签 ffmpeg h.264

我已经从 https://github.com/FFmpeg/FFmpeg 安装了 ffmpeg 3.0 ,我正在尝试将使用 mepeg4 第 2 部分编码的视频转换为 H264,但我得到了 Unknown encoder 'libx264' 错误

这是我的命令:(我尝试了 h264、x264、libx264,但都没有工作)

ffmpeg -i Fashion.divx -acodec aac -vcodec libx264  out.mp4

我检查了支持的编解码器列表
Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...I.. = Intra frame-only codec
 ....L. = Lossy compression
 .....S = Lossless compression
 -------
 D.VI.. 012v                 Uncompressed 4:2:2 10-bit

这是h264:
 D.V.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_vdpau)

我正在使用 ffmpeg 3.0,从该列表中,似乎不支持使用 h264 编码,仅支持解码 h264,对吗?

我尝试使用本指南启用 h.264
How to quickly compile FFmpeg with libx264 (x264, H.264)
./configure --enable-gpl --enable-libx264

我明白了
./configure --enable-gpl --enable-libx264
ERROR: libx264 not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

我应该怎么做才能使 h.264 中的编码视频工作?

最佳答案

好的,我刚发现需要单独安装libx264,命令如下

sudo apt-get install yasm libvpx. libx264.

确实在安装libx264之后,我得到了
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_vdpau ) (encoders: libx264 libx264rgb )

关于ffmpeg - 如何使用 ffmpeg 对 H.264 中的视频进行编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37066553/

相关文章:

macos - 在 Tiger 上编译 ffmpeg 并使用气体预处理器?

php - 具有 libx264 的 ffmpeg 支持的自定义 Heroku Buildpack

audio - 通过处理样本来编辑mp4

ffmpeg - 如何在另一个视频上叠加一个视频并淡入 PNG

parallel-processing - ffmpeg 和 gnu 并行

powershell - 将 FFMPEG 与 Powershell 一起使用

ffmpeg - RTP Stream 显示灰色背景然后崩溃

ffmpeg - 修剪 H264 视频并在 MP4 中换行,无需重新编码

ffmpeg - pyav/Libav/ffmpeg 禁用 B 帧

android - 实时/零延迟视频流 : what codec parameters to use?