Skip to content

How to compile cn

Alex.CR edited this page Feb 16, 2020 · 4 revisions

如何编译

依赖ffmpeg动态库,libsrt, libx264, lib265, libfdk_aac等。

libx264

wget https://johnvansickle.com/ffmpeg/release-source/libx264-git.tar.xz
xz -d libx264-git.tar.xz
tar -xvf libx264-git.tar
cd ./libx264-git
./configure
make -j 2
make install

libx265

yum install cmake wget https://johnvansickle.com/ffmpeg/release-source/libx265-git.tar.xz
xz -d libx265-git.tar.xz
tar -xvf libx265-git.tar
cd libx265-git/source/
mkdir build
cd build/
cmake ..
make -j 2
make install

libfdk_aac

wget https://downloads.sourceforge.net/opencore-amr/fdk-aac-2.0.1.tar.gz
tar -xzvf fdk-aac-2.0.1.tar.gz
cd fdk-aac-2.0.1
./configure
make -j 2
make install

libsrt

yum install git
git clone https://github.com/Haivision/srt.git
cd srt
./configure
make && make install

ffmpeg

wget https://johnvansickle.com/ffmpeg/release-source/ffmpeg-4.1.tar.xz
xz -d ffmpeg-4.1.tar.xz
tar -xvf ffmpeg-4.1.tar
cd ffmpeg-4.1
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure --target-os=linux --arch=x86_64 --enable-cross-compile --disable-avdevice --disable-doc --disable-devices --disable-ffplay --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-libsrt --enable-nonfree --disable-asm --enable-gpl --pkgconfigdir=/usr/local/lib/pkgconfig --enable-shared
make -j 2
make install

srt_encoder

cp lib/linux/libenc.so /usr/local/lib
ln /usr/local/lib/libenc.so /lib64/libenc.so
make根目下的Makefile即可

Clone this wiki locally