GstRtspSink - Multicast Audio Video: Difference between revisions
(Created page with "{{GstRtspSink Page| Dual Multicast| C Examples| {{GStreamer debug}} <br> This wiki provides an example to send...") |
|||
(13 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{GstRtspSink | {{GstRtspSink/Head|previous=Dual_Multicast|next=C Examples|metakeywords=}} | ||
{{Ambox | |||
|type=notice | |||
|issue=The multicast clients can't be on the same machine as the server. Please use at least 2 machines (one as a server and one as a client). | |||
}} | |||
<br> | |||
This wiki provides an example that combines a H264 video and an AAC audio stream into a single mapping and serves it to a multicast group. | |||
<br> | |||
<br> | |||
<table> | |||
<tr> | |||
<td><div class="clear; float:right">__TOC__</div></td> | |||
<td valign=top> | |||
{{GStreamer debug}} | {{GStreamer debug}} | ||
</td> | |||
< | </table> | ||
== GstRtspSink Pipeline == | == GstRtspSink Pipeline == | ||
The following | The following pipeline combines a H264 video and an AAC audio stream into a single mapping and serves it to a multicast group found between 239.255.255.253 and 239.255.255.255 and a port between 5000 and 6000. | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
Line 21: | Line 28: | ||
PORT_MAX=6000 | PORT_MAX=6000 | ||
TTL=128 | TTL=128 | ||
gst-launch-1.0 | gst-launch-1.0 rtspsink name=sink \ | ||
service=$PORT | service=$PORT multicast=true multicast-ip-min=${IP_MIN} multicast-ip-max=${IP_MAX} \ | ||
multicast-port-min=${PORT_MIN} multicast-port-max=${PORT_MAX} multicast-ttl=${TTL} | multicast-port-min=${PORT_MIN} multicast-port-max=${PORT_MAX} multicast-ttl=${TTL} \ | ||
v4l2src device=/dev/video0 ! "video/x-raw,width=640,height=480" ! queue ! videoconvert ! \ | |||
queue ! x264enc key-int-max=10 ! h264parse ! capsfilter caps="video/x-h264, mapping=${MAPPING}" ! sink. \ | |||
audiotestsrc ! queue ! audioconvert ! queue ! voaacenc ! aacparse ! capsfilter caps="audio/mpeg, mapping=${MAPPING}" ! sink. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== RTSP Clients == | == RTSP Clients == | ||
Line 35: | Line 41: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
IP_ADDRESS= | IP_ADDRESS=<IP ADDRESS OF HOST> | ||
PORT=12345 | PORT=12345 | ||
MAPPING=stream | MAPPING=stream | ||
vlc rtsp:// | vlc rtsp://${IP_ADDRESS}:${PORT}/${MAPPING} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 47: | Line 51: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
IP_ADDRESS= | IP_ADDRESS=<IP ADDRESS OF HOST> | ||
PORT=12345 | PORT=12345 | ||
MAPPING=stream | MAPPING=stream | ||
gst-launch-1.0 rtspsrc location=rtsp:// | 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 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 59: | Line 63: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
IP_ADDRESS= | IP_ADDRESS=<IP ADDRESS OF HOST> | ||
PORT=12345 | PORT=12345 | ||
MAPPING=stream | MAPPING=stream | ||
mplayer rtsp:// | mplayer rtsp://${IP_ADDRESS}:${PORT}/${MAPPING} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 71: | Line 73: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
IP_ADDRESS= | IP_ADDRESS=<IP ADDRESS OF HOST> | ||
PORT=12345 | PORT=12345 | ||
MAPPING=stream | MAPPING=stream | ||
totem rtsp:// | totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | |||
{{GstRtspSink/Foot|previous=Dual_Multicast|next=C Examples}} |
Latest revision as of 15:22, 2 May 2024
The multicast clients can't be on the same machine as the server. Please use at least 2 machines (one as a server and one as a client). |
This wiki provides an example that combines a H264 video and an AAC audio stream into a single mapping and serves it to a multicast group.
|
GstRtspSink Pipeline
The following pipeline combines a H264 video and an AAC audio stream into a single mapping and serves it to a multicast group found between 239.255.255.253 and 239.255.255.255 and a port between 5000 and 6000.
PORT=12345 MAPPING=/stream IP_MIN=239.255.255.253 IP_MAX=239.255.255.255 PORT_MIN=5000 PORT_MAX=6000 TTL=128 gst-launch-1.0 rtspsink name=sink \ service=$PORT multicast=true multicast-ip-min=${IP_MIN} multicast-ip-max=${IP_MAX} \ multicast-port-min=${PORT_MIN} multicast-port-max=${PORT_MAX} multicast-ttl=${TTL} \ v4l2src device=/dev/video0 ! "video/x-raw,width=640,height=480" ! queue ! videoconvert ! \ queue ! x264enc key-int-max=10 ! h264parse ! capsfilter caps="video/x-h264, mapping=${MAPPING}" ! sink. \ audiotestsrc ! queue ! audioconvert ! queue ! voaacenc ! aacparse ! capsfilter caps="audio/mpeg, mapping=${MAPPING}" ! sink.
RTSP Clients
VLC
IP_ADDRESS=<IP ADDRESS OF HOST> PORT=12345 MAPPING=stream vlc rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}
GStreamer
IP_ADDRESS=<IP ADDRESS OF HOST> 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=<IP ADDRESS OF HOST> PORT=12345 MAPPING=stream mplayer rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}
Totem
IP_ADDRESS=<IP ADDRESS OF HOST> PORT=12345 MAPPING=stream totem rtsp://${IP_ADDRESS}:${PORT}/${MAPPING}