Skip to content

Instantly share code, notes, and snippets.

@stjohnjohnson
Last active October 28, 2015 21:36
Show Gist options
  • Save stjohnjohnson/763d6799ce573e8113d8 to your computer and use it in GitHub Desktop.
Save stjohnjohnson/763d6799ce573e8113d8 to your computer and use it in GitHub Desktop.
2015-10-28 Blog post on stj.me
sudo apt-get install gstreamer1.0-alsa gstreamer1.0-clutter gstreamer1.0-doc gstreamer1.0-fluendo-mp3 \
gstreamer1.0-gnonlin gstreamer1.0-libav gstreamer1.0-nice gstreamer1.0-omx \
gstreamer1.0-packagekit gstreamer1.0-plugins-bad gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \
gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-vaapi gstreamer1.0-x \
libgstreamer1.0-0 libgstreamer1.0-0-dbg libgstreamer1.0-dev
$ gst-launch-1.0 souphttpsrc location="http://username\@ipcamera1/videostream.asf\?user=username\&pwd=password" ! decodebin name=decoder decoder. ! clockoverlay ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! matroskamux name=mux ! filesink location=/tmp/foo.mkv decoder. ! audioconvert ! lamemp3enc ! mux.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
**
ERROR:gstomxvideoenc.c:1060:gst_omx_video_enc_set_format: code should not be reached
Aborted
make[2]: Entering directory '/home/pi/packages/gstreamer-1.6/gst-omx/examples'
Making all in egl
make[3]: Entering directory '/home/pi/packages/gstreamer-1.6/gst-omx/examples/egl'
CC testegl-testegl.o
testegl.c: In function ‘init_textures’:
testegl.c:734:37: error: ‘GL_RGBA8’ undeclared (first use in this function)
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, meta->width, meta->height, 0,
^
testegl.c:734:37: note: each undeclared identifier is reported only once for each function it appears in
testegl.c: In function ‘query_cb’:
testegl.c:1081:14: error: too few arguments to function ‘gst_gl_handle_context_query’
return gst_gl_handle_context_query (state->pipeline, query,
^
In file included from /usr/local/include/gstreamer-1.0/gst/gl/gl.h:35:0,
from testegl.c:61:
/usr/local/include/gstreamer-1.0/gst/gl/gstglutils.h:102:10: note: declared here
gboolean gst_gl_handle_context_query (GstElement * element, GstQuery * query,
^
Makefile:509: recipe for target 'testegl-testegl.o' failed
#!/bin/bash -ex
# Create a log file of the build as well as displaying the build on the tty as it runs
exec > >(tee build_gstreamer.log)
exec 2>&1
################# COMPILE GSTREAMER 1.6 ############
# Update and Upgrade the Pi, otherwise the build may fail due to inconsistencies
sudo apt-get update && sudo apt-get upgrade -y --force-yes
# Remove some libraries
sudo apt-get remove -y --force-yes gstreamer0.10-alsa gstreamer0.10-plugins-base gstreamer1.0-alsa \
gstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x \
libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base0.10-0 \
libgstreamer-plugins-base1.0-0 libgstreamer0.10-0 libgstreamer1.0-0 \
libreoffice-avmedia-backend-gstreamer
# Get the required libraries
sudo apt-get install -y --force-yes 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 -p packages/gstreamer-1.6
cd packages/gstreamer-1.6
git clone git://anongit.freedesktop.org/git/gstreamer/gstreamer
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-base
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-good
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-bad
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-ugly
git clone git://anongit.freedesktop.org/git/gstreamer/gst-libav
git clone git://anongit.freedesktop.org/git/gstreamer/gst-omx
cd gstreamer
git checkout -t origin/1.6
./autogen.sh
make
sudo make install
cd ..
cd gst-plugins-base
git checkout -t origin/1.6
./autogen.sh
make
sudo make install
cd ..
cd gst-plugins-good
git checkout -t origin/1.6
./autogen.sh
make
sudo make install
cd ..
cd gst-plugins-ugly
git checkout -t origin/1.6
./autogen.sh
make
sudo make install
cd ..
cd gst-libav
git checkout -t origin/1.6
./autogen.sh
make
sudo make install
cd ..
# Install libusb-1.0 to enable uvch264src
sudo apt-get install -y --force-yes libusb-1.0
sudo ldconfig
cd gst-plugins-bad
git checkout -t origin/1.6
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 ..
cd gst-omx
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment