树莓派之安装GStreamer与gst-omx教程

Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.4 (stretch)
Release:    9.4
Codename:   stretch
# /etc/apt/sources.list
deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
################# COMPILE GSTREAMER 1.10 ############


# Update and Upgrade the Pi, otherwise the build may fail due to inconsistencies

sudo apt-get update && sudo apt-get upgrade -y

# Get the required libraries
sudo apt-get install -y build-essential autotools-dev automake autoconf \
            libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \
            pkg-config bison flex python git gtk-doc-tools libasound2-dev \
            libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \
            libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \
            libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \
            libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \
            libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \
            libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \
            libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \
            libcurl4-gnutls-dev libdca-dev libdirac-dev libdvdnav-dev \
            libexempi-dev libexif-dev libfaad-dev libgme-dev libgsm1-dev \
            libiptcdata0-dev libkate-dev libmimic-dev libmms-dev \
            libmodplug-dev libmpcdec-dev libofa0-dev libopus-dev \
            librsvg2-dev librtmp-dev libschroedinger-dev libslv2-dev \
            libsndfile1-dev libsoundtouch-dev libspandsp-dev libx11-dev \
            libxvidcore-dev libzbar-dev libzvbi-dev liba52-0.7.4-dev \
            libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev \
            libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev \
            libsidplay1-dev libtwolame-dev libx264-dev

cd $HOME
mkdir packages
cd packages/
mkdir gstreamer-1.10
cd gstreamer-1.10


git clone https://github.com/GStreamer/gstreamer
cd gstreamer
git checkout -t origin/1.10
./autogen.sh
make
sudo make install
cd ..


git clone https://github.com/GStreamer/gst-plugins-base
cd gst-plugins-base
git checkout -t origin/1.10
./autogen.sh
make
sudo make install
cd ..


git clone https://github.com/GStreamer/gst-plugins-good
cd gst-plugins-good
git checkout -t origin/1.10
./autogen.sh
make
sudo make install
cd ..


git clone https://github.com/GStreamer/gst-plugins-ugly
cd gst-plugins-ugly
git checkout -t origin/1.10
./autogen.sh
make
sudo make install
cd ..


git clone https://github.com/GStreamer/gst-libav
cd gst-libav
git checkout -t origin/1.10
./autogen.sh
make
sudo make install
cd ..


git clone https://github.com/GStreamer/gst-plugins-bad

# Install libusb-1.0 to enable  uvch264src
sudo apt-get install libusb-1.0

cd gst-plugins-bad
git checkout -t origin/1.10
export LD_LIBRARY_PATH=/usr/local/lib/ path
LDFLAGS='-L/opt/vc/lib' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' ./autogen.sh
make CFLAGS+="-Wno-error"
sudo make install
cd ..

################# COMPILE GST-OMX ##########


git clone https://github.com/GStreamer/gst-omx
cd gst-omx
git checkout -t origin/1.10
LDFLAGS='-L/opt/vc/lib' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' ./autogen.sh --with-omx-target=rpi
make CFLAGS+="-Wno-error"
sudo make install

Hardware-accelerated video playback on the Raspberry Pi

https://wiki.matthiasbock.net/index.php/Hardware-accelerated_video_playback_on_the_Raspberry_Pi
// add the following line to /etc/apt/sources.list
deb http://vontaene.de/raspbian-updates/ . main

apt-get update
apt-get install libgstreamer1.0-0-dbg gstreamer1.0-tools libgstreamer-plugins-base1.0-0 \
  gstreamer1.0-plugins-good gstreamer1.0-plugins-bad-dbg gstreamer1.0-omx gstreamer1.0-alsa
gst-launch-1.0 playbin uri=big_buck_bunny.avi