"Unknown encoder libx264" on Windows

I'm testing ClipBucket on a Windows XP system, and ClipBucket (open source video share) uses FFmpeg to convert videos. The final command it executes is (i changed it a little to make it compatible with the current FFmpeg):

D:\ffmpeg-snapshot-git\ffmpeg\ffmpeg.exe -i C:
\wamp\www\cb/files/conversion_queue/1352973741c353c.mp4 -f flv -vcodec libx2
64 -pre normal -r 25 -s 426x240 -aspect 1.775 -vf "pad=10:20:30:40:yellow"  -ac
odec libfaac -ab 128000 -ar 22050 C:\wamp\www\cb/files/videos/13540939451e18
4.flv 2> C:\wamp\www\cb/files/temp/13540939461c124.tmp 2>&1

And this is the response I get:

ffmpeg version 1.0.git Copyright (c) 2000-2012 the FFmpeg developers
built on Nov 19 2012 16:42:42 with gcc 4.6.2 (GCC)
configuration:
libavutil      52.  8.100 / 52.  8.100
libavcodec     54. 73.100 / 54. 73.100
libavformat    54. 37.100 / 54. 37.100
libavdevice    54.  3.100 / 54.  3.100
libavfilter     3. 23.101 /  3. 23.101
libswscale      2.  1.102 /  2.  1.102
libswresample   0. 16.100 /  0. 16.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\wamp\www\cb/files/conversion_que
ue/1352973741c353c.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf53.21.0
Duration: 00:00:51.67, start: 0.000000, bitrate: 344 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 426x240 [
SAR 1:1 DAR 71:40], 308 kb/s, 15 fps, 15 tbr, 15 tbn, 30 tbc
Metadata:
handler_name    : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 31
kb/s
Metadata:
handler_name    : SoundHandler
Unknown encoder 'libx264'

How can I get this libx264 working in Windows?


Solution 1:

Your ffmpeg has not been configured with --enable-gpl and --enable-libx264 which are required to support encoding H.264 video via libx264.

You can compile, but the easiest solution is to download an already compiled binary/.exe from gyan.dev or BtbN. Both include libx264 support.

Linux and macOS users can refer to the FFmpeg Download page for links to binaries/executables for those systems.

Also see FFmpeg Wiki: H.264.