LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [FFMPEG] Error with libx264 not found (https://www.linuxquestions.org/questions/linux-software-2/%5Bffmpeg%5D-error-with-libx264-not-found-755915/)

nikhil010586 09-17-2009 09:17 AM

[FFMPEG] Error with libx264 not found
 
Hi,

I'm trying to add libx264 support to my already existing ffmpeg installation. However, installer just can't see the installed libx264 on my server machine. Here's what I've done so far:

Installed libx264 from Videolan's git repo with --enable-shared . I have it installed under /usr/local/lib .

I try running

Code:

./configure --enable-shared --enable-gpl --enable-libmp3lame --enable-libamr-nb --enable-libfaac --enable-libfaad --enable-nonfree --enable-libx264
And I can see
Code:

ERROR: libx264 not found
If you think configure made a mistake, make sure you are using the latest
version from SVN.  If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

I have already run ldconfig and can locate the library in my path using locate libx264.so . So I know it's there, in place.

I have searched through a lot of forums but could not find a solution.

knudfl 09-18-2009 06:40 AM

Which Fedora ? ? Or CentOS ?

I guess, that the command : 'env | grep PATH'
shows no path /usr/local/lib

And also /etc/ld.so.conf + /etc/ld.so.conf.d/ ..
... No path /usr/local/lib ?

So you will either have to include /usr/local/lib in
your LD_LIBRARY_PATH or install x264 to ' --prefix=/usr '

Or you can do # yum install x264-devel
.. 'x264-devel' is in the rpmfusion.repo :
http://rpmfusion.org/Configuration
.....

Shadow_7 09-19-2009 09:08 AM

$ find / -iname '*libx264*'

or

$ ls /usr/lib/libx264*

should be a .a, .so, and a .so.67 (or whatever version you have). If you don't have it, visit videolan.org and get it. Or use your distro's installer (yum?). Also note that ffmpeg can be quite picky about having multiple versions of libx264 (and other libs) laying about. So you might need to remove / move those other versions. Also check for /usr/local/lib/libx264* as you might have stuff over there too. One of the perils of installing from source on top of distro packages, and otherwise using multiple repositories for ones goals.

Basically did you install it? By source? Or by distro package? Note that by source that libx264 does NOT default to --enable-shared. You have to tell libx264 --enable-shared in order for --enable-shared to be an option with ffmpeg. I mention it here, because your distro might not have packaged it that way. Which could account for your issues. It's more likely that you don't have it installed. libx264 is very beta-ish IMO. i.e. still a work in progress, so it might not be included by default in a lot of distros. Also from source, things default to /usr/local/ where distros tend to install to /usr/, you might need to override with --prefix=/usr in order for things to line up properly.

videolan.org
ffmpeg.mplayerhq.hu

HTH

Now that I reread, yes $PATH is most likely at fault. You seemed to have covered the other bases. The PATH environment variable doesn't default with /usr/local/ stuff. So either change $PATH, or don't install to /usr/local/, I normally choose the latter.

nikhil010586 09-22-2009 03:26 AM

Ok..I'm trying to install x64-devel from rpmfusion. But I'll still need this dependency to be independent of the distro. I have to try this out on a Debian system as well, so rpmfusion won't be much of a use there.

I'm using CentOS 5 and a Debian system. Regarding the libx64 installation, I can see /usr/local/lib/libx264.so.75 when I do a "locate libx264.so" . I believe that means I have my libx264 in place.

My /etc/ld.so.conf.d has one file which reads /usr/local/lib which also means my ldconfig paths are in place. I still cannot figure out the reason why ffmpeg cannot see an installed libx264 when locate and ldconfig can see it.

nikhil010586 09-22-2009 03:38 AM

I'm not relying upon yum at all. I need to have this running using the source compilations.
libx264, libmp3-lame and the other packages were perfectly installed using their source tarball archives.

Another bad experience with CentOS...sigh!

jschiwal 09-22-2009 05:16 AM

You did mention running ldconfig. Is /usr/local/lib/ in /etc/ld.so.conf?

Use "ldconfig -g | grep libx264" to check if the library can be found.

Also look at "ldd /usr/local/bin/ffmpeg" or "ldd $(which ffmpeg)"
This will show the libraries the program uses.
eg:
libx264.so.75 => /usr/lib64/libx264.so.75 (0x00007feec658e000)

If the /usr/lib/ location is hardwired, you could create a symbolic link in /usr/lib/ pointing to the library in /usr/local/lib/ and rerun "sudo /sbin/ldconfig".

H_TeXMeX_H 09-22-2009 05:23 AM

Best thing to do is always install things in '/usr/lib' especially dependencies. I've found that even if /usr/local/lib is in /etc/ld.so.conf some programs refuse to find the library there.

Shadow_7 09-22-2009 12:42 PM

echo $PATH

it's not going to look where it's not told to look. But I agree that if you're compiling from source always use --prefix=/usr to override the default. It's just easier to be able to remain relatively dumb on paths and the likes. And you can install your distro's version, then compile it from source and overwrite that version. This allows you to install packages that claim it as a dependency, with out actually having to know how to make a package that meets that dependency.

knudfl 09-23-2009 01:07 AM

Quote:

I can see
/usr/local/lib/libx264.so.75 when I do a "locate libx264.so" .

I believe that means I have my libx264 in place.
No, you cannot compile against 'libx264.so.75'.
'libx264.so' must be present as a link to 'libx264.so.75'.

Reason : Say, you have two or more versions libx264.so.XX.
Then it's your decision, which one to be used at runtime.
And the the '.so' link takes care that you link to the right one.
.....

nikhil010586 09-23-2009 02:02 AM

I reinstalled libx264 with --enable-shared and --prefix=/usr . Here's the result for ldconfig

Code:

$ sudo /sbin/ldconfig -p | grep libx264   
        libx264.so.75 (libc6) => /usr/lib/libx264.so.75         
        libx264.so (libc6) => /usr/lib/libx264.so

After trying to configure ffmpeg, it still gave the same error. Here's the output for ldd on ffmpeg.

Code:

$ ldd $(which ffmpeg)
        linux-gate.so.1 =>  (0x00612000)
        libavdevice.so.52 => /usr/local/lib/libavdevice.so.52 (0x00a26000)
        libavformat.so.52 => /usr/local/lib/libavformat.so.52 (0x0036c000)
        libavcodec.so.52 => /usr/local/lib/libavcodec.so.52 (0x00a2d000)
        libavutil.so.49 => /usr/local/lib/libavutil.so.49 (0x00213000)
        libm.so.6 => /lib/libm.so.6 (0x009f8000)
        libc.so.6 => /lib/libc.so.6 (0x008b2000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00110000)
        libbz2.so.1 => /usr/lib/libbz2.so.1 (0x05d9b000)
        libdl.so.2 => /lib/libdl.so.2 (0x00a21000)
        libamrnb.so.3 => /usr/local/lib/libamrnb.so.3 (0x007d7000)
        libfaac.so.0 => /usr/local/lib/libfaac.so.0 (0x0069c000)
        libfaad.so.2 => /usr/local/lib/libfaad.so.2 (0x00123000)
        libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0x00162000)
        /lib/ld-linux.so.2 (0x0088f000)

The above clearly indicates that ffmpeg has got no problem locating the libraries under /usr/lib or /usr/local/lib whatsoever.

H_TeXMeX_H 09-23-2009 02:22 AM

What version of ffmpeg are you trying to compile ? I've had problem with older ffmpeg and newer libx264, so I always use the latest ffmpeg to avoid problems ... like the daily tarball.

jschiwal 09-23-2009 03:48 AM

Post the exact error message. Also provide the config.err file. Provide information on the ffmpeg source code, such as version and where it is from. Someone may want to download it and see if they have the same results.

If you installed libx264 from a package, make sure both libx264 and libx264-devel are installed. A devel package will provide the static libraries and header files for the library. One or both are often needed of a dependency when building from source.

Also provide all of the options you are using for ./configure.


All times are GMT -5. The time now is 07:44 PM.