Difference between revisions of "GstWebRTC - Audio + Video Examples - x86"

From RidgeRun Developer Connection
Jump to: navigation, search
m
Line 16: Line 16:
 
===Unidirectional Elements===
 
===Unidirectional Elements===
 
====Example====
 
====Example====
In this example we use rrwebrtcsink to send a video stream and an audio stream, and we use rrwebrtcsrc to receive the video and audio streams.
+
In this example we use rrwebrtcbin to send a video stream and an audio stream, and we use rrwebrtcbin to receive the video and audio streams.
  
 
=====Send Pipeline=====
 
=====Send Pipeline=====
 
The following pipeline will send periodic ticks and a video stream:
 
The following pipeline will send periodic ticks and a video stream:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0  rrwebrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
+
gst-launch-1.0  rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! x264enc key-int-max=2 ! \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! x264enc key-int-max=2 ! \
rtph264pay ! web.video audiotestsrc is-live=true wave=8 ! audioconvert \
+
rtph264pay ! web.video_sink audiotestsrc is-live=true wave=8 ! audioconvert \
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio
+
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 30: Line 30:
 
The following pipeline will receive the video stream and the ticks and do the playback:
 
The following pipeline will receive the video stream and the ticks and do the playback:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 rrwebrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
+
gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.video ! rtph264depay ! avdec_h264 ! videoconvert ! \
+
signaler::session_id=1234ridgerun name=web web.video_src ! rtph264depay ! avdec_h264 ! videoconvert ! \
ximagesink async=false web.audio ! rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false
+
ximagesink async=false web.audio_src ! rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 116: Line 116:
  
 
====Example====
 
====Example====
In this example we use rrwebrtcsink to send a video stream and an audio stream, and we use rrwebrtcsrc to receive the video and audio streams.
+
In this example, we use rrwebrtcbin to send a video stream and an audio stream, and we use rrwebrtcbin to receive the video and audio streams.
  
 
=====Send Pipeline=====
 
=====Send Pipeline=====
Line 122: Line 122:
  
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 rrwebrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
+
gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video audiotestsrc is-live=true wave=8 ! audioconvert \
+
vp8enc ! rtpvp8pay ! queue ! web.video_sink audiotestsrc is-live=true wave=8 ! audioconvert \
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio
+
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 131: Line 131:
 
The following pipeline receives the video stream and the audio stream.
 
The following pipeline receives the video stream and the audio stream.
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 rrwebrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
+
gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.audio ! rtpopusdepay ! opusdec ! audioconvert ! \
+
signaler::session_id=1234ridgerun name=web web.audio_src ! rtpopusdepay ! opusdec ! audioconvert ! \
queue ! alsasink async=false web.video ! rtpvp8depay ! vp8dec ! videoconvert ! ximagesink async=true
+
queue ! alsasink async=false web.video_src ! rtpvp8depay ! vp8dec ! videoconvert ! ximagesink async=true
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 11:55, 14 March 2019

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


Video - x86


Home

Demo Web Page - x86



This page presents GStreamer GstRrWebRTC audio and video examples on x86 platform using OpenWebRTC.

H264 + Opus

Unidirectional Elements

Example

In this example we use rrwebrtcbin to send a video stream and an audio stream, and we use rrwebrtcbin to receive the video and audio streams.

Send Pipeline

The following pipeline will send periodic ticks and a video stream:

gst-launch-1.0  rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! x264enc key-int-max=2 ! \
rtph264pay ! web.video_sink audiotestsrc is-live=true wave=8 ! audioconvert \
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink
Receive Pipeline

The following pipeline will receive the video stream and the ticks and do the playback:

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.video_src ! rtph264depay ! avdec_h264 ! videoconvert ! \
ximagesink async=false web.audio_src ! rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false

When executing the two previous pipelines, you should be able to listen the ticks in the receiving computer and see a video pattern similar to Fig.1.

Fig.1 Snapshot of video received

Bidirectional Elements

Example

In this example we use two rrwebrtcbins, each send a video stream and an audio stream, and receives each other video and audio streams.

Send-Receive Pipeline

The following pipeline starts a call, sends white noise audio stream and a color bar video stream, and receives audio and video streams.

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video_sink web.video_src \
! rtph264depay ! avdec_h264 ! videoconvert ! ximagesink async=true audiotestsrc is-live=true wave=5 \
! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink web.audio_src ! \
rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false
Send-Receive Pipeline

The following pipeline joins the call, sends ticks audio stream and a color bar video stream, and receives audio and video streams.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video_sink web.video_src \
! rtph264depay ! avdec_h264 ! videoconvert ! ximagesink async=true web.audio_src ! rtpopusdepay ! \
opusdec ! audioconvert ! alsasink async=false audiotestsrc is-live=true wave=8 ! audioconvert ! \
audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink

When executing the two previous pipelines, you should be able to listen the ticks and whitenoise audio streams and see two windows with video patterns similar to Fig.1.

Example

In this example we use two rrwebrtcbins, one sends an audio stream and receives a video stream and the other receives an audio stream and sends a video stream.

Send-Receive Pipeline

The following pipeline sends an audio stream and receives a video stream, also starts the call.

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.video_src ! rtph264depay ! avdec_h264 ! \
videoconvert ! ximagesink async=true audiotestsrc is-live=true wave=8 \
! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink
Send-Receive Pipeline

The following pipeline sends a video stream and receives an audio stream, also joins the call.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video_sink\
 web.audio_src ! rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false

When executing the two previous pipelines, you should be able to listen the ticks audio stream and see a video pattern similar to Fig.1.

Example

In this example we use two rrwebrtcbins, one sends an audio stream and receives a video and audio streams and the other receives an audio stream and sends a video and audio streams.

Send-Receive Pipeline

The following pipeline sends an audio stream and receives a video and audio streams, also starts the call.

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.video_src ! rtph264depay ! avdec_h264 ! \
videoconvert ! ximagesink async=true audiotestsrc is-live=true wave=8 \
! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink web.audio_src ! \
rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false
Send-Receive Pipeline

The following pipeline sends video and audio streams and receives an audio stream, also joins the call.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video_sink\
 audiotestsrc is-live=true wave=5 ! audioconvert ! audioresample ! queue ! opusenc ! \
rtpopuspay ! web.audio_sink web.audio_src ! rtpopusdepay ! opusdec ! audioconvert \
! alsasink async=false

When executing the two previous pipelines, you should be able to listen the ticks and white noise audio streams and see a video pattern similar to Fig.1.

Vp8 + Opus

Unidirectional Elements

Example

In this example, we use rrwebrtcbin to send a video stream and an audio stream, and we use rrwebrtcbin to receive the video and audio streams.

Send Pipeline

The following pipeline generates a color bars video stream and a ticks audiostream and starts the call:

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video_sink audiotestsrc is-live=true wave=8 ! audioconvert \
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink
Receive Pipeline

The following pipeline receives the video stream and the audio stream.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.audio_src ! rtpopusdepay ! opusdec ! audioconvert ! \
queue ! alsasink async=false web.video_src ! rtpvp8depay ! vp8dec ! videoconvert ! ximagesink async=true

After executing the two previous pipelines you should be able to see a window with a pattern like Fig.1, and hear the ticks audio stream.

Bidirectional Elements

Example

In this example we use two rrwebrtcbins, each send a video stream and an audio stream, and receives each other video and audio streams.

Send-Receive Pipeline

The following pipeline starts a call, sends ticks audio stream and a color bar video stream, and receives audio and video streams.

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.video_src ! rtpvp8depay \
! vp8dec ! videoconvert ! ximagesink async=true web.audio_src ! rtpopusdepay ! opusdec ! \
audioconvert ! alsasink async=false audiotestsrc is-live=true wave=8 ! audioconvert ! audioresample \
! queue ! opusenc ! rtpopuspay ! web.audio_sink
Send-Receive Pipeline

The following pipeline joins the call, sends white noise audio stream and a color bar video stream, and receives audio and video streams.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.video_src ! rtpvp8depay \
! vp8dec ! videoconvert ! ximagesink async=true web.audio_src ! rtpopusdepay ! opusdec ! audioconvert \
! alsasink async=false audiotestsrc is-live=true wave=5 ! audioconvert ! audioresample ! queue ! \
opusenc ! rtpopuspay ! web.audio_sink

After executing the two previous pipelines you should be able to see two windows with a pattern like Fig.1, and hear white noise and ticks audio streams.

Example

In this example we use two rrwebrtcbins, one sends a video stream and receives an audio stream and the other receives a video stream and sends an audio stream.

Send-Receive Pipeline

The following pipeline sends a video stream and receives an audio stream, also starts the call.

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.audio_src ! \
 rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false
Send-Receive Pipeline

The following pipeline sends an audio stream and receives a video stream, also joins the call.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web web.video_src ! rtpvp8depay ! vp8dec ! videoconvert \
! ximagesink async=true audiotestsrc is-live=true wave=8 ! audioconvert ! audioresample ! queue ! \
opusenc ! rtpopuspay ! web.audio_sink

When executing the two previous pipelines, you should be able to listen the ticks audio stream and see a video pattern similar to Fig.1.

Example

In this example we use two rrwebrtcbins, one sends a video stream and receives an audio and video stream and the other receives a video stream and sends audio and video streams.

Send-Receive Pipeline

The following pipeline sends a video stream and receives an audio and video streams, also starts the call.

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.video_src ! rtpvp8depay \
! vp8dec ! videoconvert ! ximagesink async=true web.audio_src ! rtpopusdepay ! opusdec ! \
audioconvert ! alsasink async=false
Send-Receive Pipeline

The following pipeline sends audio and video streams and receives a video stream, also joins the call.

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.video_src ! rtpvp8depay \
! vp8dec ! videoconvert ! ximagesink async=true audiotestsrc is-live=true wave=8 ! audioconvert\
 ! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink

When executing the two previous pipelines, you should be able to listen the ticks audio stream and see two windows with a video pattern similar to Fig.1.




Video - x86


Home

Demo Web Page - x86