CentOS 6.4安装ffmpeg2.4.2 支持h.265

   

最近有一些视频是H.265编码方式的,市面上很多播放器都不能播放,干脆自己动手,用ffmpeg将其转换成h.264看看。

于是就有了下面在ffmepg中安装x265的过程。

1.安装mercurial

wget http://mercurial.selenic.com/release/mercurial-2.6.1.tar.gz

tar -zxvf mercurial-2.6.1.tar.gz  

yum -y install python-devel.x86_64

yum -y install python-docutils 

cd mercurial-2.6.1

make install

 

2.安装x265

$ hg clone https://bitbucket.org/multicoreware/x265

$ cd x265/build/linux

$ ./make-Makefiles.bash

$ make && make install

其中cmake版本要高于2.8.8

 

3.编译ffmpeg

ffmpeg

./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-pic --enable-pthreads --enable-pic --enable-openssl --enable-libtwolame 

 

报错x256 not found

查看config.log文件最后一行

x265编译目录x265/build/linuxx265.pc文件复制到/usr/local/lib

然后修改/etc/profile中的环境变量PKG_CONFIG_PATH

运行pkg-config --list-all 查看x265

最后编译ffmpeg

make

make install

查看ffmpeg是否支持h.265,运行ffmpeg

 

看到--enbale-libx265 证明安装h.265成功。

 

接下来转码一个h.265视频到h.264看看效果。

 ffmpeg -i h265.mkv -c:v libx264 -preset medium -c:a aac -strict experimental -f mp4 -b:a 128k outputh264.mp4

 

原视频1214秒,经过大约15分钟,转码结束。

看下结果吧。

原文地址:https://www.cnblogs.com/sheng1255blog/p/5121346.html