歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在Ubuntu下FFmpeg編譯,支持x264和x265(HECV)

在Ubuntu下FFmpeg編譯,支持x264和x265(HECV)

日期:2017/2/28 14:35:57   编辑:Linux教程

所有下載的源
在Ubuntu下FFmpeg編譯,支持x264和x265。
Ubuntu 12.04

FFmpeg 2.1 Release

注意:
cmake要升級要2.8.8
yasm要升級到1.2.0

0000. 資料:
http://stackoverflow.com/questions/19634453/ffmpeg-how-to-generate-a-mp4-with-h-265-codec
FFmpeg supports encoding HEVC/H.265 since 2-12-2014 with libx265. Now you can use ffmpeg directly to encode HEVC or use another encoder than manually mux that into .mp4 using FFmpeg. Of course you can still use some patched FFmpeg build, but it is not recommended.
To make matters more confusing, there are two independent projects both named "x265", one by a Chinese college student and is practically dead, and another by a commercial company called MulticoreWare. Although the former started out first, it is practically dead now, and the latter is under active development and is supported by VideoLAN (the developer of x264).
Anyways, these are a complete set of current possibilities of encoding HEVC in order of my recommendation:
Directly using MulticoreWare libx265 with FFmpeg. This means with the latest Zeranoe build you can now do this:
ffmpeg -i INPUT -x265-params crf=25 OUT.mov
Using standalone MulticoreWare x265 and then mux the resulting file with FFmpeg.

Using DivX HEVC Encoder and then mux it.
Using standalone Chinese x265 then mux the resulting file with FFmpeg.
Using patched FFmpeg with Chinese x265 support.
Update: FFmpeg has HEVC encoding support using MulticoreWare libx265 now.

0001.官方說明:
http://ffmpeg.org/general.html
External libraries
x265
FFmpeg can make use of the x265 library for HEVC encoding.
Go to http://x265.org/developers.html and follow the instructions for installing the library. Then pass --enable-libx265 to configure to enable it.
x265 is under the GNU Public License Version 2 or later (see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for details), you must upgrade FFmpeg’s license to GPL in order to use it.

0002.安裝x264
$git clone git://git.videolan.org/x264.git
$cd x264
$./configure --enable-static --disable-opencl --disable-avs --disable-cli --disable-ffms --disable-gpac --disable-lavf --disable-swscale
$make
$make install

0003.安裝x265
https://bitbucket.org/multicoreware/x265/wiki/Home
# ubuntu packages:
$ sudo apt-get install mercurial cmake cmake-curses-gui build-essential yasm
# Note: if the packaged yasm is older than 1.2, you must download yasm-1.2 and build it
$ hg clone https://bitbucket.org/multicoreware/x265
$ cd x265/build/linux
$ ./make-Makefiles.bash
# 這裡將 LOG_CU_STATISTICS 設置為ON,然後,按下“c”,實現configure,按下“q”退出
$ make
$ make install

0004.下載ffmpeg
從 http://ffmpeg.org/download.html 下載ffmpeg 2.1版本源碼
$./configure --enable-libx264 --enable-libx265 --enable-gpl
$make
$make install

FFmpeg 的詳細介紹:請點這裡
FFmpeg 的下載地址:請點這裡

推薦閱讀:

Linux下編譯FFmpeg之下載源文件並編譯 http://www.linuxidc.com/Linux/2012-02/54565.htm

Linux 編譯升級 FFmpeg 步驟 http://www.linuxidc.com/Linux/2013-08/88190.htm

CentOS 5.6 上安裝 FFMPEG http://www.linuxidc.com/Linux/2011-09/42793.htm

在Ubuntu下安裝FFmpeg http://www.linuxidc.com/Linux/2012-12/75408.htm

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved