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

From RidgeRun Developer Connection
Jump to: navigation, search
Line 16: Line 16:
 
===Unidirectional Elements===
 
===Unidirectional Elements===
 
====Example====
 
====Example====
In this example we use webrtcsink to send a video stream and webrtcsrc to receive the video stream.
+
In this example we use rrwebrtcsink to send a video stream and rrwebrtcsrc to receive the video stream.
  
 
=====Send Pipeline=====
 
=====Send Pipeline=====
 
The following pipeline will send a color bars h264 video stream:
 
The following pipeline will send a color bars h264 video stream:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
 
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video
 
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video
Line 29: Line 29:
 
The following pipeline will receive the video stream and display it:
 
The following pipeline will receive the video stream and display it:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
signaler::session_id=1234ridgerun name=web web.video ! rtph264depay ! avdec_h264 ! videoconvert \
 
signaler::session_id=1234ridgerun name=web web.video ! rtph264depay ! avdec_h264 ! videoconvert \
 
! ximagesink async=true
 
! ximagesink async=true
Line 41: Line 41:
 
===Bidirectional Element===
 
===Bidirectional Element===
 
====Example====
 
====Example====
In this example we use two webrtcbin elements, each sends a video stream and receives each other video stream.
+
In this example we use two rrwebrtcbin elements, each sends a video stream and receives each other video stream.
  
  
Line 47: Line 47:
 
The following pipeline starts the call:
 
The following pipeline starts the call:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
 
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 \
 
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video_sink web.video_src \
Line 57: Line 57:
 
The following pipeline joins the call:
 
The following pipeline joins the call:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
 
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 \
 
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video_sink web.video_src \
Line 68: Line 68:
 
===Unidirectional Elements===
 
===Unidirectional Elements===
 
====Example====
 
====Example====
In this example we use webrtcsink to send a video stream and webrtcsrc to receive the video stream.
+
In this example we use rrwebrtcsink to send a video stream and rrwebrtcsrc to receive the video stream.
 
=====Send Pipeline=====
 
=====Send Pipeline=====
 
The following pipeline will send a color bars vp8 video stream:
 
The following pipeline will send a color bars vp8 video stream:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
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
 
vp8enc ! rtpvp8pay ! queue ! web.video
Line 79: Line 79:
 
The following pipeline will receive the video stream and display it:
 
The following pipeline will receive the video stream and display it:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
signaler::session_id=1234ridgerun name=web web.video ! rtpvp8depay ! vp8dec ! videoconvert ! \
 
signaler::session_id=1234ridgerun name=web web.video ! rtpvp8depay ! vp8dec ! videoconvert ! \
 
ximagesink async=true
 
ximagesink async=true
Line 88: Line 88:
 
===Bidirectional Element===
 
===Bidirectional Element===
 
====Example====
 
====Example====
In this example we use two webrtcbin elements, each sends a video stream and receives each other video stream.
+
In this example we use two rrwebrtcbin elements, each sends a video stream and receives each other video stream.
 
=====Send-Receive Pipeline=====
 
=====Send-Receive Pipeline=====
 
The following pipeline starts the call:
 
The following pipeline starts the call:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
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_sink web.video_src ! rtpvp8depay ! \
 
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.video_src ! rtpvp8depay ! \
Line 101: Line 101:
 
The following pipeline joins the call:
 
The following pipeline joins the call:
 
<syntaxhighlight lang='bash'>
 
<syntaxhighlight lang='bash'>
gst-launch-1.0 webrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
+
gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
 
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_sink web.video_src ! rtpvp8depay \
 
vp8enc ! rtpvp8pay ! queue ! web.video_sink web.video_src ! rtpvp8depay \

Revision as of 10:22, 15 June 2018

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


Audio


Home

Audio + Video



This page presents video examples using OpenWebRTC.

H264

Unidirectional Elements

Example

In this example we use rrwebrtcsink to send a video stream and rrwebrtcsrc to receive the video stream.

Send Pipeline

The following pipeline will send a color bars h264 video stream:

gst-launch-1.0 rrwebrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! queue ! web.video
Receive Pipeline

The following pipeline will receive the video stream and display it:

gst-launch-1.0 rrwebrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web web.video ! rtph264depay ! avdec_h264 ! videoconvert \
! ximagesink async=true

You should be able to see a video pattern similar to Fig.1.

Fig.1 Snapshot of video received




Bidirectional Element

Example

In this example we use two rrwebrtcbin elements, each sends a video stream and receives each other video stream.


Send-Receive Pipeline

The following pipeline starts the call:

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
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


Send-Receive Pipeline

The following pipeline joins the call:

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
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

You should be able to see two windows with a video pattern similar to Fig.1.

VP8

Unidirectional Elements

Example

In this example we use rrwebrtcsink to send a video stream and rrwebrtcsrc to receive the video stream.

Send Pipeline

The following pipeline will send a color bars vp8 video stream:

gst-launch-1.0 rrwebrtcsink start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! queue ! videoconvert ! \
vp8enc ! rtpvp8pay ! queue ! web.video
Receive Pipeline

The following pipeline will receive the video stream and display it:

gst-launch-1.0 rrwebrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web web.video ! rtpvp8depay ! vp8dec ! videoconvert ! \
ximagesink async=true

You should be able to see a video pattern similar to Fig.1.



Bidirectional Element

Example

In this example we use two rrwebrtcbin elements, each sends a video stream and receives each other video stream.

Send-Receive Pipeline

The following pipeline starts the call:

gst-launch-1.0 rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
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
Send-Receive Pipeline

The following pipeline joins the call:

gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
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

You should be able to see two windows with a video pattern similar to Fig.1.




Audio


Home

Audio + Video