Skip to content

Testing WebRTC

Damon Oehlman edited this page Jan 28, 2014 · 3 revisions

Testing WebRTC applications and libraries is hard. You need to be able to test for correct operation with a particular browser, and also interoperability with other browsers. Additionally, you need to simulate different network conditions to ensure that your browser correctly uses ICE.

Browser Automation using Selenium

I originally believed that Selenium would not work for our needs, but on further investigation I believe that the use of ChromeOptions and firefox profile settings in selenium configuration options will let us do exactly what we want.

Related information:

Virtual Device Configuration

Have tested loopback video driver (v4l for linux) and also the new --use-file-for-fake-video-capture (requires Chrome 33+). Both provide the expected result, but minus any sound input. Depending on the type of testing that we are going to try and create audio may be important... I don't know. Also, getting the loopback device to play a source video file is proving difficult (will ask JJ to help out on that).

Related information:

GStreamer 1.0 Usage Notes

Much of the documentation on the loopback video driver site provides instructions for gstreamer-0.10 rather than gstreamer-1.0 so the following are some tips on how to set it up to work with video sources:

Convert an input video file to a set of YUV frame files:

gst-launch-1.0 -v filesrc location=$1 ! decodebin ! videoconvert ! pngenc snapshot=false ! multifilesink location=test/%05d.png

And then you can set up an infinite producer using those frame files:

gst-launch-1.0 -v multifilesrc location=~/test/%05d.png loop=1 caps="image/png,framerate=30/1" ! pngdec ! videoconvert ! v4l2sink device=/dev/video2

Desktop Capture (getting close, but not there yet):

gst-launch-1.0 -v ximagesrc startx=0 starty=0 endx=1279 endy=1023 ! videoconvert ! video/x-raw, width=1280, height=1024, framerate=10/1 ! v4l2sink device=/dev/video2

Network Simulation

Requires further investigation.

Clone this wiki locally