GstWebRTC - AppRTC Audio + Video Examples - x86

From RidgeRun Developer Connection
Jump to: navigation, search



Previous: AppRTC Video Examples - x86 Index Next: AppRTC Web Page - x86




This page links to the GstRrWebRTC audio and video examples on x86 platform using AppRTC.

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

Server Setup

To run the examples first enable the Websocket server:

$GOPATH/bin/collidermain -port=8089 -tls=false

Then, enable the AppRTC Node server in a different terminal window:

cd <PATH>/apprtc-node-server
node ./bin/www

Note: Make sure you previously install dependencies needed for enable the servers, if you didn't, follow this link:

Setup AppRTC Node Server with our websocket server


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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! web.video_sink \
audiotestsrc is-live=true ! 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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web web.video_src ! rtph264depay ! avdec_h264 ! videoconvert ! \
xvimagesink async=true web.audio_src ! rtpopusdepay ! opusdec ! autoaudiosink

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 Element

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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! web.video_sink \
web.video_src ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink async=true \
web.audio_src ! rtpopusdepay ! opusdec ! autoaudiosink \
audiotestsrc is-live=true ! opusenc ! rtpopuspay ! web.audio_sink
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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! videoconvert ! \
x264enc key-int-max=2 ! rtph264pay ! web.video_sink \
web.video_src ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink async=true \
web.audio_src ! rtpopusdepay ! opusdec ! autoaudiosink \
audiotestsrc is-live=true ! opusenc ! rtpopuspay ! web.audio_sink

When executing the two previous pipelines, you should be able to listen audio streams and see two windows with video patterns 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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! vp8enc ! rtpvp8pay ! web.video_sink \
audiotestsrc is-live=true ! 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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web web.video_src ! rtpvp8depay ! vp8dec ! videoconvert ! xvimagesink async=true \
web.audio_src ! rtpopusdepay ! opusdec ! autoaudiosink

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 Element

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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! vp8enc ! rtpvp8pay ! web.video_sink \
web.video_src ! rtpvp8depay ! vp8dec ! videoconvert ! xvimagesink async=true \
web.audio_src ! rtpopusdepay ! opusdec ! autoaudiosink \
audiotestsrc is-live=true ! 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=GstApprtcSignaler signaler::server_url=http://localhost:8080 \
signaler::session_id=1234ridgerun name=web videotestsrc is-live=true ! vp8enc ! rtpvp8pay ! web.video_sink \
web.video_src ! rtpvp8depay ! vp8dec ! videoconvert ! xvimagesink async=true \
web.audio_src ! rtpopusdepay ! opusdec ! autoaudiosink \
audiotestsrc is-live=true ! 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 audio streams.



Previous: AppRTC Video Examples - x86 Index Next: AppRTC Web Page - x86