ffmpeg 编码x265 10bit 视频

假如x265源码位置如下:

xw@xw-pc:~/mywork/mycode/media/x265/x265$ ls
build COPYING doc readme.rst source

修改文件 x265/source/CMakeLists.txt 找到如下位置将OFF改成ON

if(X64)
# NOTE: We only officially support high-bit-depth compiles of x265
# on 64bit architectures. Main10 plus large resolution plus slow
# preset plus 32bit address space usually means malloc failure. You
# can disable this if(X64) check if you desparately need a 32bit
# build with 10bit/12bit support, but this violates the "shrink wrap
# license" so to speak. If it breaks you get to keep both halves.
# You will need to disable assembly manually.
option(HIGH_BIT_DEPTH "Store pixel samples as 16bit values (Main10/Main12)" ON)
endif(X64)

cmake ../x265/x265/source/

make

make install

编译 ffmpeg

./configure –enable-debug=3 –disable-doc –disable-optimizations –enable-pic –extra-cflags=-fPIC –enable-openssl –enable-libx264 –enable-libx265 –enable-gpl –enable-nonfree –enable-libfreetype –enable-libfdk-aac –enable-libaom –enable-libvpx –enable-libopus

ffmpeg -i /mydata/mymedia/mm_test_libx264_30_4096x2304.mp4 -c:v libx265 -r 60 -s 4096*2160 -pix_fmt yuv420p10le -t 60 h.265_4096_2160_60fps_yuv420p10le.mkv