GstWebRTC - Data Channel Examples - TX1/TX2

From RidgeRun Developer Wiki




Previous: OpenWebRTC Web Page - TX1/TX2 Index Next: PubNub Signaler Examples - TX1/TX2/Xavier




This page presents GstRrWebRTC data channel examples on TX1/TX2 platform using OpenWebRTC.

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



Pipeline - Browser

In the following examples you will need to access SimpleRTC web page and establish a WebRTC call with a pipeline. Find the web page here: https://webrtc.ridgerun.com:8443/

In the Web Page make sure you enable the correct streams. For example, if you will only use data channel, mark chat box. If you need audio and video check the required boxes.
When you have the correct setup press join button, run the pipeline and press call button to start the call.

In the following figure you will find the SimpleRTC web page with the chat enabled after the call with the pipeline was executed.

Establish a WebRTC call with https://webrtc.ridgerun.com:8443/
Establish a WebRTC call with https://webrtc.ridgerun.com:8443/



Note: If you need to do changes in the check-boxes to enable or disable streams, refresh the Web Page first.

Data Channel

Example

In this example we enable the WebRTC data channel between a web server and a pipeline.

Send+Receive Pipeline
gst-launch-1.0  rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web fdsrc ! 'meta/x-klv' ! web.data_sink web.data_src ! fdsink async=false

When executing the previous pipeline, you should be able to type and send messages between the web page and the pipeline.

Data Channel + Audio

Example

In this example we enable the WebRTC data and audio channel between a web server and a pipeline.

Send+Receive Pipeline
gst-launch-1.0  rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web fdsrc ! 'meta/x-klv' ! web.data_sink web.data_src ! fdsink async=false \
audiotestsrc is-live=true wave=8 ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! web.audio_sink \
web.audio_src ! rtpopusdepay ! opusdec ! audioconvert ! alsasink async=false

When executing the previous pipeline, you should be able to type and send messages between the web page and the pipeline and also listen the audio streaming in both endpoints.

Data Channel + Video

Example

In this example we enable the WebRTC data and video channel between a web server and a pipeline.

Send+Receive Pipeline
gst-launch-1.0  rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web fdsrc ! 'meta/x-klv' ! web.data_sink web.data_src ! fdsink async=false \
videotestsrc is-live=true ! vp8enc ! rtpvp8pay ! web.video_sink \
web.video_src ! rtpvp8depay ! vp8dec ! videoconvert ! ximagesink async=false

When executing the previous pipeline, you should be able to type and send messages between the web page and the pipeline and also observe the video streaming in both endpoints.

Data Channel + Audio + Video

Example

In this example we enable the WebRTC data, audio and channel between a web server and a pipeline.

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

When executing the previous pipeline, you should be able to type and send messages between the web page and the pipeline. Also you should observe the video streaming and listen the audio streaming in both endpoints.

Pipeline - Pipeline

Data Channel

Example

In this example we enable the WebRTC data channel using 2 pipelines that send and receive data between them.

Send+Receive Pipeline
gst-launch-1.0  rrwebrtcbin start-call=true signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web fdsrc ! 'meta/x-klv' ! web.data_sink web.data_src ! fdsink async=false
Send+Receive Pipeline
gst-launch-1.0 rrwebrtcbin start-call=false signaler=GstOwrSignaler signaler::server_url=https://webrtc.ridgerun.com:8443 \
signaler::session_id=1234ridgerun name=web fdsrc ! 'meta/x-klv' ! web.data_sink web.data_src ! fdsink async=false

When executing the two previous pipelines, you should be able to type and send messages in any of the endpoints and receive them in the corresponding endpoint.


Previous: OpenWebRTC Web Page - TX1/TX2 Index Next: PubNub Signaler Examples - TX1/TX2/Xavier