LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-26-2020, 04:20 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
ffmpeg Unknown encoder 'libx264'


In addition to my recent ffmpeg post (https://www.linuxquestions.org/quest...75#post6138275) I have another issue. I've tried:
Code:
ffmpeg -f image2  -r 1/5 -pattern_type glob -i './*.[jJ]*' -c:v libx264 -pix_fmt yuv420p out.mp4

Unknown encoder 'libx264'
I've downloaded and installed package x264 from SlackBuilds (via sbopkg), and re-installed package ffmpeg from SlackBuild. libx264 is in:
Code:
-rwxr-xr-x 1 root root 1019528 Jun 26 16:33 /usr/lib64/libx264.so.148
lrwxrwxrwx 1 root root 14 Jun 26 16:33 /usr/lib64/libx264.so -> libx264.so.148
So, why is ffmpeg giving me this error?
 
Old 06-26-2020, 04:23 PM   #2
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,499

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by mfoley View Post
In addition to my recent ffmpeg post (https://www.linuxquestions.org/quest...75#post6138275) I have another issue. I've tried:
Code:
ffmpeg -f image2  -r 1/5 -pattern_type glob -i './*.[jJ]*' -c:v libx264 -pix_fmt yuv420p out.mp4

Unknown encoder 'libx264'
I've downloaded and installed package x264 from SlackBuilds (via sbopkg), and re-installed package ffmpeg from SlackBuild. libx264 is in:
Code:
-rwxr-xr-x 1 root root 1019528 Jun 26 16:33 /usr/lib64/libx264.so.148
lrwxrwxrwx 1 root root 14 Jun 26 16:33 /usr/lib64/libx264.so -> libx264.so.148
So, why is ffmpeg giving me this error?
Because of the greedy Hollywood barons.

It is not legal to ship some particular codecs unless you pay royally for them, and that happens specially and particularly in USA.
 
Old 06-26-2020, 04:47 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
ffmpeg has to have x264 support compiled in. It usually does.
Code:
ffmpeg -codecs
...
 DEV.L. h263p                H.263+ / H.263-1998 / H.263 version 2
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_qsv h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )
 D.VIL. hap                  Vidvox Hap
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid ) (encoders: libx265 nvenc_hevc hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi )
...
Also when you launch ffmpeg
Code:
ffmpeg
ffmpeg version n4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265....
 
1 members found this post helpful.
Old 06-26-2020, 04:51 PM   #4
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,499

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
The Slackware does not ships H264 encoders, only H264 decoders. Because of reasons.
 
1 members found this post helpful.
Old 06-26-2020, 04:56 PM   #5
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by mfoley View Post
I've downloaded and installed package x264 from SlackBuilds (via sbopkg), and re-installed package ffmpeg from SlackBuild. So, why is ffmpeg giving me this error?
Did you pass X264=yes to the script before building? For whatever reason, the ffmpeg build doesn't auto-detect these optional deps.
 
1 members found this post helpful.
Old 06-26-2020, 05:01 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Did you enable x264 when compiling ffmpeg? It doesn't autodetect things, so you're forced to pass flags to enable/disable certain features. Per the README, x264 encoder support requires passing X264=yes to the SlackBuild (and installing x264).

You can check your available encoders by running ffmpeg -encoders and if the output is a bit overwhelming, you can pipe the info and grep for 264 (ffmpeg -encoders | grep 264)

EDIT: drgibbon beat me to it.
 
1 members found this post helpful.
Old 06-26-2020, 05:14 PM   #7
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by bassmadrigal View Post
EDIT: drgibbon beat me to it.
Haha sorry, it seems I keep doing that
 
Old 06-26-2020, 07:18 PM   #8
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Output to ffmpeg -encoders | grep 264:
Code:
ffmpeg -encoders | grep 264
ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-3.2.4/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-version3 --enable-avresample --arch=x86_64 --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libcaca --enable-libcdio --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-libwavpack --enable-x11grab
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
It certainly seems to list h364, but I still get that error. Meanwhile, I'll try building with X264=yes and see what happens.
 
1 members found this post helpful.
Old 06-26-2020, 10:13 PM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
You don't have libx264 as an encoder option. Compare your output to mine:

Code:
jbhansen@craven-moorhead:~$ ffmpeg -encoders | grep 264
ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-3.2.4/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-version3 --enable-avresample --arch=x86_64 --enable-nonfree --enable-libschroedinger --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libass --enable-libcaca --enable-libcdio --enable-libdc1394 --enable-frei0r --enable-libgme --enable-libiec61883 --enable-libilbc --enable-openal --enable-libopus --enable-librtmp --enable-libsnappy --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-openssl --enable-libwavpack --enable-x11grab
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
 V..... libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V..... libx264rgb           libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
 
2 members found this post helpful.
Old 07-02-2020, 01:27 PM   #10
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Thanks all for the feedback. At the moment, I'm not that into this project enough to modify builds, etc. I'm going to move on and not deal with this one further.
 
Old 07-02-2020, 02:33 PM   #11
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
All good. If anyone has this problem on the latest Slack you can fix it like this (assuming you installed x264 already):
Code:
rsync -avz rsync://mirrors.kernel.org/slackware/slackware-current/source/l/ffmpeg .
cd ffmpeg
su
X264=yes sh ./mirror/ffmpeg.SlackBuild
And then upgradepkg on the output (check the SlackBuild for other compile time environment vars, I really don't know why ffmpeg can't autodetect that stuff though ).

Alternatively slackpkg+ and alienbob's restricted ffmpeg would be an easier method in the long run.

Last edited by drgibbon; 07-02-2020 at 03:55 PM.
 
Old 07-02-2020, 03:39 PM   #12
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by drgibbon View Post
I really don't know why ffmpeg can't autodetect that stuff though ).
This has been a major head scratcher for me too. I've been thinking about tweaking the SlackBuild script to add in autodetection and then submit it to the maintainer, but it's been low on my priority list.

Quote:
Originally Posted by drgibbon View Post
Alternatively slackpkg+ and alienbob's unrestricted ffmpeg would be an easier method in the long run.
Just to clarify, you'd want the "restricted" ffmpeg that Alien Bob offers, as that includes support for various things that have patent restrictions (like x264 encoding).

https://bear.alienbase.nl/mirrors/pe...builds/ffmpeg/
 
Old 07-02-2020, 03:55 PM   #13
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Oops, yes, "restricted"
 
Old 06-02-2021, 01:17 AM   #14
Weber Kai
Member
 
Registered: Jun 2009
Location: Brasília, Brazil
Distribution: Slackware64 14.2
Posts: 38

Rep: Reputation: 24
Sorry for necroposting, but I've made an improvement on this script to auto detect some libraries.
It's not complete, but maybe we could finish this list and send to the maintainer. The missing parts are marked with a #TODO comment
The following lines can be added just before the comments I've kept at the end.

Code:
LAME=$(/sbin/ldconfig -p | grep libmp3lame\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
X264=$(/sbin/ldconfig -p | grep libx264\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
CELT=$(/sbin/ldconfig -p | grep libcelt0\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
DC1394=$(/sbin/ldconfig -p | grep libdc1394\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
#TODO FREI0R libfrei0r
GSM=$(/sbin/ldconfig -p | grep libgsm\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
RTMP=$(/sbin/ldconfig -p | grep librtmp\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
SCHROEDINGER=$(/sbin/ldconfig -p | grep libschroedinger-1.0\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
SPEEX=$(/sbin/ldconfig -p | grep libspeex\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
XVID=$(/sbin/ldconfig -p | grep libxvidcore\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
BLURAY=$(/sbin/ldconfig -p | grep libbluray\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
ASS=$(/sbin/ldconfig -p | grep libass\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
OPENAL=$(/sbin/ldconfig -p | grep libopenal\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
IEC61883=$(/sbin/ldconfig -p | grep libiec61883\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
ILBC=$(/sbin/ldconfig -p | grep libilbc\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
MODPLUG=$(/sbin/ldconfig -p | grep libmodplug\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
OPUS=$(/sbin/ldconfig -p | grep libopus\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
TWOLAME=$(/sbin/ldconfig -p | grep libtwolame\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
#TODO LADSPA ladspa
#TODO FLITE libflite
VIDSTAB=$(/sbin/ldconfig -p | grep libvidstab\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
X265=$(/sbin/ldconfig -p | grep libx265\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
ZVBI=$(/sbin/ldconfig -p | grep libzvbi\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
#TODO OPENCV libopencv
#TODO GME libgme
SNAPPY=$(/sbin/ldconfig -p | grep libsnappy\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
WEBP=$(/sbin/ldconfig -p | grep libwebp\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
#TODO ZMQ libzmq
#TODO BS2B libbs2b
#TODO EBUR128 libebur128
RUBBERBAND=$(/sbin/ldconfig -p | grep librubberband\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
#TODO TESSERACT tesseract
#TODO NETCDF netcdf
CHROMAPRINT=$(/sbin/ldconfig -p | grep libchromaprint\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
OPENCORE=$(/sbin/ldconfig -p | grep libopencore-amrnb\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
FDK_AAC=$(/sbin/ldconfig -p | grep libfdk-aac\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
OPENSSL=$(/sbin/ldconfig -p | grep libssl\.so\  | grep /usr/lib${LIBDIRSUFFIX}/ | grep . >> /dev/null && echo yes)
#TODO DECKLINK decklink

# You can enable a lot of optional (not-autodetected) features by
# passing variables to the script (VAR=yes/no ./ffmpeg.SlackBuild).
# Unfortunately ffmpeg's configure doesn't support --enable-feature=yes
# syntax, so we have to do it the complicated way :/
# Additional optional (autodetected) dependencies are:
# - jack
# - libva
# - libvdpau
# - libX11
# - libxcb
# - sdl2
# - xz
# - zlib
 
Old 06-02-2021, 02:35 AM   #15
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by Weber Kai View Post
Sorry for necroposting, but I've made an improvement on this script to auto detect some libraries.
It's not complete, but maybe we could finish this list and send to the maintainer. The missing parts are marked with a #TODO comment
See this post for some other ideas (using pkg-config).
 
1 members found this post helpful.
  


Reply

Tags
ffmpeg, x264



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ffmpeg: Unknown encoder 'libmp3lame' maschelsea Linux - Software 13 01-30-2017 02:36 AM
LINUX UBUNTU PHP FFMPEG INSTALLED BUT libx264 while installing ERROR??? trinay123 Ubuntu 2 03-13-2010 10:22 AM
slack13_64 - FFMPEG's "libx264 not found" error erickFis Slackware 24 11-14-2009 08:12 PM
[FFMPEG] Error with libx264 not found nikhil010586 Linux - Software 11 09-23-2009 03:48 AM
dependency issue: libx264.so.54 needed by ffmpeg PhilTR Fedora 22 01-23-2007 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration