User Tools

Site Tools


Compiling x264

Gentoo Linux: There is an ebuild for x264 called “x264-svn” in the stable tree. Just emerge.

Beyond that are currently no known packages available for the various distributions of Linux, BSD, etc. for x264. Thus there is no guide to installing the program and libraries using any of the numerous package systems. It is recommended that you install and compile it from the SVN repository.

If packages become available for this program and libraries, feel free to edit this page to include instructions on how to use them.

Compiling x264 from the SVN Repository

Download x264

With the console, move to a directory where you want to download the files. Run this command line from the root console (with either su or sudo).

svn co svn:// x264

Compile and install

Move to the directory where have downloaded the files. Run these command line from the root console (with either su or sudo).

cd x264
make -f Makefile.dist
./configure --prefix=/usr --enable-debug --enable-pthread
make install

That finishes the install of x264 onto your system. Now you can encode in H.264 video in Avidemux.

Problems with installation

Some people have trouble installing x264 onto their system. We have created a section for editing the makefile that comes with the SVN download which should fix the installation problems.

It is recommended that you try installing x264 normally first. If that attempt it does not work properly, then look into the methods described in the next section called “Edit x264 Makefile”.

Edit x264 Makefile

Sometimes, not often anymore, it is necessary to edit the Makefile so x264 will be properly installed. The Makefile is in the place where you downloaded the SVN files, in subdirectory called x264. Open the Makefile in whatever text editor you like.

In the section:

libx264.a: .depend $(OBJS) $(OBJASM)
ar rc libx264.a $(OBJS) $(OBJASM)
ranlib libx264.a

Add this line after:

$(CC) -shared -o $(OBJS) $(OBJASM)

In the section:

install: x264
   install -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
   install -m 644 x264.h $(DESTDIR)$(includedir)
   install -m 644 libx264.a $(DESTDIR)$(libdir)
   **->(line add)<-**
   install x264 $(DESTDIR)$(bindir)

Insert this line:

install -m 644 $(DESTDIR)$(libdir)

In the section:

   rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a
   rm -f $(DESTDIR)$(bindir)/x264 $(DESTDIR)$(libdir)/pkgconfig/x264.pc

Add this line after:

rm -f $(DESTDIR)$(libdir)/

Save the Makefile.

build/compiling_x264.txt · Last modified: 2012/11/11 08:51 (external edit)