GstRtspSink - Transport Stream RTSP Streaming: Difference between revisions

From RidgeRun Developer Wiki
mNo edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{GstRtspSink/Head|previous=Audio+Video_Streaming_Plus_H264_Single_Streaming|next=Multicast+Authentication|keywords=}}
{{GstRtspSink/Head|previous=Audio+Video_Streaming_Plus_H264_Single_Streaming|next=Multicast+Authentication|metakeywords=}}


This wiki provides an example to send MPEG-TS through RTSP using GstRtspSink.
<br>
<br>
<table>
<tr>
<td><div class="clear; float:right">__TOC__</div></td>
<td valign=top>
{{GStreamer debug}}
{{GStreamer debug}}
 
</td>
<br>
</table>
 
This wiki provides an example to send MPEG-TS through RTSP using GstRtspSink.


== GstRtspSink Pipeline ==
== GstRtspSink Pipeline ==


The following pipeline combines takes an MPEG4 stream, encapsulates it in a Transport Stream container and sends it via RTSP.
The following pipeline combines takes an MPEG4 stream, encapsulates it in a Transport Stream container, and sends it via RTSP.
 
<br>
<pre style="background-color:yellow">
{{Ambox
This example may fail in GStreamer version lower than 1.8 due to a bug in the TS muxer
|type=notice
</pre>
|small=left
 
|issue='''This example may fail in GStreamer version lower than 1.8 due to a bug in the TS muxer.'''
|style=width:unset;
}}
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
PORT=12345
PORT=12345
MAPPING=/stream
MAPPING=/stream


gst-launch-1.0 v4l2src ! avenc_mpeg4 ! mpeg4videoparse ! mpegtsmux ! capsfilter caps="video/mpegts, mapping=${MAPPING}" ! rtspsink name=sink service=$PORT
gst-launch-1.0 v4l2src ! queue ! videoconvert ! avenc_mpeg4 ! mpeg4videoparse ! mpegtsmux ! capsfilter caps="video/mpegts, mapping=${MAPPING}" ! rtspsink name=sink service=$PORT
</syntaxhighlight>
</syntaxhighlight>


== RTSP Clients ==
== RTSP Clients ==
Line 27: Line 33:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
IP_ADDRESS=192.0.0.1
IP_ADDRESS=127.0.0.1
PORT=12345
PORT=12345
MAPPING1=stream
MAPPING1=stream
Line 37: Line 43:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
IP_ADDRESS=192.0.0.1
IP_ADDRESS=127.0.0.1
PORT=12345
PORT=12345
MAPPING=stream
MAPPING=stream
Line 47: Line 53:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
IP_ADDRESS=192.0.0.1
IP_ADDRESS=127.0.0.1
PORT=12345
PORT=12345
MAPPING=stream
MAPPING=stream
Line 57: Line 63:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
IP_ADDRESS=192.0.0.1
IP_ADDRESS=127.0.0.1
PORT=12345
PORT=12345
MAPPING=stream
MAPPING=stream

Latest revision as of 21:46, 25 April 2024



Previous: Audio+Video_Streaming_Plus_H264_Single_Streaming Index Next: Multicast+Authentication




This wiki provides an example to send MPEG-TS through RTSP using GstRtspSink.

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

GstRtspSink Pipeline

The following pipeline combines takes an MPEG4 stream, encapsulates it in a Transport Stream container, and sends it via RTSP.

PORT=12345
MAPPING=/stream

gst-launch-1.0 v4l2src ! queue ! videoconvert ! avenc_mpeg4 ! mpeg4videoparse ! mpegtsmux ! capsfilter caps="video/mpegts, mapping=${MAPPING}" ! rtspsink name=sink service=$PORT

RTSP Clients

VLC

IP_ADDRESS=127.0.0.1
PORT=12345
MAPPING1=stream

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

GStreamer

IP_ADDRESS=127.0.0.1
PORT=12345
MAPPING=stream

gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING} ! rtpmp2tdepay ! tsdemux ! mpeg4videoparse ! avdec_mpeg4 ! queue ! autovideosink

MPlayer

IP_ADDRESS=127.0.0.1
PORT=12345
MAPPING=stream

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

Totem

IP_ADDRESS=127.0.0.1
PORT=12345
MAPPING=stream

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



Previous: Audio+Video_Streaming_Plus_H264_Single_Streaming Index Next: Multicast+Authentication