- Have Xcode installed (got it from Apple; it's a standard installer).
- git comes pre-installed on my Mac.
- Go to a directory where you can put the source code. I just used the desktop; hopefully there won't be any permissions issues.
- Get the repository:
git clone git://git.videolan.org/x264.git - Go to the branch called "stable" (I don't know if this actually changed anything):
git checkout stable - Attempt to compile...Oh no! It needs an assembler:
Found no assembler
Minimum version is yasm-1.0.0
If you really want to compile without asm, configure with --disable-asm.
make: *** [config.mak] Error 1 - Get YASM:
git clone git://github.com/yasm/yasm.git - Compile it:
./configure
make
sudo make install - Oh no! That didn't work...there isn't a configure file! There is a configure.ac file, though, which suggests maybe we need to generate it using autoconf:
autoconf - A error! Something about macros:
configure.ac:14: error: possibly undefined macro: AM_INIT_AUTOMAKE - Apparently there is this thing called aclocal:
aclocal
autoconf - Still errors! According to the Internet, there should already be a configure file here. So I downloaded the tarball instead, and that has it. Okay. Let's try compiling it again:
cd yasm-1.2.0
./configure
make
sudo make install - That seems to have worked!
$ which yasm
/usr/local/bin/yasm - Okay, now we can go back to the x264 folder and try installing it:
cd ../x264
./configure
make
sudo make install - It worked! Yay!
UPDATE: I subsequently needed to perform this installation on another computer, which I only have ssh access to at the moment. It turns out you can also install YASM using MacPorts, which is very easy:
sudo port install yasm
UPDATE 2: Later I needed to do this installation on a computer that didn't have ffmpeg installed, and also I'm not a super user for, so I had to install it to my home directory.
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
./configure --enable-shared --prefix=/home/username/myBin
make
make install
and then re-install x264 with appropriate flags to tell it where the ffmpeg library is:
cd x264
export LDFLAGS="-L/home/username/myBin/lib"
export CFLAGS="-I/home/username/myBin/include"
export LD_RUN_PATH="/home/username/myBin/lib"
./configure --enable-shared --prefix=/home/username/myBin
make
make install
Then the call to x264 is:
x264 -q0 --preset placebo -o outputFile.mkv inputFile.avi
UPDATE 2: Later I needed to do this installation on a computer that didn't have ffmpeg installed, and also I'm not a super user for, so I had to install it to my home directory.
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
./configure --enable-shared --prefix=/home/username/myBin
make
make install
and then re-install x264 with appropriate flags to tell it where the ffmpeg library is:
cd x264
export LDFLAGS="-L/home/username/myBin/lib"
export CFLAGS="-I/home/username/myBin/include"
export LD_RUN_PATH="/home/username/myBin/lib"
./configure --enable-shared --prefix=/home/username/myBin
make
make install
Then the call to x264 is:
x264 -q0 --preset placebo -o outputFile.mkv inputFile.avi
No comments:
Post a Comment