gstreamer官网:https://gstreamer.freedesktop.org/
1、apt-get安装
安装指令和使用示例,参照https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c:
apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
部分包安装失败,提示如下
(在ubuntu18.04上是可以安装成功的)
验证:dpkg -l | grep gstreamer
2、源码安装
a)下载:
下载地址:https://gstreamer.freedesktop.org/src/
b)解压
xz -d gstreamer-1.16.0.tar.xz
tar -xvf gstreamer-1.16.0.tar
再依次解压
gst-plugins-base-1.16.0.tar.xz
gst-plugins-bad-1.16.0.tar.xz
gst-plugins-good-1.16.0.tar.xz
gst-plugins-ugly-1.16.0.tar.xz
gst-libav-1.16.0.tar.xz
c)编译
sudo apt-get install build-essential dpkg-dev flex bison autotools-dev automake liborc-dev autopoint libtool gtk-doc-tools libgstreamer1.0-dev
cd gstreamer-1.16.0
./configure
若提示错误:
解决:sudo apt-get install bison
再次执行./configure,若提示错误:
解决:sudo apt-get install flex
./configure
sudo make
sudo make install
在安装其他plugins前先配置环境变量:
sudo vim ~/.bashrc
添加PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
source ~/.bashrc
cd ..
cd gst-plugins-base-1.16.0
sudo apt-get install libxv-dev libasound2-dev libtheora-dev libogg-dev libvorbis-dev
./configure
sudo make
sudo make install
cd ..
cd gst-plugins-good-1.16.0
sudo apt-get install libbz2-dev libv4l-dev libvpx-dev libjack-jackd2-dev libsoup2.4-dev libpulse-dev
./configure
sudo make
sudo make install
cd ..
cd gst-plugins-bad-1.16.0
sudo apt-get install faad libfaad-dev libfaac-dev
./configure
sudo make
sudo make install
cd ..
cd gst-plugins-ugly-1.16.0
sudo apt-get install libx264-dev libmad0-dev
./configure
sudo make
sudo make install
cd ..
cd gst-libav-1.16.0
./configure, 报错
解决:sudo apt-get install yasm
./configure
sudo make
sudo make install
cd ..
sudo vim ~/.bashrc
添加LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH
source ~/.bashrc
验证:dpkg -l | grep gstreamer