5

I'm trying to re-encode a video into H.264 with ffmpeg. I'm using Ubuntu Studio 17.10. I also installed libavcodec-extra, libav-tools was already installed, I installed ubuntu-restricted-extras. ffmpeg is compiled with libx264 enabled:

$ ffmpeg -c:v libx264 -preset slow -crf 22 -c:a copy -i tmpoHcVBN.mp4 output.mp4
ffmpeg version 3.3.3-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.2.0-8ubuntu2)
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-netcdf
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Unknown decoder 'libx264'

This is the package provided ffmpeg, I have not compiled one on my own because seemingly this one was also compiled with --enable-libx264. I'm stuck.

Csaba Toth
  • 1,313
  • 4
  • 17
  • 29
  • The most recent release version from this site is 3.4.2 and I tested the 64bit version without issue. It would be helpful if you gave the full commandline and also the uncut complete terminal output? – andrew.46 Mar 12 '18 at 07:49
  • The full command was right there, but I edited the whole shebang and it's one block now. Maybe it's that "WARNING: library configuration mismatch" – Csaba Toth Mar 12 '18 at 17:30

1 Answers1

8

Option order matters:

ffmpeg [input options] -i input [output options] output

You're attempting to apply your encoding options to the input. Change your command to:

ffmpeg -i tmpoHcVBN.mp4 -c:v libx264 -preset slow -crf 22 -c:a copy output.mp4

Note sure how you got the WARNING: library configuration mismatch message, but it shouldn't show up when using a build from johnvansickle.com.

llogan
  • 11,518
  • 43
  • 54
  • Haha, no way! You are right. What happened is that I assemble the command line dynamically and invoke this from Python. Due to the dynamic nature I ordered the input and output towards the end. This is really great, I don't have to recompile ffmpeg on the server – Csaba Toth Mar 12 '18 at 20:47