ubuntu16.04上安装gstreamer

时间:2019-09-14
本文章向大家介绍ubuntu16.04上安装gstreamer,主要包括ubuntu16.04上安装gstreamer使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1、apt-get安装

参照https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c上安装指令,安装失败,提示如下

 使用ubuntu16.04的原生源和清华源都试过,不行,换第二种方法

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

原文地址:https://www.cnblogs.com/walker-lin/p/11520064.html