FFmpeg "Unknown encoder 'libx264'": causes and fixes
Fix FFmpeg "Unknown encoder" errors for libx264, libx265, libfdk_aac, h264 and nvenc: encoder vs codec names and FFmpeg builds without the library.
What it looks like in your log
Unknown encoder 'libx264'Why does FFmpeg say Unknown encoder?
FFmpeg encoders have exact names (libx264, libx265, h264_nvenc, aac) that differ from codec names (h264, hevc). The error also appears when your FFmpeg build was compiled without that library: many distro and minimal builds omit libx264/libx265, and libfdk_aac is never included in public builds for licensing reasons.
How to fix it
- Run "ffmpeg -hide_banner -encoders" to see the encoders your build has.
- Use the encoder name, not the codec name: -c:v libx264 (not h264), -c:v libx265 (not hevc).
- Replace libfdk_aac with the built-in aac encoder.
- On Windows use a full build (gyan.dev "full" or BtbN); on Linux install ffmpeg from a full repository or a static build.
- For hardware encoding use h264_nvenc / hevc_nvenc (NVIDIA), h264_qsv (Intel) or h264_amf (AMD).
Not sure this is your problem?
Upload your OBS log and StreamRx will tell you exactly what is wrong in 60 seconds, free.
Diagnose my log📬 The StreamRx newsletter
One short email with OBS fixes, settings for Twitch/YouTube/Kick, and new StreamRx features. Unsubscribe anytime with one click.
No spam. Every email has an unsubscribe link, or reply "unsubscribe" to [email protected].