/

Webrtc-Plugin Properties File


For the most use cases, you can just "set it and forget it" with Red5 Pro WebRTC, but you may want to modify some default behaviors by editing the properties file. Follows are some of the most common settings you may want to modify.

Note: unless otherwise specified, all time values are set in MILLISECONDS.

Port range for UDP and TCP

port.min=49152
port.max=65535

Red5 Pro needs a dedicated port for each WebRTC connection (publisher or subscriber). The port range that the server uses is defined in this section. You can set this to a smaller range if you want to minimize open ports on your firewall.

WebRTC Video and Audio Codec Support

Red5 Pro is configured to use H264 for video and Opus audio by default for WebRTC, but you can modify the following lines to change those:

  • rtc.audio.codecs=OPUS - Can modify this to test other audio codecs
  • rtc.video.codecs=H264_PMODE1 - you can include VP8 (rtc.video.codecs=H264_PMODE1,VP8) to offer both options. You can also set this to VP8 only if you prefer (rtc.video.codecs=VP8). Keep in mind that VP8 uses more CPU than H264, and if you include both then the server will also be transcoding, which will use even more CPU

Note that these settings only impact WebRTC, not RTMP or RTSP

WebRTC Stream Regulating

  • aggressive.connection.cleanup=true - You can configure the level of action to perform when the websocket is destroyed. To close and clean-up the connection and streams when a ws is destroyed, set to true (default and recommended). To allow idle checks to clean-up the connection, set to false (NOTE: setting this value to false may result in "zombie" streams).
  • forced.keyframe.interval=3000 - desired publisher rtc key frame interval, (3000 milliseconds = 3 seconds).
  • keepalive.interval=15000 Keep-alive task interval (used to check all RTC connections for idle-ness). 500 is minimum interval accepted. '0' disables rtc keep alive pings. Default 15,000 = 15 seconds.
  • idle.check.enabled=true - Idle checking for transport layer
  • allow.idle.muted=true - Determination if a connection will be kicked on idle while its muted. When true (default), idle is allowed when the stream is muted. When false, an idle connection is closed whether or not it's muted

NACK

As defined in the WebRTC Glossary: NACK stands for Negative Acknowledgement. It is one of the error resiliency mechanisms in WebRTC.
NACK is a way for the receiving end to indicate it hasn’t received a specific packet. A NACK message is sent over RTCP to the sender of the media, which in turn needs to decide if it will retransmit the lost packet based on its availability in its cache and its estimate to the usefulness of the retransmission (will it be possible to use it once received).

In the {red5pro}/conf/webrtc-plugin.properties file, publisher and subscriber NACKs are enabled by default:

# enable nack support for subscribers
subscriber.nacks=true

# enable nack support for publisher
publisher.nacks=true

NOTE: With a very lossy publisher, NACKing can introduce a lot of packet dropping, which is especially problematic if you are broadcasting to a transcoder node for ABR. If you anticipate your broadcast source to be from a sub-optimal network, then you may want to disable pubisher nacks.

You can also

WebRTC ABR Settings

Used in conjunction with Red5 Pro transcoding, these settings can be modified to accmodate greater or lesser steps between stream provision levels

  • abr.enabled=true - Webrtc Adaptable Bitrate (ABR) configuration for controlling subscriber upgrade. Enbaled by default. If you want to transcode multiple variants without ABR then you can set this to false.
  • abr.videoPacketTolerance=5 - number of dropped packets allowed between checks.

ABR Upgrade Option 1 config

  • abr.threshold1=0.25 - threshold relative to target bitrate. RTC Estimated client bandwidth. Subscriber periodically tells server estimated bitrate. This value is calculated by current throughput. When determining if the subscriber should receive a higher quality, the higher bitrate stream value is compared to the client value. the 'abr.threshold1' determins how close to the next bitrate the subscriber must be. Default is within 25%. Client must post 85kb/s capability to upgrade to 100kb/s version. Acceptable range 0.0 to 0.5, 0.0=strict floating point number

ABR Upgrade Option 2 config (OPTIONAL)

  • abr.threshold2=0.5 - threshold relative to current bitrate. Because the estimated bitrate is based on current stream and bitrate variants may be very far apart, it may never reflect a value to qualify for option 1 upgrade. So we compare the estimated bitrate against the current stream. If set to 50%, and the estimated bitrate is more than 50% of the current, the client will be switched and given a chance. This works well if bitrates are doubled between provisions. This should be set higher if your provisions are further apart. Set to zero to DISABLE.

Other Configuration File Settings

There are other settings that are only recommended to be modified for very specific troubleshooting as directed by Red5 Pro support. If you have questions on any of the additional settings in the webrtc-plugin.properties file, please contact Red5 Pro Support