Stream Video using Gstreamer RTSP Server.

Setup streaming server for stored media file.

Pratik Mungekar
2 min readAug 2, 2020
Photo by Scott Blake on Unsplash

What is RTSP

The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points

Wikipedia

G Streamer framework

GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes them, and exports them in another. The formats and processes can be changed in a plug and play fashion.

Wikipedia

We will stream the a video file using Gstreamer RTSP server, this streaming endpoint can be consumed by any RTSP client. This stream can be consumed using Deepstream pipeline, OpenCV library for ML inference and also by media player like VLC.

Setup RTSP server on Ubuntu 16:04.

Use below are command to install Gstreamer and RTSP server along with its dependencies.

If you want to deploy this on Docker container, then you can build image using below Dockerfile.

Gstramer supports plugin in C and python, in this example we will see C program to create RTSP streaming endpoint.

To create docker container on local machine use below command. To consume stream endpoint will be available to rtsp://127.0.0.1:8554/test

sudo docker run -d -p 8554:8554 dockerpratik/rtsp-server:v1

To build the image locally above Dockerfile and code can be used, below Git repository can be used a s reference.

Thank you for taking time and go through the blog, hope it helps you save some time for setting up streaming server.

Let me know if you have any queries or feedback.

--

--