GstRtspSink - RTSP over HTTP Tunneling
This page describes how to use the RTSP HTTP tunneling capabilities of GstRtspSink.
RTSP HTTP Tunneling
HTTP tunneling is used to hide RTSP communications through the HTTP protocol. This allows RTSP streaming in restricted network conditions, such as strict firewall configurations or proxy servers. The client is in charge of initiating the HTTP tunneling requests, meaning that there is no special configuration on the server-side.
Initiating HTTP Tunneling
There is no special configuration required in the GstRtspSink to allow HTTP tunneling. It is up to the client to request the tunnel or not. The following sections show how to request HTTP tunneling from two standard clients: VLC and GStreamer. Both examples will use the same server pipeline:
gst-launch-1.0 videotestsrc ! x264enc ! video/x-h264, mapping=/stream1 ! rtspsink service=5000
VLC
VLC has the ability to encapsulate RTSP over HTTP tunneling. First you have to configure the HTTP connection and HTTP tunnel port number as follow:
-> Tools -> Preferences -> All -> Input / Codecs -> Demuxers -> RTP/RTSP
Enable the "Tunnel RTP and RTSP over HTTP" option and set the appropriate port used for the RTSP stream (PORT).
After that, when using VLC as a client the streaming will be requested to be HTTP tunneled.
SERVER_IP=localhost PORT=5000 MAPPING=stream1 vlc rtsp://$SERVER_IP:$PORT/$MAPPING
GStreamer
To initiate HTTP tunneling from GstRtspSrc, the rtsph URI protocol should be used. Consider the following example:
SERVER_IP=localhost PORT=5000 MAPPING=stream1 gst-launch-1.0 rtspsrc location="rtsph://$SERVER_IP:$PORT/$MAPPING" ! rtph264depay ! decodebin ! autovideosink
You can also use the following pipeline as alternative.
SERVER_IP=localhost PORT=5000 MAPPING=stream1 gst-launch-1.0 rtspsrc location="rtsph://$SERVER_IP:$PORT/$MAPPING" buffer-size=150000 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink