spice源码编译支持x264/x265编解码
近期在研究spice协议相关内容,通过yum安装的gstreamer开发环境然后再通过源码编译spice总是在configure之后出现gstreamer可能无法正常工作等告警,spice-protocol的12.15版本之后开始支持h265,但是spice server中并没有支持h265需要手动修改,下面开始源码编译spice,源码编译gstreamer可以查看我另一篇文章Centos7编译gstreamer16.2版本
————————————————
1、环境搭建
yum install -y openssl-devel virt-install device-mapper-devel libvirt virt-manager bridge-utils libffi-devel libmount-devel gtk-doc libXext-devel libjpeg-turbo-devel pixman-devel json-glib-devel zlib-devel bzip2-devel gtk3-devel lz4-devel libusbx-devel libusb-devel usbredir-devellz4-devel libusbx-devel libusb-devel usbredir-devel
2、spice-protocol编译
spice-protocol编译很简单就是把头文件拷贝到我们指定的目录下面
./configuire --prefix=/usr/local/spice
make
make install
export PKG_CONFIG_PATH=/usr/local/spice/share/pkgconfig:$PKG_CONFIG_PATH
3、spice server 编译
Centos7编译gstreamer16.2版本
最近在centos7下面编译了gstreamer 16.2版本的源码支持x264、x265的编解码,废话不多说直接来编译:
yum -y install openssl-devel libffi-devel libmount-devel libXext-devel libjpeg-turbo-devel pixman-devel zlib-devel bzip2-devel lz4-devel cmake cmake-gui git-hg
如果cmake版本低就下载源码自己编译一下
cmake编译:
./configure && make -j8 && make install
yasm源码编译
./configure --prefix=/usr/local/gstreamer/depend
make -j8
make install
export PATH=/usr/local/gstreamer/depend/bin:$PATH
http://yasm.tortall.net/Download.html
x264源码编译
./configure --prefix=/usr/local/gstreamer/depend --disable-asm --enable-shared
make -j8
make install
export PKG_CONFIG_PATH=/usr/local/gstreamer/depend/lib/pkgconfig:$PKG_CONFIG_PATH
PKG_CONFIG_PATH环境变量用于后面gstreamer源码编译时可以正确找到我们编译的x264
https://download.csdn.net/download/w5550/34841288?ydreferer=aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3c1NTUwL2FydGljbGUvZGV0YWlscy8xMjA5ODgxOTY%3D
X265编译
源码下载地址:hg clone http://hg.videolan.org/x265
./configuire --prefix=/usr/local/gstreamer/depend
make -j8
make install
libde265编译
./configure --prefix=/usr/local/gstreamer/depend
make -j8
make install
https://download.csdn.net/download/w5550/34841895
libvpx编译(支持vp8 vp9编解码不需要可以不编)
./configure --prefix=/usr/local/gstreamer/depend --enable-realtime-only --enable-error-concealment --disable-examples --enable-vp8 --enable-vp9 --enable-pic --enable-shared --as=yasm
make -j8
make install
https://download.csdn.net/download/w5550/34842363
pcre编译
./configure --prefix=/usr/local/gstreamer/depend --enable-utf8 --enable-unicode-properties
make -j8
make install
orc编译
./configure --prefix=/usr/local/gstreamer/depend
make -j8
make install
gstreamer编译
https://download.csdn.net/download/w5550/34844388
1、编译gstreamer
./configure --prefix=/usr/local/gstreamer
make -j8
make install
export PKG_CONFIG_PATH=/usr/local/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH
2、编译gst-plugins-base
./configure --prefix=/usr/local/gstreamer
make -j8
make install
编译gstreamer必须首先编译gstreamer然后编译gst-plugins-base至于其他插件的顺序就可以随意了,因为其他插件只是依赖前面这两个
3、gst-plugins-good
./configure --prefix=/usr/local/gstreamer
make -j8
make install
4、gstremer-vaapi
./configure --prefix=/usr/local/gstreamer
make -j8
make install
5、gst-plugins-bad
./configure --prefix=/usr/local/gstreamer
make -j8
make install
6、gst-libav
./configure --prefix=/usr/local/gstreamer
make -j8
make install
7、gst-plugins-ugly
./configure --prefix=/usr/local/gstreamer
make -j8
make install
配置环境变量
gedit /root/.bashrc
添加如下内容
GST_PLUGIN_PATH=/usr/local/gstreamer/lib/gstreamer-1.0
GST_PLUGIN_SCANNER=/usr/local/gstreamer/libexe/gstreamer-1.0/gst-plugin-scanner
export PATH=/usr/local/gstreamer/depend/bin:$PATH
export PKG_CONFIG_PATH=/usr/local/gstreamer/depend/lib/pkgconfig:/usr/local/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH
https://blog.csdn.net/w5550/article/details/120988196
原文链接:https://blog.csdn.net/w5550/article/details/120989847