Skip to content

Instantly share code, notes, and snippets.

@devSarry
Created September 14, 2018 10:34
Show Gist options
  • Save devSarry/c62abb6eadd152702c20df75173f134d to your computer and use it in GitHub Desktop.
Save devSarry/c62abb6eadd152702c20df75173f134d to your computer and use it in GitHub Desktop.

GStreamer setup

Requirments 1. RPI with camera (transceiver) 2. Linux/Unix machine (reciever)

Setting up the RPI transceiver

1. Install GStreamer

sudo apt-get install gstreamer1.0-tools \
  gstreamer1.0-plugins-base \
  gstreamer1.0-plugins-good \
  gstreamer1.0-plugins-bad \
  gstreamer1.0-plugins-ugly

2. Install rpicamsrc

Instructions can be found here https://github.com/thaytan/gst-rpicamsrc

sudo apt-get install autoconf automake libtool pkg-config libgstreamer1.0-dev \
 libgstreamer-plugins-base1.0-dev libraspberrypi-dev

git clone the repo

cd into the repoed project

./autogen.sh --prefix=/usr --libdir=/usr/lib/arm-linux-gnueabihf

sudo make

sudo make install

Setting up the linux reciever

Note I'm using Ubuntu 18.04

1. Install GStreamer

sudo apt-get install gstreamer1.0-tools \
  gstreamer1.0-plugins-base \
  gstreamer1.0-plugins-good \
  gstreamer1.0-plugins-bad \
  gstreamer1.0-plugins-ugly

Setting up the Stream

Get the reciever's IP address.

Then setup the reciever to listen for the streem on port 5000.

gst-launch-1.0 udpsrc port=5000 \
    ! gdpdepay \
    ! rtph264depay \
    ! avdec_h264 \
    ! videoconvert \
    ! autovideosink sync=false

From the reciever ssh into the RPI (transceiver) and first disable wireless power management.

edit and add to the file "wireless-power off"

sudo nano /etc/network/interfaces

Then reset networking

/etc/init.d/networking restart

and you can confirm it off with the command iwconfig

you should see something like

Power Management:off

Finally launch a camera stream from the RPI (transceiver)

gst-launch-1.0 rpicamsrc bitrate=1000000 \
    ! 'video/x-h264,width=640,height=480' \
    ! h264parse \
    ! queue \
    ! rtph264pay config-interval=1 pt=96 \
    ! gdppay \
    ! udpsink host=[INSERT_RECIVER_IP_ADDR] port=5000

You should see the stream pop up on the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment