When I try to make a new video with ffmpeg using this command

ffmpeg  -f image2 -pattern_type glob -framerate 12 -crf 10 -vcodec libx265  -i *.jpg  output.mp4

I get this error message

Unknown decoder 'libx265'

It's the same if I try libx264 instead. The video type (.avi .mp4 .mkv etc) doesn't nake any difference, as far as I can tell.

But if I try to convert an existing video with this command

ffmpeg -i ovr-p1-2021-02.mkv -vcodec libx265 -crf 28 output.mp4

it works just fine, even though I specify the same libx265 codec.

I have Ubuntu Mate 20.04 64bit and ffmpeg version 4.2.4-1ubuntu0.1. I installed ffmpeg wuth sudo apt install ffmpeg libx265-dev libnuma-dev and got no errors.

Here's the full output from the first command

    bjorn@bjorn-HP-EliteBook-8460p:/mnt/nas/ttt/2021/$ ffmpeg  -f image2 -pattern_type glob -framerate 12 -crf 10 -vcodec libx265  -i *.jpg  output.mp4
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Unknown decoder 'libx265'

The order of the options in an ffmpeg command matter. Your options currently apply to the input files, which are jpg graphics. Try changing the order of the options so options related to the output file come after the input file:

ffmpeg -f image2 -pattern_type glob -framerate 12 -i *.jpg -vcodec libx265 -crf 10 output.mp4
  • Thanks, vanadium! That was it. I also had to put quotes around the input pattern, like this ffmpeg -f image2 -pattern_type glob -framerate 12 -i "*.jpg" -vcodec libx265 -crf 10 output.mp4 Without the quotes, ffmpeg wanted to overwrite the input files. – Bambino Mar 6 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.