FFMPEG Compliation Guide: libx264, MinGW and MSYS
Get the nasm assembler: http://www.nasm.us/
Stable build of libx264 can be found here: ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
Build libx264
H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples.
Requires ffmpeg to be configured with --enable-gpl --enable-libx264.
If your repository provides libx264-dev version ≥ 118 then you can install that instead of compiling:
sudo apt-get install libx264-dev
Otherwise you can compile:
cd ~/ffmpeg_sources
git -C x264 pull 2> /dev/null || git clone --depth 1 http://git.videolan.org/git/x264
cd x264
If not using Mingw-w64, us this configure line:
./configure --enable-static
If using Mingw-w64, use this configure line:
./configure --host=x86_64-w64-mingw32 --disable-cli --enable-static --disable-gpac --disable-swscale --enable-strip
make
make install
Now libx264 will be built and installed.
Build ffmpeg with libx264
libx264 can be compiled and installed in the MinGW+MSys environment.
If you want libx264.dll files (instead of static) you should use the --enable-shared configure option.
The only way I was able to figure out how to get this to work was to add --extra-ldflags=-L../libx264_unpacked_dir --extra-cflags=-I../libx264_unpacked_dir to my ffmpeg configure line, after successfully building libx264.
Like so:
$ ./configure --extra-cflags="-fno-stack-check -fno-stack-protector -mno-stack-arg-probe -IPATH_TO_SOURCE/x264" --enable-gpl --enable-libx264 --extra-ldflags=-LPATH_TO_SOURCE/x264 --enable-debug --disable-stripping
Comments
Post a Comment