GstRtspSink - Live File Streaming: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{GstRtspSink Page|TODO|TODO|
{{GstRtspSink/Head|previous=Multicast+Authentication|next=Dual_Multicast|metakeywords=}}
 
This wiki provides an example to live-stream a video recording through RTSP using GstRtspSink.
This wiki provides an example to live-stream a video recording through RTSP using GstRtspSink.
 
<br>
__TOC__
<br>
 
<table>
<tr>
<td><div class="clear; float:right">__TOC__</div></td>
<td valign=top>
{{GStreamer debug}}
</td>
</table>
== GstRtspSink Pipeline ==
== GstRtspSink Pipeline ==


The following pipeline takes a MP4 file containing a H264 video and a AAC audio elementary streams, and streams them through RTSP using GstRtspSink.
The following pipeline takes a MP4 file containing a H264 video and a AAC audio elementary streams and streams them through RTSP using GstRtspSink.


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 13: Line 20:
FILE=/var/media/videos/recording.mp4
FILE=/var/media/videos/recording.mp4


gst-launch-1.0 rtspsink name=sink port=${PORT} appsink0::sync=true appsink1::sync=true \
gst-launch-1.0 rtspsink name=sink service=${PORT} appsink0::sync=true appsink1::sync=true qtdemux name=demux \
filesrc location=${FILE} ! demux. \
filesrc location=${FILE} ! demux. \
demux. ! mpegaudioparse ! audio/mpeg,mapping=${MAPPING} ! sink. \
demux. ! queue ! aacparse ! audio/mpeg,mapping=${MAPPING} ! sink. \
demux. ! mpegvideoparse ! video/mpeg,mapping=${MAPPING} ! sink.  
demux. ! queue ! h264parse ! video/x-h264,mapping=${MAPPING} ! sink.  
</syntaxhighlight>
</syntaxhighlight>


== RTSP Clients ==
== RTSP Clients ==
Line 34: Line 40:


<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


gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING} name=src \
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING} name=src \
src. ! rtpmp4vdepay ! mpegvideoparse ! avdec_mpeg4 ! queue ! autovideosink \
src. ! rtph264depay ! h264parse ! avdec_h264 ! queue ! autovideosink \
src. ! rtpmp4adepay ! mpegaudioparse ! avdec_aac ! queue ! autoaudiosink
src. ! rtpmp4adepay ! aacparse ! avdec_aac ! queue ! autoaudiosink
</syntaxhighlight>
</syntaxhighlight>


Line 46: Line 52:


<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 56: Line 62:


<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 62: Line 68:
totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}
totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}
</syntaxhighlight>
</syntaxhighlight>
}}
 
 
{{GstRtspSink/Foot|previous=Multicast+Authentication|next=Dual_Multicast}}

Latest revision as of 21:56, 25 April 2024



Previous: Multicast+Authentication Index Next: Dual_Multicast




This wiki provides an example to live-stream a video recording 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 takes a MP4 file containing a H264 video and a AAC audio elementary streams and streams them through RTSP using GstRtspSink.

PORT=12345
MAPPING=/stream
FILE=/var/media/videos/recording.mp4

gst-launch-1.0 rtspsink name=sink service=${PORT} appsink0::sync=true appsink1::sync=true qtdemux name=demux \
filesrc location=${FILE} ! demux. \
demux. ! queue ! aacparse ! audio/mpeg,mapping=${MAPPING} ! sink. \
demux. ! queue ! h264parse ! video/x-h264,mapping=${MAPPING} ! sink.

RTSP Clients

VLC

IP_ADDRESS=192.0.0.1
PORT=12345
MAPPING=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} name=src \
src. ! rtph264depay ! h264parse ! avdec_h264 ! queue ! autovideosink \
src. ! rtpmp4adepay ! aacparse ! avdec_aac ! queue ! autoaudiosink

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: Multicast+Authentication Index Next: Dual_Multicast