使ffmpeg支持HDR10bit 环境为ubuntu16.04

1. 编译X265,生成静态库, 安装到默认目录

cmake -G "Unix Makefiles"  -DENABLE_SHARED=OFF source -DHIGH_BIT_DEPTH=ON
make -j8
make install

2. 安装h264  ###可选项

####安装nasm   x264要求安装2.13版本以上

####wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/nasm/2.13.03-2/nasm_2.13.03.orig.tar.xz

####tar xvJf nasm*

git clone git://git.videolan.org/x264.git

###./configure --enable-static --disable-opencl --disable-avs  --disable-cli --disable-ffms --disable-gpac --disable-lavf --disable-swscale --disable-asm

./configure --disable-opencl --disable-avs  --disable-cli --disable-ffms --disable-gpac --disable-lavf --disable-swscale --disable-asm --enable-shared

make 

make install


2. 下载最新版的ffmpeg 并编译为动态库

apt-get install nasm
./configure --enable-libx265 --enable-gpl --disable-static --enable-shared --pkg-config-flags="--static"

出现错误ERROR: x265 not found using pkg-config
解决办法 ./configure 时, --pkg-config-flags="--static" 这个参数你没有加 得加上
make
make install
这样ffmpeg就安装在了默认目录


3. 编写测试程序
出现bug Codec 0x61a80 is not in the full list.
发现头文件包含的是老版本ffmpeg的头文件,故编译选项-I 指定我们的ffmpeg 的头文件目录即可 -I /usr/local/include


原文地址:https://www.cnblogs.com/luoyinjie/p/9815328.html