Git Product home page Git Product logo

rtsp-server-rpi-gstreamer's Introduction

page title tags date
GStreamer RTSP Raspberry Pi Camera
raspberry gstreamer pi stream rtsp
2018-12-26

Overview

This is a new route using gstreamer to get a working secure RTSP server running on a Raspberry Pi. Uses the gst-rtsp-server library with a simple wrapper server.

The previous attempt using the v4l2-rtsp-server project wasn't reliable (frequent frame drops and connection loss).

Setup

  • Download Raspian image
  • Flash with Etcher

Prep Headless Config

  • Open /boot partition on host
  • Create empty file ssh to enable ssh
  • Create file wpa_supplicant.conf to enable wifi
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CA

network={
    ssid="«your_SSID»"
    psk="«your_PSK»"
    key_mgmt=WPA-PSK
}
  • Edit config.txt to enable camera
start_x=1
gpu_mem=256
disable_camera_led=1
  • Put the sd card into pi and boot
  • SSH to pi
  • Set secure password and setup public key based SSH auth (~/.ssh/authorized_keys)

Requirements

Install Docker as described here: https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/

curl -sSL https://get.docker.com | sh

GStreamer Build

Checkout this repo to /opt/raspi-rtsp

GStreamer 1.14 build process is encapsulated in a Docker environment.

Run build-gst.sh to compile the GStreamer binaries into /opt/gstreamer

Server App

Service

Add rtsp-server.service to /etc/systemd/system/rtsp-server.service

Load the SystemD module

sudo systemctl enable rtsp-server
sudo systemctl daemon-reload
sudo systemctl start rtsp-server
sudo systemctl status rtsp-server

Check logs with

sudo journalctl -u rtsp-server

Client

Play with ffplay or other client

ffplay \
  -rtsp_transport udp \
  -sync ext \
  -fflags nobuffer \
  -framedrop \
  rtsp://user:[email protected]:8554/stream

References:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.