目前有多个实现HEVC/H.265/MPEG-H标准的项目叫做x265,本文主要关注 Videolan旗下的x265
项目主页是:https://www.videolan.org/developers/x265.html
该项目的源代码管理工具是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)
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>
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
我使用的是 MSVC2012 ,需要下载 cmake 2.8.11 之上的版本
下面是cmake windows下的安装包:
http://www.cmake.org/files/v2.8/cmake-2.8.12.2-win32-x86.exe
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
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>
-- 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