1、 下载源代码kvazaar
git clone https://github.com/ultravideo/kvazaar.git
2、下载greatest
git clone https://github.com/ultravideo/greatest.git
把下载的greatest 替换kvazaar目录下的greatest(如果下载kvazaar的时候,里面的greatest不为空那么就无需替换了)。
3、从readme文件中需要运行下面的命令
./autogen.sh
./configure
make
sudo make install
发现运行./autogen.sh的时候出现错误如下错误
Submodule path 'greatest': checked out '60e25ce7658ced49f03b52ac14c553cf6ea33de4'
configure.ac:40: installing 'build-aux/ar-lib'
configure.ac:38: installing 'build-aux/compile'
configure.ac:92: installing 'build-aux/config.guess'
configure.ac:92: installing 'build-aux/config.sub'
configure.ac:35: installing 'build-aux/install-sh'
configure.ac:35: installing 'build-aux/missing'
src/Makefile.am:2: error: Libtool library used but 'LIBTOOL' is undefined
src/Makefile.am:2: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
src/Makefile.am:2: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
src/Makefile.am:2: If 'LT_INIT' is in 'configure.ac', make sure
src/Makefile.am:2: its definition is in aclocal's search path.
src/Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
autoreconf: automake failed with exit status: 1
然后一次执行下面的命令
$aclocal
$autoheader
$automake
发现还是不行,这个时候需要安装一下文件
sudo apt-get install libtool
sudo apt-get update
然后重新执行命令
$aclocal
$autoheader
$automake
发现还是有问题,然后执行下面命令
libtoolize --automake --copy --debug --force
sudo automake
make
还是都不行,这个时候重头再来,直接运行下面
./autogen.sh
./configure
make
sudo make install
发现可以了!
补充知识点1:
1、配置sudo ./configure
安装时需要通过 configure 来确定编译器用的是 cc 还是 gcc、不同库文件所在目录等。执行 configure 后会生成 Makefile,Makefile 规定了用什么编译器、编译参数等信息。
./configure命令就是执行当前目录的名为configure的脚本,主要的作用是对即将安装的软件进行配置,检查当前的环境是否满足要安装软件的依赖关系,生成makefile
2、 编译sudo make
根据makefile里的指令来编译源文件
3、make install
make install:将程序安装至系统中。可执行文件存放路径默认/usr/local/bin
来源于http://blog.csdn.net/u014788227/article/details/50071229
然后不知道什么用,在make install 的时候已经安装了kvazaar 可以直接运行kvazaar命令。从kvazaar的readme可以直接运行下面命令
kvazaar -i foreman_cif.yuv --input -res 352x288 -o outubuntu.hevc
然后发现下面的问题
kvazaar: error while loading shared libraries: libkvazaar.so.3: cannot open shared object file: No such file or directory
经过再百度和往回看前面的指令,我们发现sudo make install 的日志
Making install in src
make[1]: Entering directory '/home/li/Datadir/kvazaar/src'
make[2]: Entering directory '/home/li/Datadir/kvazaar/src'
/bin/mkdir -p '/usr/local/lib'
/bin/sh ../libtool --mode=install /usr/bin/install -c libkvazaar.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libkvazaar.so.4.0.0 /usr/local/lib/libkvazaar.so.4.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libkvazaar.so.4.0.0 libkvazaar.so.4 || { rm -f libkvazaar.so.4 && ln -s libkvazaar.so.4.0.0 libkvazaar.so.4; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libkvazaar.so.4.0.0 libkvazaar.so || { rm -f libkvazaar.so && ln -s libkvazaar.so.4.0.0 libkvazaar.so; }; })
libtool: install: /usr/bin/install -c .libs/libkvazaar.lai /usr/local/lib/libkvazaar.la
libtool: install: /usr/bin/install -c .libs/libkvazaar.a /usr/local/lib/libkvazaar.a
libtool: install: chmod 644 /usr/local/lib/libkvazaar.a
libtool: install: ranlib /usr/local/lib/libkvazaar.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/bin'
/bin/sh ../libtool --mode=install /usr/bin/install -c kvazaar '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/kvazaar /usr/local/bin/kvazaar
/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 kvazaar.h '/usr/local/include'
/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 kvazaar.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/home/li/Datadir/kvazaar/src'
make[1]: Leaving directory '/home/li/Datadir/kvazaar/src'
Making install in tests
make[1]: Entering directory '/home/li/Datadir/kvazaar/tests'
make[2]: Entering directory '/home/li/Datadir/kvazaar/tests'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/li/Datadir/kvazaar/tests'
make[1]: Leaving directory '/home/li/Datadir/kvazaar/tests'
make[1]: Entering directory '/home/li/Datadir/kvazaar'
make[2]: Entering directory '/home/li/Datadir/kvazaar'
make[2]: Nothing to be done for 'install-exec-am'.
/bin/mkdir -p '/usr/local/share/doc/kvazaar'
/usr/bin/install -c -m 644 COPYING CREDITS README.md '/usr/local/share/doc/kvazaar'
/bin/mkdir -p '/usr/local/share/man/man1'
/usr/bin/install -c -m 644 doc/kvazaar.1 '/usr/local/share/man/man1'
make[2]: Leaving directory '/home/li/Datadir/kvazaar'
make[1]: Leaving directory '/home/li/Datadir/kvazaar'
我们发现,库安装在/usr/local/lib 下面。然后执行下面的命令
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/lib" >> /etc/ld.so.conf
# ldconfig
再运行执行命令,发现可以了
kvazaar -i foreman_cif.yuv --input-res 352x288 -o outubuntu.hevc
补充知识点2
一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如:
tmux: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
原因一般有两个, 一个是操作系统里确实没有包含该共享库(lib*.so.*文件)或者共享库版本不对, 遇到这种情况那就去网上下载并安装上即可.
另外一个原因就是已经安装了该共享库, 但执行需要调用该共享库的程序的时候, 程序按照默认共享库路径找不到该共享库文件.
所以安装共享库后要注意共享库路径设置问题, 如下:
1) 如果共享库文件安装到了/lib或/usr/lib目录下, 那么需执行一下ldconfig命令
ldconfig命令的用途, 主要是在默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下, 搜索出可共享的动态链接库(格式如lib*.so*), 进而创建出动态装入程序(ld.so)所需的连接和缓存文件. 缓存文件默认为/etc/ld.so.cache, 此文件保存已排好序的动态链接库名字列表.
2) 如果共享库文件安装到了/usr/local/lib(很多开源的共享库都会安装到该目录下)或其它”非/lib或/usr/lib”目录下, 那么在执行ldconfig命令前, 还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:
$cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
$echo "/usr/local/lib" >> /etc/ld.so.conf
$ldconfig
3) 如果共享库文件安装到了其它”非/lib或/usr/lib” 目录下, 但是又不想在/etc/ld.so.conf中加路径(或者是没有权限加路径). 那可以export一个全局变量LD_LIBRARY_PATH, 然后运行程序的时候就会去这个目录中找共享库.
LD_LIBRARY_PATH的意思是告诉loader在哪些目录中可以找到共享库. 可以设置多个搜索目录, 这些目录之间用冒号分隔开. 比如安装了一个mysql到/usr/local/mysql目录下, 其中有一大堆库文件在/usr/local/mysql/lib下面, 则可以在.bashrc或.bash_profile或shell里加入以下语句即可:
export LD_LIBRARY_PATH=/usr/local/mysql/lib:$LD_LIBRARY_PATH
一般来讲这只是一种临时的解决方案, 在没有权限或临时需要的时候使用.
–End–
上面来源
http://blog.csdn.net/sahusoft/article/details/7388617
videohelp论坛
https://forum.videohelp.com/threads/362131-Around-the-Kvazaar-H-265-encoder
关于错误LIBTOOL is undefined查看这两个网页
https://stackoverflow.com/questions/18978252/error-libtool-library-used-but-libtool-is-undefined
http://blog.csdn.net/sky_qing/article/details/9707647