Kurento is a low-level platform to create WebRTC applications from scratch. You will be responsible of managing STUN/TURN servers, networking, scalability, etc. If you are new to WebRTC, we recommend using OpenVidu instead.

OpenVidu is an easier to use, higher-level, Open Source platform based on Kurento.

Browser Details

This page is a compendium of information that can be useful to work with or configure different web browsers, for tasks that are common to WebRTC development.

Example commands are written for a Linux shell, because that’s what Kurento developers use in their day to day. But most if not all of these commands should be easily converted for use on Windows or Mac systems.


Security sandboxes

Firefox has several sandboxes that can affect the logging output. For troubleshooting and development, it is recommended that you learn which sandbox might be getting in the way of the logs you need, and disable it:

For example:

  • To get logs from MOZ_LOG="signaling:5", first set security.sandbox.content.level to 0.

  • To inspect audio issues, disable the audio sandbox by setting media.cubeb.sandbox to false.

Test instance

To run a new Firefox instance with a clean profile:

/usr/bin/firefox -no-remote -profile "$(mktemp --directory)"

Other options:

  • -jsconsole: Start Firefox with the Browser Console.

  • [-url] <URL>: Open URL in a new tab or window.

Debug logging


Debug logging can be enabled with the parameters MOZ_LOG and MOZ_LOG_FILE. These are controlled either with environment variables, or command-line flags.

In Firefox >= 54, you can use about:networking, and select the Logging option, to change MOZ_LOG / MOZ_LOG_FILE options on the fly (without restarting the browser).

You can also use about:config and set any log option into the profile preferences, by adding (right-click -> New) a variable named logging.<NoduleName>, and setting it to an integer value of 0-5. For example, setting logging.foo to 3 will set the module foo to start logging at level 3 (”Info”).

The special pref logging.config.LOG_FILE can be set at runtime to change the log file being output to, and the special booleans logging.config.sync and logging.config.add_timestamp can be used to control the sync and timestamp properties:

  • sync: Print each log synchronously, this is useful to check behavior in real time or get logs immediately before crash.

  • timestamp: Insert timestamp at start of each log line.

Logging Levels:

  • (0) DISABLED: Indicates logging is disabled. This should not be used directly in code.

  • (1) ERROR: An error occurred, generally something you would consider asserting in a debug build.

  • (2) WARNING: A warning often indicates an unexpected state.

  • (3) INFO: An informational message, often indicates the current program state. and rare enough to be logged at this level.

  • (4) DEBUG: A debug message, useful for debugging but too verbose to be turned on normally.

  • (5) VERBOSE: A message that will be printed a lot, useful for debugging program flow and will probably impact performance.

Log categories:

  • Multimedia:

    • AudioStream:5

    • MediaCapabilities:5

    • MediaControl:5

    • MediaEncoder:5

    • MediaManager:5

    • MediaRecorder:5

    • MediaStream:5

    • MediaStreamTrack:5

    • MediaTimer:5

    • MediaTrackGraph:5

    • Muxer:5

    • PlatformDecoderModule:5

    • PlatformEncoderModule:5

    • TrackEncoder:5

    • VP8TrackEncoder:5

    • VideoEngine:5

    • VideoFrameConverter:5

    • cubeb:5

  • WebRTC:

    • Autoplay:5

    • GetUserMedia:5

    • webrtc_trace:5

    • signaling:5

    • MediaPipeline:5

    • RtpLogger:5

    • RTCRtpReceiver:5

    • sdp:5



export MOZ_LOG=timestamp,rotate:200,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5
export MOZ_LOG_FILE=/tmp/firefox.log


Linux with MOZ_LOG passed as command line arguments:

/usr/bin/firefox \
    -MOZ_LOG=timestamp,rotate:200,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5 \


export MOZ_LOG=timestamp,rotate:200,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5
export MOZ_LOG_FILE=/tmp/firefox.log



set MOZ_LOG=timestamp,rotate:200,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5
set MOZ_LOG_FILE=%TEMP%\firefox.log

"C:\Program Files\Mozilla Firefox\firefox.exe"

ICE candidates / STUN / TURN:

export R_LOG_DESTINATION=stderr
export R_LOG_LEVEL=7
export R_LOG_VERBOSE=1

/usr/bin/firefox -no-remote -profile "$(mktemp --directory)" \

WebRTC dump example (see https://blog.mozilla.org/webrtc/debugging-encrypted-rtp-is-more-fun-than-it-used-to-be/):

export MOZ_LOG=timestamp,signaling:5,jsep:5,RtpLogger:5
export MOZ_LOG_FILE="$PWD/firefox"

/usr/bin/firefox -no-remote -profile "$(mktemp --directory)" \

grep -E '(RTP_PACKET|RTCP_PACKET)' firefox.*.moz_log \
    | cut -d '|' -f 2 \
    | cut -d ' ' -f 5- \
    | text2pcap -D -n -l 1 -i 17 -u 1234,1235 -t '%H:%M:%S.' - firefox-rtp.pcap

Media decoding (audio sandbox can be enabled or disabled with the user preference media.cubeb.sandbox):

export MOZ_LOG=timestamp,sync,MediaPipeline:5,MediaStream:5,MediaStreamTrack:5,webrtc_trace:5

/usr/bin/firefox -no-remote -profile "$(mktemp --directory)" \


To enable the Debug menu in Safari, run this command in a terminal:

defaults write com.apple.Safari IncludeInternalDebugMenu 1


Test instance

To run a new Chrome instance with a clean profile:

/usr/bin/google-chrome --user-data-dir="$(mktemp --directory)"

Debug logging



        --user-data-dir="$TEST_PROFILE" \
        --use-fake-ui-for-media-stream \
        --use-fake-device-for-media-stream \
        --enable-logging=stderr \
        --log-level=0 \
        --vmodule='*/webrtc/*=2,*/libjingle/*=2,*=-2' \
        --v=0 \
        "https://localhost:8443/" \
        >chrome_debug.log 2>&1 &

    # Other flags:
    # --use-file-for-fake-audio-capture="/path/to/audio.wav" \
    # --use-file-for-fake-video-capture="/path/to/video.y4m" \

    tail -f chrome_debug.log


"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
    --enable-logging=stderr \

Packet Loss

A command line for 3% sent packet loss and 5% received packet loss is:


H.264 codec

Chrome uses OpenH264 (same lib as Firefox uses) for encoding, and FFmpeg (which is already used elsewhere in Chrome) for decoding.





/usr/bin/google-chrome \
    --user-data-dir="$(mktemp --directory)" \
    --enable-logging=stderr \
    --no-first-run \
    --allow-insecure-localhost \
    --allow-running-insecure-content \
    --disable-web-security \
    --unsafely-treat-insecure-origin-as-secure="https://${WEB_APP_HOST_PORT}" \



/usr/bin/firefox \
    -profile "$(mktemp --directory)" \
    -no-remote \
    "https://${SERVER_PUBLIC_IP}:4443/" \

WebRTC JavaScript API

Generate an SDP Offer.

let pc1 = new RTCPeerConnection();
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then((stream) => {
    stream.getTracks().forEach((track) => {
        console.log("Local track available: " + track.kind);
        pc1.addTrack(track, stream);
    pc1.createOffer().then((offer) => {
        console.log(JSON.stringify(offer).replace(/\\r\\n/g, '\n'));

Browser MTU

The default Maximum Transmission Unit (MTU) in the official libwebrtc implementation is 1200 Bytes (source code). All browsers base their WebRTC implementation on libwebrtc, so this means that all use the same MTU:

Bandwidth Estimation

WebRTC bandwidth estimation (BWE) was implemented first with Google REMB, and later with Transport-CC. Clients need to start “somewhere” with their estimations, and the official libwebrtc implementation chose to do so at 300 kbps (kilobits per second) (source code). All browsers base their WebRTC implementation on libwebrtc, so this means that all use the same initial BWE:

Video Encoding

Video Bitrate

Web browsers will try to estimate the real performance of the network, and with this information they adapt their video output quality. Most browsers are able to adjust the video bitrate; in addition, Chrome also dynamically adapts the resolution and framerate of its video output.

The maximum video bitrate is calculated for WebRTC by following a simple rule based on the dimensions of the video source:

  • 600 kbps if width * height <= 320 * 240.

  • 1700 kbps if width * height <= 640 * 480.

  • 2000 kbps (2 Mbps) if width * height <= 960 * 540.

  • 2500 kbps (2.5 Mbps) for bigger video sizes.

  • Never less than 1200 kbps, if the video is a screen capture.

Source: The GetMaxDefaultVideoBitrateKbps() function in libwebrtc source code.

To verify what is exactly being sent by your web browser, check its internal WebRTC stats. For example, to check the outbound stats in Chrome:

  1. Open this URL: chrome://webrtc-internals/.

  2. Look for the stat name “Stats graphs for RTCOutboundRTPVideoStream (outbound-rtp)”.

  3. You will find the effective output bitrate in [bytesSent_in_bits/s], and the output resolution in frameWidth and frameHeight.

You can also check what is the network bandwidth estimation in Chrome:

  1. Look for the stat name “Stats graphs for RTCIceCandidatePair (candidate-pair)”. Note that there might be several of these, but only one will be active.

  2. Find the output network bandwidth estimation in availableOutgoingBitrate. Chrome will try to slowly increase its effective output bitrate, until it reaches this estimation.

H.264 profile

By default, Chrome uses this line in the SDP Offer for an H.264 media:

a=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f

profile-level-id is an SDP attribute, defined in RFC 6184 as the hexadecimal representation of the Sequence Parameter Set (SPS) from the H.264 Specification. The value 42e01f decomposes as the following parameters:

  • profile_idc = 0x42 = 66

  • profile-iop = 0xE0 = 1110_0000

  • level_idc = 0x1F = 31

These values translate into the Constrained Baseline Profile, Level 3.1.