videolan x265 源代码下载、编译、测试 【2015-8-11】更新链接

目前有多个实现HEVC/H.265/MPEG-H标准的项目叫做x265,本文主要关注 Videolan旗下的x265

项目主页是:https://www.videolan.org/developers/x265.html

1、配置源代码管理工具 Mercurial  

该项目的源代码管理工具是Mercurial  

在该公司的下载主页下载对应的系统的版本:http://mercurial.selenic.com/downloads

我的系统是 64位 win7:下载的是http://mercurial.selenic.com/release/windows/mercurial-3.2.1-x64.msi

安装后,在cmd下,运行输入:hg     出现下面的信息表明你的hg 安装成功

Microsoft Windows [版本 6.1.7601] 
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>hg
分布式软件配置管理工具 - 水银

基本命令:

 add           add the specified files on the next commit
 annotate      show changeset information by line for each file
 clone         make a copy of an existing repository
 commit        commit the specified files or all outstanding changes
 diff          diff repository (or selected files)
 export        dump the header and diffs for one or more changesets
 forget        forget the specified files on the next commit
 init          create a new repository in the given directory
 log           show revision history of entire repository or files
 merge         merge working directory with another revision
 pull          pull changes from the specified source
 push          push changes to the specified destination
 remove        remove the specified files on the next commit
 serve         start stand-alone webserver
 status        show changed files in the working directory
 summary       summarize working directory state
 update        update working directory (or switch revisions)

(use "hg help" for the full list of commands or "hg -v" for details)


2、使用hg 下载源代码


建立源代码目录: G:\HEVC应用\x265-videolan\x265
在该目录下运行命令: hg clone http://hg.videolan.org/x265【更新:2015-8-11】发现这个链接失效
【请用这个链接】 hg clone https://bitbucket.org/multicoreware/x265
然后开始从服务器端下载源代码
G:\HEVC应用\x265-videolan>cd x265

G:\HEVC应用\x265-videolan\x265>hg clone http://hg.videolan.org/x265
目标目录: x265
正在请求全部修改
正在增加修改集
正在增加清单
正在增加文件改变
已增加 8888 个修改集,包含 20901 个改变,修改了 680 个文件
updating to branch default
216 files updated, 0 files merged, 0 files removed, 0 files unresolved

G:\HEVC应用\x265-videolan\x265>

下载结束后,会在当前目录下出现一个x265文件夹,运行命令:cd x265 进入目录,再运行 dir ,查看源代码目录结构
G:\HEVC应用\x265-videolan\x265>dir
 驱动器 G 中的卷是 linux
 卷的序列号是 000A-0243

 G:\HEVC应用\x265-videolan\x265 的目录

2014/11/22  15:47    <DIR>          .
2014/11/22  15:47    <DIR>          ..
2014/11/22  15:48    <DIR>          x265
               0 个文件              0 字节
               3 个目录 10,194,780,160 可用字节

G:\HEVC应用\x265-videolan\x265>cd x265

G:\HEVC应用\x265-videolan\x265\x265>dir
 驱动器 G 中的卷是 linux
 卷的序列号是 000A-0243

 G:\HEVC应用\x265-videolan\x265\x265 的目录

2014/11/22  15:48    <DIR>          .
2014/11/22  15:48    <DIR>          ..
2014/11/22  15:48    <DIR>          .hg
2014/11/22  15:48               122 .hgignore
2014/11/22  15:48               677 .hgtags
2014/11/22  15:48    <DIR>          build
2014/11/22  15:48            18,120 COPYING
2014/11/22  15:48    <DIR>          doc
2014/11/22  15:48    <DIR>          source
               3 个文件         18,919 字节
               6 个目录 10,194,780,160 可用字节

G:\HEVC应用\x265-videolan\x265\x265>
3个源代码管理的文件夹: .hg  .hgignore  .hgtags
3个源代码文件夹:build doc source 
其中 source中包含所有的源代码、build包含windows、linux、Mac 3种系统下的编译文件、doc中包含一些参数配置文档(目前不清楚具体的作用)

仔细阅读 build/readme.txt ,里面有详细的编译要求:下面是必须的

= Mandatory Prerequisites =
* GCC, MSVC (9, 10, 11, 12), Xcode or Intel C/C++
* CMake 2.8.8 or later http://www.cmake.org
* On linux, ccmake is helpful, usually a package named cmake-curses-gui 

Note: MSVC12 requires cmake 2.8.11 or later
 

我使用的是 MSVC2012 ,需要下载 cmake 2.8.11 之上的版本
下面是cmake windows下的安装包:
http://www.cmake.org/files/v2.8/cmake-2.8.12.2-win32-x86.exe

3、准备编译所需的第三方程序、库

3.1 yasm 

x265中有汇编代码,需要汇编器进行编译
For Windows, download
http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win32.exe or
http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win64.exe
下载ysam后,在命令行下输入: PATH
G:\HEVC应用\x265-videolan\x265\x265> PATH
PATH=C:\Python27\;C:\Program Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\W
6)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Pr
返回系统环境变量PATH的值,这个是系统默认的搜索路径,将下载的鸭舌帽拷贝到其中一个目录中,我推荐: c:/windows
将下载的文件改名为 yasm.exe  去掉后面的-1.2.0-win32

然后在命令行中输入: yasm --version 
若返回下面的信息,表明按照正确

G:\HEVC应用\x265-videolan\x265\x265>yasm --version
yasm 1.2.0
Compiled on Oct 31 2011.
Copyright (c) 2001-2011 Peter Johnson and other Yasm developers.
Run yasm --license for licensing overview and summary.

G:\HEVC应用\x265-videolan\x265\x265>

3.2 安装VisualLeakDetector

下载VisualLeakDetector: https://vld.codeplex.com/releases
下载后安装即可
【可能需要重启】


4、 根据Visual studio 的版本,2012 是MSVC11 ,生成对应的.sln 工程文件

进入\build\vc11-x86  ,双击 make-solutions.bat
生成cmake所需的文件

打开cmake gui程序
选择 源代码所在的目录,点击 configure,在没有任何错误的情况下,点击 genearate,会生成 .sln文件,双击即可,在visual studio 2012 下会打开工程
但是双击 make-solutions.bat, 出现问题:
-- Looking for include file getopt.h - not found
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CheckIncludeFiles.cmake:76 (file):
  file Internal CMake error when trying to open file:
  G:/HEVC应用/x265-videolan/x265/x265/build/vc11-x86/CMakeFiles/CMakeError.log
  for writing.
Call Stack (most recent call first):
  CMakeLists.txt:347 (check_include_files)


-- Configuring incomplete, errors occurred!
CMake Error: Cannot open file for write: G:/HEVC应用/x265-videolan/x265/x265/build/vc11-x86/CMakeCache.txt.tmp
CMake Error: : System Error: No such file or directory
CMake Error: Unable to open cache file for save. G:/HEVC应用/x265-videolan/x265/x265/build/vc11-x86/CMakeCache.txt
CMake Error: : System Error: No such file or directory
后来,发现是中文路径的原因,所有路径不能含有中文字符
我得路径是 : G:\HEVC应用\x265-videolan\x265\x265,其中HEVC应用是含有中文,所以出错
</pre>在去掉中文字符后,双击 make-solutions.bat,运行结果:</div><div><pre code_snippet_id="528746" snippet_file_name="blog_20141122_9_9663501" name="code" class="html">-- cmake version 2.8.12.2
-- The C compiler identification is MSVC 17.0.50727.1
-- The CXX compiler identification is MSVC 17.0.50727.1
-- Check for working C compiler using: Visual Studio 11
-- Check for working C compiler using: Visual Studio 11 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 11
-- Check for working CXX compiler using: Visual Studio 11 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected x86 target processor
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - not found
-- Found yasm: C:/Windows/yasm.exe (found version "1.2.0")
-- Found Yasm 1.2.0 to build assembly primitives
-- hg found at C:/Program Files/Mercurial/hg.exe
-- x265 version 1.4+113-346fccbba4de
-- The ASM_YASM compiler identification is unknown
-- Found assembler: C:/Windows/yasm.exe
-- Looking for strtok_r
-- Looking for strtok_r - not found
-- Looking for include file getopt.h
-- Looking for include file getopt.h - not found
-- Configuring done
-- Generating done
-- Build files have been written to: G:/x265-videolan/x265/x265/build/vc11-x86

结束后,会自动打开 cmake gui:


先点击 Configure,
在确认没有任何红色的选项后,点击 Generate

在目录下生成 x265.sln
双击打开,在visual studio 2012 下 打开x265 项目,截图:

一共有8个工程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
编译FFmpeg: 1.安装依赖库: sudo apt-get update sudo apt-get install build-essential git-core checkinstall yasm texi2html libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev pkg-config netcat libncurses5-dev libncursesw5-dev libsdl-image1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvpx-dev libxext-dev libxfixes-dev libxl2tpd-dev libxrandr-dev libxrender-dev libxvidcore-dev libssl-dev libsoxr-dev libopus-dev 2.下载FFmpeg源代码: git clone https://github.com/FFmpeg/FFmpeg.git 3.编译FFmpeg: cd FFmpeg ./configure --prefix=/usr/local --enable-shared --enable-gpl --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-version3 --enable-nonfree --disable-stripping make -j4 sudo checkinstall 编译libx264: 1.下载libx264源代码: git clone https://code.videolan.org/videolan/x264.git 2.编译libx264: cd x264 ./configure --prefix=/usr/local --enable-shared make -j4 sudo checkinstall 编译PJSIP: 1.下载PJSIP源代码: svn checkout http://svn.pjsip.org/repos/pjproject/trunk pjproject 2.编译PJSIP: cd pjproject ./configure --prefix=/usr/local --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr make dep make -j4 sudo checkinstall 注意:在编译PJSIP时,如果遇到错误提示找不到libssl-dev和libsoxr-dev库,可以使用以下命令安装: sudo apt-get install libssl-dev libsoxr-dev 编译完成后,即可使用VoIP应用程序了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值