User Tools

Site Tools


build:compiling_x264

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

build:compiling_x264 [2012/11/11 08:51] (current)
Line 1: Line 1:
 +====== 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  [[http://​en.wikipedia.org/​wiki/​Subversion_(software)|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://​svn.videolan.org/​x264/​trunk 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).
 +
 +<​code>​
 +cd x264
 +make -f Makefile.dist
 +./configure --prefix=/​usr --enable-debug --enable-pthread
 +make
 +make install
 +</​code>​
 +
 +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:
 +
 +<code make>
 +libx264.a: .depend $(OBJS) $(OBJASM)
 +ar rc libx264.a $(OBJS) $(OBJASM)
 +ranlib libx264.a
 +</​code>​
 +
 +Add this line after:
 +
 +<code make>​$(CC) -shared -o libx264.so $(OBJS) $(OBJASM)</​code>​
 +
 +In the section:
 +
 +<code make>
 +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)
 +</​code>​
 +
 +Insert this line:
 +
 +<code make>​install -m 644 libx264.so $(DESTDIR)$(libdir)</​code>​
 +
 +In the section:
 +
 +<code make>
 +uninstall:
 +   rm -f $(DESTDIR)$(includedir)/​x264.h $(DESTDIR)$(libdir)/​libx264.a
 +   rm -f $(DESTDIR)$(bindir)/​x264 $(DESTDIR)$(libdir)/​pkgconfig/​x264.pc
 +</​code>​
 +
 +Add this line after:
 +
 +<code make>rm -f $(DESTDIR)$(libdir)/​libx264.so</​code>​
 +
 +Save the Makefile.
  
build/compiling_x264.txt ยท Last modified: 2012/11/11 08:51 (external edit)