7

I’m having an issue with FFmpeg after configuring it exactly to their own wiki’s instructions where I’m receiving the following:

ffmpeg -stats -i uncompressed.video.mkv -codec x264 -preset veryslow -pass 2 -an compressed.video.mkv
[Removed for readability]
Unknown encoder 'x264'

Attempting the same with libx264 instead of x264 results in a similar error:

Invalid encoder type 'libx264'

So I ran:

~$ ffmpeg -codecs | grep x264

And got:

ffmpeg version 2.6.git Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/home/hindenpeter/ffmpeg_build --extra-cflags="-I/home/hindenpeter/ffmpeg_build/include --extra-ldflags=-L/home/hindenpeter/ffmpeg_build/lib --bindir=/home/hindenpeter/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 29.100 / 56. 29.100
  libavformat    56. 26.101 / 56. 26.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 13.101 /  5. 13.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (encoders: libx264 libx264rgb )

As far as I can tell, ffmpeg was configured with --enable-libx264, and a simple ls of ~/bin reveals that I did in fact install it from source as outlined in the guide I linked above.

So can anyone help me figure out exactly what I did wrong, and how I can fix it?

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
HindenPeter
  • 90
  • 1
  • 1
  • 5
  • Please show the actual command and the complete console output from your command where you tried libx264. – llogan Mar 24 '15 at 00:57

2 Answers2

6

Try this:

ffmpeg -stats -i uncompressed.video.mkv -vcodec libx264 -preset veryslow -pass 2 -an compressed.video.mk

or this:

ffmpeg -stats -i uncompressed.video.mkv -codec:v libx264 -preset veryslow -pass 2 -an compressed.video.mk
Brian
  • 461
  • 4
  • 3
  • 1
    `-codec:v` seems to have worked, thanks very much. Also, I should note that I had to add `-crf 20` and remove `-pass 2` to get a constant quality, which is apparently not compatible with 2-pass. – HindenPeter Mar 25 '15 at 04:54
1

Rather than configuring with --enable-libx264, you will have to configure with --enable-gpl

SJP
  • 11
  • 1
  • 2
    Other than the fact that this is not the issue, the OP's build is configured with both GPL and libx264. – Gyan Jan 11 '17 at 13:04