i am a newbie to ffmpeg and am using it on Windows. I tried to convert an avi file using the H.264 vcodec (h264). Got this error: Unknown encoder 'h264'. The 'Unknown encoder开发者_StackOverflow' error also showed up for mp3 for -acodec usage.
Can anyone please help me out with this?
A few things:
- Run the command
ffmpeg -codecs
to list the codecs your ffmpeg build supports. h264
andmp3
are compression standards, but do not really identify a specific encoder. The H.264 encoder that ffmpeg uses is x264 and you will either have to usex264
orlibx264
in your command line depending on what is listed in #1. The mp3 encoder is lame and usually is identified by something likelibmp3lame
.- You must have a version of ffmpeg that is built with support for these libraries since they are not directly part of ffmpeg. If these codecs are not listed in
ffmpeg -codecs
you need to create or find a build that supports them.
Install x264
and add run ./configure
in ffmpeg's directory, using these flags:
--enable-gpl
--enable-shared
--enable-libx264
--extra-cflags="-I/path/to/include"
--extra-ldflags="-L/path/to/lib"
where -I/path/to/include
is likely -I/usr/local/include
and -L/path/to/lib
is likely -L/usr/local/lib
.
Make sure you have enabled the 'h264' encoder while configuring the FFmpeg. 'h264' encoders comes under GPL.
Info on building ffmpeg with libx264:
https://trac.ffmpeg.org/wiki/How%20to%20quickly%20compile%20FFmpeg%20with%20libx264%20(x264,%20H.264)
精彩评论