Create an RTSP stream and stream to many clients

From The Imaging Source Knowledgebase
Jump to navigation Jump to search

To stream from a TIS camera to multiple computers, an RTSP server can be used. A simple, functioning RTSP server is available at https://github.com/RSATom/RtspRestreamServer. While the build instructions are easy to follow and running the server is quite simple, the TLS stuff is somewhat strange.

A pipeline for streaming from The Imaging Source cameras is:

With live display

gst-launch-1.0 tcambin serial=04919935 ! video/x-raw, format=BGRx,width=640,height=480 ! tee name=t t. ! queue max-size-buffers=2 leaky=1 ! videoconvert ! x264enc speed-preset=superfast ! rtspclientsink location=rtsp://localhost:8001/test?record sync=false t. ! queue max-size-buffers=2 leaky=1 ! videoconvert ! xvimagesink

Without live display

gst-launch-1.0 tcambin serial=04919935 ! video/x-raw, format=BGRx,width=640,height=480 ! videoconvert ! x264enc speed-preset=superfast ! rtspclientsink location=rtsp://localhost:8001/test?record sync=false

VLC can be used in a simple way, without the sdp file. The delay between capture and display on another computer depends on the image size. At 640x480 resolution it was 1~2 seconds.

The RTSP Server is external software which The Imaging Source does not provide support for, but it is, nevertheless, a good example.

A Raspberry PI5 could be fast enough for hosting this server.