GstRtspSink - RTSP over HTTP Tunneling

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page



Previous: Multicast Index Next: Basic_Authentication



RTSP over HTTP tunneling helps clients reach a stream through restrictive networks that block direct RTSP transport. GstRtspSink does not need special server-side pipeline changes for this. The client requests the tunnel when supported.

What RTSP over HTTP tunneling does

RTSP over HTTP tunneling wraps RTSP traffic so it can pass through environments where plain RTSP is restricted. This is useful in enterprise, campus, and proxy-controlled networks where direct RTSP traffic may fail.

Server-side setup

No changes are required on the server-side to stream through HTTP tunneling, the feature is enabled on the client side. The following pipeline is an example that should work with HTTP tunneling:

gst-launch-1.0 videotestsrc ! x264enc ! video/x-h264, mapping=/stream1  ! rtspsink service=5000

Client-side setup

The tunnel is typically enabled in the client. For example, VLC exposes a setting to tunnel RTP and RTSP over HTTP and to use the RTSP service port.

HTTP Tunneling with VLC client

VLC has the ability to encapsulate RTSP over HTTP tunneling. First you have to configure the HTTP connection and HTTP tunnel port number as follows:

 -> 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

HTTP Tunneling with GStreamer client

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

Deployment guidance

  • Validate both tunneled and direct RTSP paths
  • Document the client configuration clearly
  • Verify proxy and firewall behavior in the real target network
  • Measure the added latency if low-latency operation is critical

Summary

When direct RTSP is blocked, RTSP over HTTP tunneling is often the simplest compatibility fallback. The main work is usually client-side configuration and deployment testing.


Problems running the examples on this page? See GStreamer Debugging for practical debugging steps.

Related pages

FAQ

Does GstRtspSink require a different pipeline for HTTP tunneling?
Usually no. The client is the component that requests the tunnel.
When should I test HTTP tunneling?
Test it when the stream must cross corporate, campus, or proxy-controlled networks.



Previous: Multicast Index Next: Basic_Authentication