GstRtspSink - Simple Examples

From RidgeRun Developer Wiki



Previous: Independent_Stream_Control Index Next: Advanced examples




This wiki provides a series of simple examples for the different formats supported by GstRtspSink.

Problems running the pipelines shown on this page?
Please see our GStreamer Debugging guide for help.

GstRtspSink Pipelines

Single Video Streaming

MPEG4

gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! video/mpeg, mapping=/stream1  ! rtspsink service=5000

H264

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

H265

gst-launch-1.0 videotestsrc ! x265enc option-string="keyint=30:min-keyint=30:repeat-headers=1" ! video/x-h265, mapping=/stream1 ! rtspsink service=5000

VP8

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

VP9

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

Motion JPEG

gst-launch-1.0 videotestsrc ! jpegenc ! image/jpeg, mapping=/stream1  ! rtspsink service=5000

Single Audio Streaming

AAC

gst-launch-1.0 audiotestsrc ! voaacenc ! audio/mpeg, mapping=/stream1  ! rtspsink service=5000

AC3

gst-launch-1.0 audiotestsrc ! avenc_ac3 ! audio/x-ac3, mapping=stream1 ! rtspsink service=5000

PCMU

gst-launch-1.0 audiotestsrc ! mulawenc ! audio/x-mulaw, mapping=stream1 ! rtspsink service=5000

PCMA

gst-launch-1.0 audiotestsrc ! alawenc ! audio/x-alaw, mapping=stream1 ! rtspsink service=5000

OPUS

gst-launch-1.0 audiotestsrc ! opusenc ! audio/x-opus, mapping=stream1 ! rtspsink service=5000

Test observation :
You may not be able to play OPUS audio streaming at the client using VLC. Patching of the VLC source file live555.cpp is needed to resolve this issue. Reference.
It works fine with GStreamer playbin and totem player.

RTSP Clients

VLC

IP_ADDRESS=127.0.0.1
PORT=5000
MAPPING=/stream1

vlc rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}

VCL Observation

If you experience delay when using the VCL player, it might be because of the ~1sec buffering. Follow the instructions in the Modify Streaming Buffer wiki to decrease the streaming buffer.

GStreamer

IP_ADDRESS=127.0.0.1
PORT=5000
MAPPING=/stream1

gst-launch-1.0 playbin uri=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}

MPlayer

IP_ADDRESS=127.0.0.1
PORT=5000
MAPPING=/stream1

mplayer rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}

Totem

IP_ADDRESS=127.0.0.1
PORT=5000
MAPPING=/stream1

totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}



Previous: Independent_Stream_Control Index Next: Advanced examples