GstWebRTC - Opus Examples

Revision as of 18:43, 6 July 2017 by Jcaballero (talk | contribs) (Created page with "{{GstWebRTC Page| GstWebRTC Basics| GstWebRTC Pipelines| This page presents some audio examples of GstWe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GstWebRTC Basics


Home

GstWebRTC Pipelines



This page presents some audio examples of GstWebRTC using OpenWebRTC's signaler.

Unidirectional

Example

In this example we use webrtcsink to send an audio stream and webrtcsrc to receive the audio stream.

The following pipeline will send periodic ticks:

gst-launch-1.0  webrtcsink start-call=true signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web audiotestsrc is-live=true wave=8 ! audioconvert ! audioresample \
! queue ! opusenc ! rtpopuspay ! web.audio


The following pipeline will receive the periodic ticks:

gst-launch-1.0 webrtcsrc start-call=false signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web web.audio ! rtpopusdepay ! opusdec ! audioconvert ! \
alsasink async=false

When executing the two previous pipelines, you should be able to listen the ticks in the receiving computer.



Bidirectional

Example

In this example we use two webrtcbin elements, each sends an audio stream and receives each other audio stream.

The following pipeline will send a white noise audio stream and receive the ticks audio stream sent by the next pipeline. This pipeline starts the call.

gst-launch-1.0 webrtcbin start-call=true signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web audiotestsrc is-live=true wave=5 ! audioconvert ! \
audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink web.audio_src ! rtpopusdepay ! \
opusdec ! audioconvert ! alsasink sync=false async=false

The following pipeline will send ticks audio stream and receive the white noise audio stream sent by the previous pipeline. This pipeline joins the call.

gst-launch-1.0 webrtcbin start-call=false signaler::server_url=http://webrtc.ridgerun.com:8080 \
signaler::session_id=1234ridgerun name=web audiotestsrc is-live=true wave=8 ! audioconvert ! \
audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink web.audio_src ! rtpopusdepay ! \
opusdec ! audioconvert ! alsasink sync=false async=false

When executing the two previous pipelines, you should be able to listen the ticks and the white noise.




GstWebRTC Basics


Home

GstWebRTC Pipelines