error Unknown decoder 'libx264'


New Member
Hi can anyone give me advise . I have issue on ffmpeg script . Hope anyone can solve for me .Thank

my script video and audio together

run on iizukanao/node-rtsp-rtmp-server

sudo ffmpeg -f v4l2 -video_size 640x480 -framerate 30 -i /dev/video0 -c:v libx264 -crf 23 -tune zerolatency -preset ultrafast -f alsa -channels 2 -sample_rate 44100 -i hw:1,0 -c:a aac -strict experimental -vn -flags +global_header -map a:0 -f segment -segment_time 3600 -segment_atclocktime 1 \ -strftime 1 -reset_timestamps 1 /media/AV_%Y%m%d_%H%M%S.mp4

Unknown decoder 'libx264'


Well-Known Member
There are two possibilities that I can think of:
1. You do not have libx264 installed - in which case you'd need to install it.
You haven't said which distro you're using, so it's difficult to give precise instructions, but you'll need to check your package manager lists to find the correct package and check it is installed.
In Debian based distro's, it's called libx264. In other distros, it might be called x264, or something similar.

Either way, find out the exact name of the x264 package for your distro and ensure it is definitely installed.
Once you have the codec installed, try ffmpg again to see if it works.

OR - if the above steps do not fix the problem:
2. Your version of ffmpg does not have x264 support built in - which would mean that you'd need to download the source-code and dependencies for ffmpg and configure the build to re-enable support for the x264 codec, before building and installing from source.
However, I'm pretty certain that x264 should be enabled in most distro's builds, because x264 is an open source video codec.

The way to check whether x264 is enabled would be to run the following command:
ffmpg -codecs
That will display a full list of codecs supported by the version of ffmpg you currently have installed.

If you have libx264 installed and ffmpg does not show x264 in the list of supported codecs, then it means that the package maintainers for your distro disabled x264 support and you will have to build and install ffmpg from source in order to be able to re-enable x264 support. (Again, seems unlikely that x264 would be disabled in the build because x264 is an open source codec!)

And the instructions for building ffmpg from source may vary slightly depending on which Linux distro you are running, because you will need to download the source package for ffmpg plus all of it's build dependencies. And if you've never built anything from source, you will also need to install a bunch of additional tools to facilitate the build. So exact instructions will depend on which distro you're running.


Well-Known Member
What would happen if you used a static version of ffmpeg by John Van Sickle - these are static builds and no dependencies.
simply choose the right download tarxz file and extract copy ffmpeg and ffprobe to /usr/bin have used with great results when running Puppy.
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online