Difference between revisions of "GstRtspSink - Dual H264 Video Streaming"

From RidgeRun Developer Connection
Jump to: navigation, search
m
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{GstRtspSink Page|TODO|TODO|
+
{{GstRtspSink/Head|previous=Advanced examples|next=Audio+Video_Streaming|metakeywords=}}
 +
 
 
This wiki provides a dual H264 streaming example using GstRtspSink.
 
This wiki provides a dual H264 streaming example 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 ==
Line 11: Line 19:
 
PORT=12345
 
PORT=12345
 
MAPPING1=/stream1
 
MAPPING1=/stream1
 +
MAPPING2=/stream2
  
 
gst-launch-1.0 rtspsink name=sink service=$PORT \
 
gst-launch-1.0 rtspsink name=sink service=$PORT \
v4l2src ! x264enc ! capsfilter caps="video/x-h264, mapping=${MAPPING1}" ! sink.
+
v4l2src ! x264enc tune=zerolatency ! h264parse ! capsfilter caps="video/x-h264, mapping=${MAPPING1}" ! sink. \
videotestsrc ! x264enc ! capsfilter caps="video/x-h264, mapping=${MAPPING2}" ! sink.
+
videotestsrc ! x264enc tune=zerolatency ! h264parse ! capsfilter caps="video/x-h264, mapping=${MAPPING2}" ! sink.
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
== RTSP Clients ==
 
== RTSP Clients ==
Line 24: Line 32:
 
IP_ADDRESS=192.0.0.1
 
IP_ADDRESS=192.0.0.1
 
PORT=12345
 
PORT=12345
MAPPING1=/stream1
+
MAPPING1=stream1
MAPPING2=/stream2
+
MAPPING2=stream2
  
 
# Stream 1
 
# Stream 1
Line 39: Line 47:
 
IP_ADDRESS=192.0.0.1
 
IP_ADDRESS=192.0.0.1
 
PORT=12345
 
PORT=12345
MAPPING1=/stream1
+
MAPPING1=stream1
MAPPING2=/stream2
+
MAPPING2=stream2
  
 
# Stream 1
 
# Stream 1
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING1} ! rtph264depay ! avdec_h264 ! queue ! autovideosink
+
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING1} ! rtph264depay ! h264parse ! avdec_h264 ! queue ! autovideosink
  
 
# Stream 2
 
# Stream 2
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2} ! rtph264depay ! avdec_h264 ! queue ! autovideosink
+
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2} ! rtph264depay ! h264parse ! avdec_h264 ! queue ! autovideosink
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 54: Line 62:
 
IP_ADDRESS=192.0.0.1
 
IP_ADDRESS=192.0.0.1
 
PORT=12345
 
PORT=12345
MAPPING1=/stream1
+
MAPPING1=stream1
MAPPING2=/stream2
+
MAPPING2=stream2
  
 
# Stream 1
 
# Stream 1
Line 69: Line 77:
 
IP_ADDRESS=192.0.0.1
 
IP_ADDRESS=192.0.0.1
 
PORT=12345
 
PORT=12345
MAPPING1=/stream1
+
MAPPING1=stream1
MAPPING2=/stream2
+
MAPPING2=stream2
  
 
# Stream 1
 
# Stream 1
Line 78: Line 86:
 
totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2}
 
totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2}
 
</syntaxhighlight>
 
</syntaxhighlight>
}}
+
 
 +
 
 +
{{GstRtspSink/Foot|previous=Advanced examples|next=Audio+Video_Streaming}}

Latest revision as of 12:16, 25 February 2023


Previous: Advanced examples Index Next: Audio+Video_Streaming




This wiki provides a dual H264 streaming example using GstRtspSink.

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

GstRtspSink Pipeline

The following pipeline sends two different H264 streams through two different mappings: stream1 and stream2. Any of them can be accessed independently.

PORT=12345
MAPPING1=/stream1
MAPPING2=/stream2

gst-launch-1.0 rtspsink name=sink service=$PORT \
v4l2src ! x264enc tune=zerolatency ! h264parse ! capsfilter caps="video/x-h264, mapping=${MAPPING1}" ! sink. \
videotestsrc ! x264enc tune=zerolatency ! h264parse ! capsfilter caps="video/x-h264, mapping=${MAPPING2}" ! sink.

RTSP Clients

VLC

IP_ADDRESS=192.0.0.1
PORT=12345
MAPPING1=stream1
MAPPING2=stream2

# Stream 1
vlc rtsp://${IP_ADDRESS}:${PORT}/${MAPPING1}

# Stream 2
vlc rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2}

GStreamer

IP_ADDRESS=192.0.0.1
PORT=12345
MAPPING1=stream1
MAPPING2=stream2

# Stream 1
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING1} ! rtph264depay ! h264parse ! avdec_h264 ! queue ! autovideosink

# Stream 2
gst-launch-1.0 rtspsrc location=rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2} ! rtph264depay ! h264parse ! avdec_h264 ! queue ! autovideosink

MPlayer

IP_ADDRESS=192.0.0.1
PORT=12345
MAPPING1=stream1
MAPPING2=stream2

# Stream 1
mplayer rtsp://${IP_ADDRESS}:${PORT}/${MAPPING1}

# Stream 2
mplayer rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2}

Totem

IP_ADDRESS=192.0.0.1
PORT=12345
MAPPING1=stream1
MAPPING2=stream2

# Stream 1
totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING1}

# Stream 2
totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING2}



Previous: Advanced examples Index Next: Audio+Video_Streaming