当我尝试将 mp4 转换为 webm 时出现错误:
Encoder (codec vp8) not found for output stream #0:0
谷歌搜索告诉我,我需要安装 libvpx,但我已经安装了。
其余内容如下:
Logans-MacBook-Pro:desktop loganmccoy$ ffmpeg -i video.mp4 -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 myvideo.webm
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : M4V
minor_version : 1
compatible_brands: M4V mp42isom
creation_time : 2015-09-21 06:30:12
Duration: 00:00:10.58, start: 0.000000, bitrate: 1264 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 1253 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2015-09-21 06:30:12
handler_name : Mainconcept MP4 Video Media Handler
encoder : AVC Coding
File 'myvideo.webm' already exists. Overwrite ? [y/N] y
Output #0, webm, to 'myvideo.webm':
Metadata:
major_brand : M4V
minor_version : 1
compatible_brands: M4V mp42isom
Stream #0:0(eng): Video: vp8, none, q=2-31, 128 kb/s (default)
Metadata:
creation_time : 2015-09-21 06:30:12
handler_name : Mainconcept MP4 Video Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> ? (?))
Encoder (codec vp8) not found for output stream #0:0
有任何想法吗?
答案1
您可能已经安装了 libvpx,但是您的ffmpeg
构建缺少--enable-libvpx
(和--enable-libvorbis
或--enable-libopus
),因此尚未配置为支持它。
你可以编译ffmpeg
,但最简单的方法就是下载静态构建ffmpeg
:它有 libvpx 支持。