GstWebRTC - Vp8-Opus Examples

From RidgeRun Developer Wiki

H264 + Opus


Home

PubNub Signaler Examples



This page presents the GstWebRTC Vp8 and Opus video and audio examples with the OpenWebRTC signaler.

Unidirectional Elements

Example

In this example we use webrtcsink to send a video stream and an audio stream, and we use webrtcsrc 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 webrtcsink 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 ! identity ! web.video audiotestsrc is-live=true wave=8 ! audioconvert \
! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio

Receive Pipeline

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

gst-launch-1.0 webrtcsrc start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web web.audio ! rtpopusdepay ! opusdec ! audioconvert ! \
queue ! alsasink async=false web.video ! 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.

Fig.1 Snapshot of video received



Bidirectional Element

Example

In this example we use two webrtcbins, 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 webrtcbin 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 ! identity silent=false ! 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 webrtcbin 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 ! identity silent=false ! 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 webrtcbins, 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 webrtcbin 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 ! identity silent=false ! 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 webrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=http://webrtc.ridgerun.com:8080 \
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 webrtcbins, 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 webrtcbin 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 ! identity silent=false ! 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 webrtcbin 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 ! identity silent=false ! 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.



H264 + Opus


Home

PubNub Signaler Examples