關於 GStreamer 及 raspberry-pi Streaming Server

本版討論物聯網 IoT Platform 技術與應用
回覆文章
inho
文章: 42
註冊時間: 2017-12-08, 23:00

關於 GStreamer 及 raspberry-pi Streaming Server

文章 inho » 2018-02-18, 07:15

一、Building Gstreamer 1.2 from source
參考網站:
http://kacianka.at/misc/gstreamer_build.sh
Building Gstreamer 1.2 from source
其他參考網站:
http://wiki.oz9aec.net/index.php/Buildi ... rom_source
https://gist.github.com/Brainiarc7/9f9b ... c80841cadc
https://www.jianshu.com/p/7863404c1909
http://artistehsu.pixnet.net/blog/post/ ... F%E7%94%A8

在User HOME 目錄下,建置 GStreamer目錄,$HOME/GStreamer/ 之下並建置 $HOME/GStreamer/src 及 $HOME/GStreamer/build 子目錄。
用 vi 或其他編輯工具,編輯以下執行檔的 Script (gstreamer_build.sh)存放在 $HOME/GStreamer/ 下:$HOME/GStreamer/gstreamer_build.sh
安裝本GStreamer 時的版本為 gstreamer-1.13.1, (可上官方網站查看最新版本 http://gstreamer.freedesktop.org/src/gstreamer/)
==============================================================================
#!/bin/bash

# you might need these additonal packages:
apt-get install bison flex libusb-1.0-0-dev libgudev-1.0-dev libxv-dev

# from http://lists.freedesktop.org/archives/g ... 00724.html
apt-get install build-essential autotools-dev automake autoconf libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev pkg-config bison flex python
apt-get install 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
# source: http://gstreamer.freedesktop.org/wiki/H ... orEmbedded
#
# to build with libav support
apt-get install libavutil-dev
apt-get install yasm
#
# and for our stream.sh script:
apt-get install inotify-tools
#
# For reference: there is also an ppa, but it currently seems to only offer gstreamer 1.0,
# which does not include uvch264src
# add-apt-repository ppa:gstreamer-developers/ppa
# apt-get update
# apt-get install gstreamer1.0*

SOURCE=$HOME/GStreamer/src
BUILD=$HOME/GStreamer/build
if [ ! -d "$SOURCE" ]; then
mkdir $SOURCE
fi
if [ ! -d "$BUILD" ]; then
mkdir $BUILD
fi

cd $SOURCE
wget http://gstreamer.freedesktop.org/src/gs ... 3.1.tar.xz
tar -xJf gstreamer-1.13.1.tar.xz
wget http://gstreamer.freedesktop.org/src/or ... .28.tar.xz
tar -xJf orc-0.4.28.tar.xz
wget http://gstreamer.freedesktop.org/src/gs ... 3.1.tar.xz
tar -xJf gst-plugins-base-1.13.1.tar.xz
wget http://gstreamer.freedesktop.org/src/gs ... 3.1.tar.xz
tar -xJf gst-plugins-good-1.13.1.tar.xz
wget http://gstreamer.freedesktop.org/src/gs ... 3.1.tar.xz
tar -xJf gst-plugins-ugly-1.13.1.tar.xz
wget http://gstreamer.freedesktop.org/src/gs ... 3.1.tar.xz
tar -xJf gst-plugins-bad-1.13.1.tar.xz
wget http://gstreamer.freedesktop.org/src/gs ... 3.1.tar.xz
tar -xJf gst-libav-1.13.1.tar.xz

cd gstreamer-1.13.1
./configure --prefix=$BUILD
make -j2
make install

cd ../orc-0.4.28
./configure --prefix=$BUILD
make -j2
make install

cd ../gst-plugins-base-1.13.1
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure --prefix=$BUILD --enable-orc --with-x
make -j2
make install

cd ../gst-plugins-good-1.13.1
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure --prefix=$BUILD --enable-orc --with-libv4l2 --with-x
make -j2
make install

cd ../gst-plugins-ugly-1.13.1
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure --prefix=$BUILD --enable-orc
make -j2
make install

cd ../gst-plugins-bad-1.13.1
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure --prefix=$BUILD --enable-orc
make -j2
make install

cd ../gst-libav-1.13.1
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure --prefix=$BUILD --enable-orc
make -j2
make install


echo
echo "GStreamer 1.13.1 installed sucessfully!"
echo

# to completly remove gstreamer, simpely delete the two directories:
# rm -rf $SOURCE
# rm -rf $BUILD

# to use this version of gstreamer, add it to your PATH:
# echo -e "\n\n#Path for a local version of gstreamer\nPATH=\"$BUILD/bin:\$PATH\"" >> $HOME/.profile

================================================================================
完成後存檔,並更改檔案屬性為可執行:
$ chmod 755 gstreamer_build.sh
執行 gstreamer_build.sh
$ ./gstreamer_build.sh
過程要花一些時間,顯示很多安裝過程的資訊,可能會有錯誤資訊

最後會出現以下訊息:
GStreamer 1.13.1 installed sucessfully!
用以下指令 Check 安裝的套件:
$ dpkg -l | grep gstreamer
ii gstreamer0.10-alsa:armhf 0.10.36-2 armhf GStreamer plugin for ALSA
ii gstreamer0.10-plugins-base:armhf 0.10.36-2 armhf GStreamer plugins from the "base" set
ii gstreamer1.0-alsa:armhf 1.10.4-1 armhf GStreamer plugin for ALSA
ii gstreamer1.0-libav:armhf 1.10.4-1 armhf libav plugin for GStreamer
ii gstreamer1.0-omx 1.10.4-1+rpt3 armhf GStreamer OpenMAX plugins
ii gstreamer1.0-omx-rpi 1.10.4-1+rpt3 armhf OpenMax plugins for GStreamer
ii gstreamer1.0-omx-rpi-config 1.10.4-1+rpt3 armhf OpenMax plugins for GStreamer
ii gstreamer1.0-plugins-bad:armhf 1.10.4-1 armhf GStreamer plugins from the "bad" set
ii gstreamer1.0-plugins-base:armhf 1.10.4-1 armhf GStreamer plugins from the "base" set
ii gstreamer1.0-plugins-good:armhf 1.10.4-1 armhf GStreamer plugins from the "good" set
ii gstreamer1.0-x:armhf 1.10.4-1 armhf GStreamer plugins for X11 and Pango
ii libgstreamer-plugins-bad1.0-0:armhf 1.10.4-1 armhf GStreamer development files for libraries from the "bad" set
ii libgstreamer-plugins-base0.10-0:armhf 0.10.36-2 armhf GStreamer libraries from the "base" set
ii libgstreamer-plugins-base1.0-0:armhf 1.10.4-1 armhf GStreamer libraries from the "base" set
ii libgstreamer0.10-0:armhf 0.10.36-1.5 armhf Core GStreamer libraries and elements
ii libgstreamer1.0-0:armhf 1.10.4-1 armhf Core GStreamer libraries and elements
ii libreoffice-avmedia-backend-gstreamer 1:5.2.7-1+rpi1 armhf GStreamer backend for LibreOffice

=========================
其他參考網站:
http://blog.csdn.net/jintaofu/article/details/51744706
****************************************************************************************

二、執行官方預設的安裝程式
參考網站:
https://gstreamer.freedesktop.org/documentation/
1、Setting Up The Raspberry Pi To Use gstreamer
You need to edit the sources.list file so enter:
$ sudo vi /etc/apt/sources.list
and add the following to the end of the file:
deb http://vontaene.de/raspbian-updates/ . main
然後,存檔並執行:
$ sudo apt-get update
Now install gstreamer (執行官方預設的安裝程式)
$ sudo apt-get install gstreamer1.0
$ sudo apt-get install gstreamer-tools

=======================================================
Using GStreamer
參考網站:
https://gstreamer.freedesktop.org/docum ... using.html

回覆文章