Os:centos6.4-64bit
--------compiling FFMPEG with h265--------
1. Installing HG Tool
#yum Install HG
2. Download x265 source code and make
#hg Clone https://bitbucket.org/multicoreware/x265
#cd X265/build/linux
#make
#make Install
3. Download x264 and FFmpeg source and make
Please refer to one of my previous blog posts:
Use Nginx+ffmpeg to build HLS live Transcoding server (http://blog.csdn.net/wutong_login/article/details/42292787)
4. Compile support for h265 FFMPEG
#PKG_CONFIG_PATH =/usr/local/lib/pkgconfig./configure--prefix=/opt/ffmpeg/--enable-version3--ENABLE-LIBVPX-- ENABLE-LIBFAAC--enable-libmp3lame--enable-libvorbis--enable-libx264--enable-libxvid--enable-shared--ENABLE-GPL --enable-postproc--enable-nonfree--enable-avfilter--enable-pthreads--enable-libx265
#make
#make Install
#ldd/opt/ffmpeg/bin/ffmpeg
Note:if libx265.so.40 isn't found please cp it from/usr/local/lib to/usr/lib64
--------Compare h265 and H264--------
1. Encode 264 and 265
Find a YUV file from the Internet, or use ffmpeg decoding one can also, I use 720P, respectively encoded 500Kbps.
/opt/ffmpeg/bin/ffmpeg-s 1280*720-i/home/edward/media/720-new.yuv-vcodec libx264-b:v 2000k/home/edward/media/720- New-264.ts
/opt/ffmpeg/bin/ffmpeg-s 1280*720-i/home/edward/media/720-new.yuv-vcodec libx265-b:v 2000k/home/edward/media/720- New-265.ts
Then decode to YUV data:
/opt/ffmpeg/bin/ffmpeg-i/HOME/EDWARD/MEDIA/720-NEW-264.TS/HOME/EDWARD/MEDIA/720-NEW-264.YUV
/opt/ffmpeg/bin/ffmpeg-i/HOME/EDWARD/MEDIA/720-NEW-265.TS/HOME/EDWARD/MEDIA/720-NEW-265.YUV
Find a frame to compare:
SOURCE graph:
265:
264:
As we can see, 264 code 500k, the figure in the red box of several numbers, the basic has not been clearly seen.
Test the encoding effect of h265 and H264