tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

debugging_webrtc_calls.rst (75260B)


      1 Debugging WebRTC Calls
      2 ======================
      3 
      4 .. _reporting_webrtc_call_issues:
      5 
      6 Reporting WebRTC Call Issues
      7 ----------------------------
      8 
      9 The best way to report an issue is through Bugzilla using this
     10 `link <https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=WebRTC>`__.
     11 Describe the issue you've run into, include a URL, along with the
     12 details of the call setup. See the :ref:`adding-call-setup-information`
     13 section for helpful templates. Here are some common examples of descriptive
     14 WebRTC bug summaries:
     15 
     16 * caller is experiencing frozen video, screen capture, or desktop capture
     17 * caller does not hear audio
     18 * caller's voice sounds distorted or robotic
     19 * video resolution is lower than expected
     20 * caller's video appears rotated
     21 * there is significant delay between a caller's video and audio
     22 * camera, microphone, or screens are not appearing in the Firefox device access
     23  permission prompts, etc.
     24 * caller's video is garbled, partially missing, or the colors are incorrect
     25 * caller can not share external display, but can share integrated display
     26 
     27 .. note::
     28  Not all web conferencing software makes extensive use of WebRTC.
     29 
     30 
     31 For simple issues, the first place to look is to check the
     32 `web developer console </devtools-user/web_console>`__ for error messages
     33 related to media format issues. If you see messages here related to WebRTC,
     34 getUserMedia, or getDisplayMedia, please add this information to your bug.
     35 
     36 .. _adding-call-setup-information:
     37 
     38 Adding Call Setup Information
     39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     40 
     41 The following template can help one provide all the call details needed to
     42 diagnose many common issues.
     43 
     44 .. code:: md
     45 
     46   * Does this problem occur in Firefox for Desktop or Android?
     47 
     48   * Is this problem reproducible in Firefox Nightly?
     49 
     50   * Has this worked previously?
     51 
     52   * Have you tried using `about:profiles` to reproduce the problem in a
     53     clean profile?
     54 
     55   * How many participants were in the call?
     56 
     57   * In which web conferencing or web calling services does the problem occur?
     58 
     59   * Does the problem present itself immediately upon starting the call?
     60 
     61   * If not how long does it take to occur?
     62 
     63   * If this is a problem with audio or video capture, what camera or microphone
     64     are you using? (adding about:support text may be helpful)
     65 
     66   * If this is problem with screen capture, which screen was being captured,
     67     and are there other screens attached to the same machine?
     68 
     69   * Would you be willing to help us find a regression range?
     70 
     71 If the issue is of specification compliance the template provided below may be
     72 more useful. If one is unsure if this is a compliance issue, one can refer to
     73 the :ref:`standards-documentation` section for links.
     74 
     75 .. code:: md
     76 
     77  * What unexpected behavior is being observed? What are the steps to reproduce
     78    this issue?
     79 
     80  * What is the expected behavior?
     81 
     82  * Where is this behavior specified?
     83 
     84  * Is this problem reproducible in Nightly?
     85 
     86  * Have you tried using `about:profiles` to reproduce the problem in a clean
     87    profile?
     88 
     89  * Has this worked previously?
     90 
     91  * If so, would you be willing to help us find a regression range?
     92 
     93 .. _share_your_aboutsupport_text:
     94 
     95 Adding about:support Text
     96 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     97 
     98 In your Bugzilla report, please include support information about the
     99 current device on which you are experiencing an issue.
    100 
    101 #. Open a tab and visit about:support
    102 #. Click 'Copy Text to Clipboard'
    103 #. Paste this text in your Bugzilla bug comment and post.
    104 
    105 .. note::
    106 
    107  To open :code:`about:*` links in Firefox one must do the following:
    108  #. Right-click the link and select `Open Link in New Tab`
    109  #. Select the new tab
    110  #. Click inside the address bar which should contain the about URL
    111  #. Press Enter
    112 
    113 .. _share_your_aboutwebrtc_contents:
    114 
    115 Adding about:webrtc RTCPeerConnection Stats
    116 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    117 
    118 #. Open about:webrtc.
    119 #. Expand the RTCPeerConnection section.
    120 #. Locate and expand the subsection RTCPeerConnection that one wishes to copy
    121   stats from.
    122 #. Press the :code:`Copy Stats Report`
    123 #. In the Bugzilla bug, press the :code:`Attach New File` button.
    124 #. Click inside the large text box labeled :code:`File`, and paste the copied
    125   stats report.
    126 #. Add a descriptive label to the the :code:`Description:`, e.g.
    127   "PeerConnection statistics sample taken during period of frame loss".
    128 #. In the drop down box, next to the :code:`select from list` radio option,
    129   select "JSON source (application/json)".
    130 #. If needed, add a descriptive comment to the :code:`comment` field.
    131 #. Press the :code:`Submit` button.
    132 
    133 .. note::
    134   Hovering the mouse over some headings will reveal a clipboard icon. Clicking
    135   this icon will copy the contents under that section to the clipboard as a
    136   JSON document. This can be useful if one wants to submit a portion of the
    137   available stats. Of particular note are the :code:`RTP Stats` heading whose
    138   button will copy the latests RTP stats, and the :code:`SDP` section whose
    139   button will copy the SDP offer; answer; and roles.
    140 
    141 Adding Your about:webrtc Contents
    142 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    143 
    144 For issues with call quality, please share web conferencing related
    145 performance information by providing your about:webrtc information. Note
    146 this information should be collected while the call in question is still
    147 active.
    148 
    149 #. While your call is still ongoing, open an additional tab and visit
    150   about:webrtc.
    151 #. Click "Clear History" to clear the stats from other recent calls
    152   which are no longer ongoing.
    153 #. At the bottom of the page click 'Save Page', and save this file.
    154 #. Add this file as an attachment to your bug.
    155 
    156 This data contains statistics about your call, the signalling that was
    157 used to setup your call, and information about the network transports.
    158 
    159 .. _diagnosing_call_quality_issues:
    160 
    161 Diagnosing Call Quality Issues
    162 ------------------------------
    163 
    164 .. _about_webrtc_overview:
    165 
    166 about:webrtc Overview
    167 ~~~~~~~~~~~~~~~~~~~~~
    168 
    169 about:webrtc is an in-browser resource for debugging WebRTC calls. The
    170 primary audience for about:webrtc is browser developers but it can also be
    171 of use to anyone that needs to troubleshoot a WebRTC call. When there is no
    172 call data to display, about:webrtc will appear as follows:
    173 
    174 .. figure:: img/about_webrtc_default_view.png
    175   :alt: about:webrtc before any calls have been made
    176 
    177   about:webrtc before any calls have been made
    178 
    179 Note that there are several sections. During a call each section will contain
    180 information pertinent to different aspects of the WebRTC browser implementation.
    181 
    182 RTCPeerConnection Statistics
    183 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    184 
    185 This section presents information useful for diagnosing active calls. It
    186 contains RTCPeerConnection creation parameters, connection information,
    187 negotiation details, RTP stream statistics, bandwidth statistics, and
    188 output frame statistics.
    189 
    190 Connection Log
    191 ^^^^^^^^^^^^^^
    192 
    193 When one needs to diagnose issues with the underlying transports, logs
    194 can be found under Connection Log.
    195 
    196 User Modified WebRTC Configuration
    197 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    198 This section will display any user modified preferences which effect the
    199 performance or behavior of browser components which can impact WebRTC calls.
    200 When hovering over a preference path displayed in this section a clipboard
    201 icon will appear. Clicking that icon will copy the path to the clipboard. It
    202 can then be pasted into `about:config <about:config>`__, to change or reset the
    203 value to its default.
    204 
    205 .. warning::
    206   Unexpected values in this section may be caused by installed extensions. It
    207   is best to test issues in a clean profile when possible using
    208   `about:profiles <about:profiles>`__.
    209 
    210 Media Context
    211 ^^^^^^^^^^^^^
    212 
    213 Information that is gathered to determine Codec availability and capability is
    214 recorded under Media Context.
    215 
    216 
    217 Bottom Control Bar
    218 ^^^^^^^^^^^^^^^^^^
    219 
    220 At the bottom of about:webrtc is a row of buttons which allow the user to
    221 perform miscellaneous actions.
    222 
    223 The `Save Page` button expands all the sections and presents a dialog to save
    224 the contents of the page. This will produce an HTML file suitable for attaching
    225 to bug reports.
    226 
    227 In the event of a WebRTC issue, the :code:`Enable WebRTC Log Preset` button is a very
    228 quick way to start logging. Pressing that button will open a new tab with
    229 `about:logging <about:logging>`__ with the :code:`webrtc` preset selected. This
    230 preset contains all :ref:`standard-logging-modules`. Logging
    231 will begin immediately. If one needs to change other log settings on that page
    232 one can customize them, and then press :code:`Start Logging`. This may be
    233 necessary if one wishes to log to the profiler.
    234 
    235 If experiencing echo cancellation issues, one may be asked to submit echo
    236 cancellation logs. These logs are gathered by pressing the
    237 :code:`Start AEC Logging` button. One should press the button to activate
    238 the logging while actively experiencing an echo cancellation failure.
    239 
    240 .. note::
    241 
    242  Producing echo cancellation logs is incompatible with the content sandbox.
    243  The user will be prompted with further instructions if the sandbox is active
    244  and the :code:`Start AEC Logging` button is pressed.
    245 
    246 .. _audiovideo_delay:
    247 
    248 Audio/Video Delay
    249 ^^^^^^^^^^^^^^^^^
    250 
    251 Delayed media is commonly caused by long physical paths between
    252 endpoints, though anything that slows down inter-hop delivery of packets
    253 can be at fault. Note that this is different than the bandwidth of the
    254 network path, and a high latency will not be fixed by reducing the video
    255 resolution or audio sample rate. Round trip time, or RTT, is the time it
    256 takes for a packet to get from the sender to the receiver and then for a
    257 packet to get from the receiver back to the sender. If the path is
    258 symmetric between the two endpoints one can assume that the one way
    259 delay is half the delay of the round trip.
    260 
    261 The second common cause of A/V delay is jitter, the magnitude of
    262 variability in packet inter-arrival times. In order to smoothly play out
    263 of the incoming stream a receiver experiencing jitter will have to
    264 buffer (delay) incoming packets.
    265 
    266 **Using** `about:webrtc <about:webrtc>`__ **to Diagnose Delay**
    267 
    268 The key metrics in `about:webrtc <about:webrtc>`__ are RTT (round-trip-time) and
    269 jitter. They can be found in the RTP stats section of the
    270 PeerConnection. The PeerConnection informational blocks start out in a
    271 minimized state, and one will need to expand a block to find the RTP
    272 stats section:
    273 
    274 .. figure:: img/about_webrtc_reveal_PeerConnection_stats.png
    275   :alt: How to reveal the full statistics of a PeerConnection in about:webrtc
    276   :width: 800px
    277 
    278   How to reveal the full statistics of a PeerConnection in about:webrtc
    279 
    280 Once expanded one can locate the RTP Stats section and find the key
    281 diagnostic stats:
    282 
    283 .. figure:: img/about_webrtc_Jitter_and_RTT.png
    284   :alt: Location in about:webrtc of jitter and RTT stats
    285   :width: 800px
    286 
    287   Location in about:webrtc of jitter and RTT stats
    288 
    289 In this image we can see that there are 0 milliseconds of jitter, and 32
    290 milliseconds of round trip delay. This call should not be experiencing any
    291 noticeable delay. See the `Delay Calculation <#delay-calculation>`__
    292 appendix section below for some more detail.
    293 
    294 If the perceived delay is larger than the estimated delay that could
    295 indicate a problem within Firefox that requires debugging. Under these
    296 circumstances it would be helpful to grab a JSON copy of the current
    297 stats by pressing the "Copy Report" button, pasting those stats into
    298 your Bugzilla bug report.
    299 
    300 .. figure:: img/about_webrtc_copy_report.png
    301   :alt: Location in about:webrtc of Copy Report button
    302   :width: 800px
    303 
    304   Location in about:webrtc of Copy Report button
    305 
    306 .. _performance-profiling-and-logging:
    307 
    308 Performance Profiling and Logging
    309 ---------------------------------
    310 
    311 .. _capturing-a-firefox-performance-profile:
    312 
    313 Capturing a Firefox Performance Profile
    314 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    315 
    316 For basic performance issues, a performance profile can help engineers
    317 diagnose issues with video formats, performance, and rendering.
    318 
    319 #. Visit https://profiler.firefox.com/ and enable the Profiler toolbar
    320   button.
    321 #. Click the toolbar button down arrow and select 'Media' in the
    322   Settings drop down.
    323 #. Open a tab and visit the page with the affected media content.
    324 #. Click the Profiler toolbar main button to start recording.
    325 #. Play media until the issue you are seeing manifests.
    326 #. Click the Profiler toolbar button again to stop recording.
    327 #. When a new Profile tab opens, click the upload profile button on the
    328   upper right.
    329 #. Copy the resulting profile URL and post this to your Bugzilla report.
    330 
    331 Additionally, detailed logging can be collected within performance
    332 profiles to help aid in debugging complicated issues. To enable the
    333 collection of a profile with low level debugging -
    334 
    335 #. Visit https://profiler.firefox.com/ and enable the Profiler toolbar
    336   button.
    337 #. In a new tab, visit about:webrtc. Click the 'Enable WebRTC Log
    338   Preset' button, which will open a tab for about:logging with
    339   pre-populated information.
    340 #. In about:logging, click the "Start Logging" button. (You are now
    341   recording a profile, the profiler toolbar toggle button should be
    342   selected automatically.)
    343 #. Open a new tab for testing and view the media you are having an issue
    344   with. (After reproducing, DO NOT close this test tab yet.)
    345 #. Switch to the about:logging tab, click 'Stop logging', and then close
    346   the test tab.
    347 #. Wait approximately 10 - 20 seconds for a new tab to automatically
    348   open containing the generated performance profile.
    349 #. Within the upper-right side of the profiler tab click the 'upload
    350   local profile' button to initiate profile upload. Once the upload is
    351   complete, a drop down text field will open displaying the URL of the
    352   profile. Select this text and copy it.
    353 #. Share the URL of the profile for analysis with the engineer you are
    354   working with.
    355 
    356 Alternatively one can set the following environment variable:
    357 
    358 .. code:: sh
    359 
    360   MOZ_LOG="jsep:5,sdp:5,signaling:5,mtransport:5,nicer:5,RTCRtpReceiver:5,RTCRtpSender:5,RTCDMTFSender:5,WebrtcTCPSocket:5,CamerasChild:5,CamerasParent:5,VideoEngine:5,ShmemPool:5,TabShare:5,MediaChild:5,MediaParent:5,MediaManager:5,MediaTrackGraph:5,cubeb:5,MediaStream:5,MediaStreamTrack:5,DriftCompensator:5,ForwardInputTrack:5,MediaRecorder:5,MediaEncoder:5,TrackEncoder:5,VP8TrackEncoder:5,Muxer:5,GetUserMedia:5,MediaPipeline:5,WebAudioAPI:5,webrtc_trace:5,RTCRtpTransceiver:5,ForwardedInputTrack:5,HTMLMediaElement:5,HTMLMediaElementEvents:5"
    361 
    362 .. _standard-logging-modules:
    363 
    364 Standard Logging Modules
    365 ~~~~~~~~~~~~~~~~~~~~~~~~
    366 
    367 .. list-table:: Standard Logging Modules
    368   :header-rows: 1
    369 
    370   * - Module
    371     - Component
    372     - Function
    373     - Notes
    374   * - jsep
    375     - signalling
    376     - JSEP state machine
    377     -
    378   * - sdp
    379     - signalling
    380     - SDP parsing
    381     -
    382   * - mtransport
    383     - networking
    384     - Network transports
    385     -
    386   * - nicer
    387     - networking
    388     - ICE stack
    389     -
    390   * - RTCRtpReceiver
    391     - JS API
    392     - JS API related to receiving media and media control packets
    393     -
    394   * - RTCRtpSender
    395     - JS API
    396     - JS API related to sending media and media control packets
    397     -
    398   * - RTCDMTFSender
    399     - JS API
    400     - JS API related to sending DTMF messages
    401     -
    402   * - WebrtcTCPSocket
    403     - networking
    404     -
    405     -
    406   * - CamerasChild
    407     - media capture
    408     - Content process end of IPC channel for receiving frames from media
    409       capture devices
    410     -
    411   * - CamerasParent
    412     - media capture
    413     - Parent process end of IPC channel for sending frames from media capture devices
    414     -
    415   * - VideoEngine
    416     - media capture
    417     - Orchestrates capture of frames from media capture devices in the parent process
    418     -
    419   * - ShmemPool
    420     - media capture
    421     - Object pool of shared memory frame buffers for transferring media capture frames from parent to child process
    422     -
    423   * - TabShare
    424     - media capture
    425     - Captures tab content for sharing
    426     -
    427   * - MediaChild
    428     - media
    429     -
    430     -
    431   * - MediaParent
    432     - media
    433     -
    434     -
    435   * - MediaManager
    436     - media
    437     -
    438     -
    439   * - MediaTrackGraph
    440     - media
    441     -
    442     -
    443   * - cubeb
    444     - media
    445     -
    446     -
    447   * - MediaStream
    448     - media
    449     -
    450     -
    451   * - MediaStreamTrack
    452     - media
    453     -
    454     -
    455   * - DriftCompensator
    456     - media
    457     -
    458     -
    459   * - ForwardInputTrack
    460     - media
    461     -
    462     -
    463   * - MediaRecorder
    464     - media
    465     -
    466     -
    467   * - MediaEncoder
    468     - media
    469     -
    470     -
    471   * - TrackEncoder
    472     - media
    473     -
    474     -
    475   * - VP8TrackEncoder
    476     - media
    477     -
    478     -
    479   * - Muxer
    480     - media
    481     -
    482     -
    483   * - MediaPipeline
    484     - network
    485     - Glue code between transport, media, and libwebrtc components
    486     -
    487   * - WebAudioAPI
    488     -
    489     -
    490     -
    491   * - webrtc_trace
    492     - webrtc
    493     - libwebrtc logging
    494     - Prior to Firefox v123 it must be enabled from
    495       `about:webrtc <about:webrtc>`__ at runtime, or it must be set in the
    496       :code:`MOZ_LOG` environment variable at launch.
    497   * - RTCRtpTransceiver
    498     - JS API
    499     - implements the RTCRtpTransceiver object
    500     -
    501   * - HTMLMediaElement
    502     -
    503     -
    504     -
    505   * - ForwardedInputTrack
    506     -
    507     -
    508     -
    509   * - HTMLMediaElementEvents
    510     -
    511     -
    512     -
    513 
    514 .. _non-standard-loggin-modules:
    515 
    516 Non-standard Logging Modules
    517 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    518 
    519 .. list-table:: Standard Logging Modules
    520   :header-rows: 1
    521 
    522   * - Module
    523     - Component
    524     - Function
    525     - Notes
    526   * - RTPLogger
    527     - network
    528     - Logs RTP and RTCP packet fragments
    529     - See `Debugging Encrypted Packets <#debugging-encrypted-packets>`__
    530 
    531 .. _examining-call-performance-issues:
    532 
    533 Examining Call Performance Issues
    534 ---------------------------------
    535 
    536 .. _enabling-call-stats-history:
    537 
    538 Enabling Call Stats History
    539 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    540 
    541 Call stats history is enabled by default in Nightly. To enable in
    542 release builds open `about:config <about:config>`__, and change
    543 "media.aboutwebrtc.hist.enabled" to true. This will keep a history
    544 window of stats for a number of recent calls, allowing for inspection
    545 in `about:webrtc <about:webrtc>`__ after a call has completed.
    546 
    547 .. _dumping-call-stats:
    548 
    549 Dumping Call Stats
    550 ~~~~~~~~~~~~~~~~~~
    551 
    552 One can dump a JSON blob of call stats for an active call, or a recent
    553 call if call stats history is enabled. There are two buttons in
    554 `about:webrtc <about:webrtc>`__ to do this, "Copy Report" and "Copy Report
    555 History". The former will create a copy of the most recent stats for the
    556 PeerConnection. The later will copy all the history of stats reports
    557 that `about:webrtc <about:webrtc>`__ has accumulated for that PeerConnection, this
    558 can be up to several minutes of stats.
    559 
    560 .. _debugging-encrypted-packets:
    561 
    562 Debugging Encrypted Packets
    563 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    564 
    565 .. warning::
    566   There is a `blog
    567   post <https://blog.mozilla.org/webrtc/debugging-encrypted-rtp-is-more-fun-than-it-used-to-be/>`__
    568   covering dumping unencrypted partial RTP and RTCP packets in the logs.
    569   While the information presented in that post is still relevant,
    570   the command to extract the packet data in the blog is out of date. A
    571   working method is presented below;
    572 
    573 Using the gecko logging system, unencrypted, mangled, partial, RTP-packets can
    574 be written out. This may be a good avenue of investigation for packet loss and
    575 recovery, simulcast, and feedback. Because the entirety of the packet is not
    576 guaranteed to be logged, this is less suitable for debugging issues with
    577 encoded media. These logged packets can be converted to PCAP files, which can
    578 then be explored in `Wireshark <https://www.wireshark.org/>`__. The logs
    579 produced by this module can be quite large, making it easy to identify by file
    580 size which child process log files contain packet dumps.
    581 
    582 To start RTP logging, one must enable the :code:`RtpLogger` log module. The :code:`sync`
    583 option should also be used, as it prevents undesirable interleaving of log
    584 messages. Here are the minimal log settings needed:
    585 
    586 .. code:: sh
    587 
    588   MOZ_LOG='sync,RtpLogger:5'
    589 
    590 In order to interpret the packet contents, one needs to refer to the SDP.
    591 Wireshark is unaware of the negotiated details, so it can not directly decode
    592 the media, nor can it decode the header extensions. The SDP can also be logged,
    593 and so the following is a more useful set of log settings:
    594 
    595 .. code:: sh
    596 
    597   MOZ_LOG='sync,RtpLogger:5,jsep:5'
    598 
    599 .. note::
    600 
    601   On macOS it is simple to install Wireshark and text2pcap with Homebrew:
    602 
    603   .. code:: sh
    604 
    605      # Use only one of the following:
    606      # ==============================
    607 
    608      # To install the Wireshark GUI application and the command line utilities:
    609      brew install --cask wireshark
    610 
    611      # To install only the command line utilities:
    612      brew install wireshark
    613 
    614 One can use :code:`tee` to capture log output
    615 from a copy of Firefox launched from the command line, e.g. through
    616 :code:`mach`. Alternatively, one can set a log file through the environment
    617 variable :code:`MOZ_LOG_FILE` or through about:logging.
    618 
    619 .. warning::
    620 
    621   If log files are not being created by child processes, this is likely due
    622   to sandboxing of content processes. To work around this one must either
    623   select a location within the sandbox, disable the content sandbox, or launch
    624   Firefox from the command line, e.g. from a Firefox dev environment:
    625 
    626   .. code::
    627 
    628      MOZ_LOG=sync,RtpLogger:5,jsep:5 MOZ_LOG_FILE= ./mach run 2>&1 | tee your.log
    629 
    630 
    631 To produce a PCAP file one needs to filter the logs to include only the
    632 RtpLogger log lines, reduce them down to the expected ingestion format for
    633 text2pcap, and finally to invoke text2pcap.
    634 
    635 .. code:: sh
    636 
    637   cat your.log  | rg 'RtpLogger.*RTC?P_PACKET|>>\s(?P<packet>.+$)' --only-matching  --replace '$packet' | text2pcap -D -n -l 1 -i 17 -u 1234,1235 -t '%H:%M:%S.' - your.output.pcap
    638 
    639 .. note::
    640 
    641   If :code:`rg`, a.k.a ripgrep, is not already available, one can install it via one of the following methods:
    642 
    643   .. code:: sh
    644 
    645      # Install through cargo on macOS, Linux, or Windows
    646      cargo install ripgrep
    647 
    648      # Install via Homebrew on macOS
    649      brew install ripgrep
    650 
    651      # ripgrep packages may be available through the package manager for your
    652      # Linux distro
    653 
    654 
    655 The resulting PCAP file can be explored with Wireshark. Currently, one must refer to the SDP in order to interpret the RTP packets.
    656 
    657 .. code:: sh
    658 
    659   # On most Linux distros
    660   wireshark -d 'udp.port==1234,rtp' your.output.pcap
    661 
    662   # On macOS when installed via Homebrew
    663   open /Applications/Wireshark.app --args -d 'udp.port==1234,rtp' your.output.pcap
    664 
    665 .. _examining-codec_availability-and-capabilities:
    666 
    667 Examining Codec Availability and Capabilities
    668 ---------------------------------------------
    669 
    670 When codec negotiation doesn't happen as expected there are several helpful
    671 locations where one can find information. The SDP offer and answer contain the
    672 list of codecs that were in the initial offer, and the subset of those codecs
    673 that were selected in the answer.
    674 
    675 The easiest way to get this information on  a live call is through
    676 about:webrtc. Each RTCPeerConnection has its own subsection, that when
    677 expanded contains an SDP section. There are buttons to display the offer
    678 and the answer. Depending on which party was the offerer and which was
    679 the answerer one may have a local offer and a remote answer, or a remote offer
    680 and a local answer.
    681 
    682 Firefox chooses which codecs to offer based on availability. Some codecs,
    683 like Opus or VP8, are always available. Some codecs are available in software
    684 and some codecs on some platforms are available in hardware. H264 support is
    685 provided by a third-party, and is automatically downloaded the first time its
    686 use is requested. This is a process which can take a variable amount of time
    687 depending on network circumstances.
    688 
    689 .. note::
    690   A list of media codecs with playback support are available in the Media
    691   section of `about:support#media <about:support#media>`__ . Not all media
    692   codecs present and available to Firefox for playback are supported in WebRTC
    693   calls.
    694 
    695 To check the current factors, including preferences, that are being used to
    696 calculate availability beyond codec presence, one can check the `Media Context`
    697 section of about:webrtc.
    698 
    699 .. figure:: img/about_webrtc_media_context.png
    700   :alt: example about:webrtc media context values
    701 
    702 .. _running-webrtc-tests:
    703 
    704 For an in-depth reference covering the codecs available through WebRTC please
    705 see the MDN Page: `Codecs Used by WebRTC <https://developer.mozilla.org/en-US/docs/Web/Media/Formats/WebRTC_codecs>`__.
    706 
    707 Running WebRTC Tests
    708 --------------------
    709 
    710 There are a variety of tests providing coverage over WebRTC related code. The
    711 Web Platform Suite provides conformance tests for browsers. The
    712 :code:`gtest` suite is composed of unit tests. Crashtests are a type of
    713 regression test which are written to induce crashes. There are fuzzing tests
    714 which exercise APIs in ways that the authors did not foresee. All of the WebRTC
    715 tests can be run locally with :code:`mach` or in CI on `Try`. There is a
    716 detailed overview of all available test types including those not exercised by
    717 WebRTC code `here </testing/automated-testing/index.html#functional-testing>`__.
    718 
    719 .. note::
    720   Running :code:`./mach <verb> --help` is an indispensable tool for discovering
    721   options that can streamline your testing process.
    722 
    723 .. note::
    724   A test suite on `Try` maybe an aggregate of multiple logical test suites.
    725   For example, the `mochitest-media` suite on try includes both the WebRTC and
    726   playback mochitests.
    727 
    728 .. warning::
    729   WebRTC calls make use of a number of internal timers. Amongst the
    730   behaviors these timers control are transport selection, bandwidth estimation,
    731   packet loss determination, media adaptation, lip sync, connection timeout,
    732   and more. There are `Try` targets which are too slow to reliably run a
    733   number of the tests. Before running a specific test on `Try` for the first
    734   time, it may be best to check the relevant test suite manifest. This can be
    735   done easily with Searchfox.org by searching for and viewing a test file. If
    736   that test has been disabled on one or more platforms the details will appear
    737   as shown below:
    738 
    739   .. figure:: img/searchfox_test_disabled_warning.png
    740      :alt: Searchfox.org warning that the displayed test file has been disabled on Android
    741 
    742 .. _test-atlas:
    743 
    744 Test Atlas
    745 ----------
    746 
    747 .. list-table:: WebRTC Test Locations
    748   :widths: 10 10 20 10 10
    749   :header-rows: 1
    750 
    751   * - Component
    752     - Test type
    753     - Test file location
    754     - Try suite
    755     - Treeherder Abbreviations
    756   * - WebRTC
    757     - Mochitest
    758     - dom/media/webrtc/mochitests
    759     - mochitest-media
    760     - :code:`mda`, :code:`M(mda)`
    761   * -
    762     - Web Platform Test
    763     - testing/web-platform/tests/webrtc
    764     - wpt
    765     - :code:`wpt`, :code:`W(wpt)`
    766   * -
    767     - Crashtest
    768     - dom/media/webrtc/tests/crashtests
    769     - crash
    770     - :code:`R(C)`
    771   * - WebRTC Signalling
    772     - GTest
    773     - media/webrtc/signaling/gtest
    774     - gtest
    775     - :code:`gtest`
    776   * - WebRTC (gUM / gDDM)
    777     - Browser Chrome Test (mochitest)
    778     - browser/base/content/test/webrtc
    779     - browser-chrome
    780     - :code:`bc`, :code:`M(bc)`
    781   * - WebRTC Transport
    782     - CPPUnit
    783     - dom/media/webrtc/transport/test
    784     - cppunit
    785     -
    786   * -
    787     - fuzztest
    788     - dom/media/webrtc/transport/fuzztest
    789     - fuzzing
    790     -
    791   * - SDP parser
    792     - Fuzzing
    793     - dom/media/webrtc/tests/fuzztests
    794     - fuzzing
    795     -
    796 
    797 .. _webrtc-web-platform-tests:
    798 
    799 Web Platform Tests
    800 ~~~~~~~~~~~~~~~~~~
    801 
    802 The WPT suite comprises conformance tests for various W3C specs such as: CSS,
    803 JS APIs, and HTML. WebRTC is a JS API and as such its tests are of the `testharness.js <https://web-platform-tests.org/writing-tests/testharness.html>`__ type.
    804 There is detailed :code:`WPT` documentation available `here </web-platform/index.html#web-platform-tests>`__
    805 Web Platform Tests can be run locally from
    806 
    807 .. code:: bash
    808 
    809   # Run the entire WebRTC WPT test suite
    810   ./mach wpt testing/web-platform/tests/webrtc
    811 
    812   # Run a single test, e.g. RTCPeerConnection-createAnswer.html
    813   ./mach wpt testing/web-platform/tests/webrtc/RTCPeerConnection-createAnswer.html
    814 
    815   # Run all of the PeerConnection tests, i.e. RTCPeerConnection-*.html
    816   # NOTE that the `mach` verb in use is `test` not `wpt`
    817   ./mach test testing/web-platform/tests/webrtc/RTCPeerConnection
    818 
    819 .. warning::
    820   Running the :code:`WPT` tests locally can be very disruptive to one's working
    821   desktop environment, as windows will frequently appear and grab focus. Using
    822   :code:`mach`'s :code:`--headless` flag will prevent this, and can be a great
    823   way to run them if one's problem can be evaluated from command line output.
    824 
    825 These tests are synced from the main `Web Platform Test
    826 repository <https://github.com/web-platform-tests/wpt>`__, and likewise
    827 our changes are synced from our `in-tree
    828 copy <https://searchfox.org/mozilla-central/search?q=&path=testing%2Fweb-platform%2Ftests%2Fwebrtc&case=false&regexp=false>`__
    829 back to that repository.
    830 
    831 .. warning::
    832   Running the WebRTC mochitests in `Try` is done using the entire Web Platform Test suite, :code:`wpt`.
    833   As such, this can be slow.
    834 
    835 .. code:: bash
    836 
    837   ./mach try fuzzy --query 'wpt'
    838 
    839 One can `run those same tests in
    840 Chromium <https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/testing/web_platform_tests_wptrunner.md>`__,
    841 Safari, or Servo if one needs to compare behavior between browsers. This can be
    842 done directly through :code:`mach`, see `running tests in other browsers </web-platform/index.html#running-tests-in-other-browsers>`__
    843 for more details.
    844 
    845 .. _mochitests:
    846 
    847 Mochitests
    848 ~~~~~~~~~~
    849 
    850 The WebRTC mochitests are integration tests, regression tests, and sanity
    851 tests. The needs of these tests did not align with specification conformance
    852 testing in the WPT, Web Platform Test, suite. Before writing a new mochitest,
    853 one should consider if a test would be better expressed as a WPT, which all browsers
    854 can test against.
    855 
    856 Locally running the WebRTC mochitests should be done in a Firefox dev
    857 environment using :code:`mach` as follows:
    858 
    859 .. code:: bash
    860 
    861   # Run the whole suite
    862   ./mach mochitest dom/media/webrtc/tests/mochitests
    863 
    864   # Run a single test, e.g. test_peerConnection_basicAudioVideo.html
    865   ./mach mochitest dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioVideo.html
    866   # Or
    867   ./mach mochitest test_peerConnection_basicAudioVideo.html
    868 
    869   # Run all of the PeerConnection tests, i.e. test_peerConnection_*.html
    870   ./mach mochitest test_peerConnection
    871 
    872 
    873 On :code:`try`, WebRTC mochitests are part of the larger media test suite.
    874 This suite can be easily selected with the following fuzzy query:
    875 
    876 .. code:: bash
    877 
    878   # Run the media mochitest suite on all regular platforms
    879   ./mach try fuzzy --query 'mochitest-media'
    880 
    881   # Run the media mochitest suite only on Linux which will resolve far faster
    882   ./mach try fuzzy --query 'linux mochitest-media'
    883 
    884 
    885 .. _gtests:
    886 
    887 GTests
    888 ~~~~~~
    889 
    890 The gtests are all compiled into a single library target: :code:`xul-test`.
    891 This makes running gtests from :code:`mach` slightly different than the other
    892 test types.
    893 
    894 .. code:: bash
    895 
    896   # Run a single test by using Prefix.TestName, e.g. JsepSessionTest.FullCall
    897   # https://searchfox.org/mozilla-central/rev/4d6a5b97428760d15bfcad13f8fc81439370a7ec/media/webrtc/signaling/gtest/jsep_session_unittest.cpp#1551
    898   ./mach gtest 'JsepSessionTest.FullCall'
    899 
    900   # Run all the tests in a single Prefix, e.g. JsepSessionTest
    901   ./mach gtest 'JsepSessiontTest.*'
    902 
    903   # Run all tests which have a Prefix.TestName containing the substring 'Jsep'
    904   # See the table of selectors below
    905   ./mach gtest '*Jsep*'
    906 
    907   # Run all the gtests for Firefox
    908   ./mach gtest
    909 
    910 Here is a list of helpful substring selectors for executing specific WebRTC gtests:
    911 
    912 .. list-table:: WebRTC GTest Selectors
    913   :header-rows: 1
    914 
    915   * - Selector
    916     - Description
    917     - Files
    918   * - :code:`*Jsep*`
    919     - JSEP (signalling) tests
    920     - `jsep_session_unittest.cpp <https://searchfox.org/mozilla-central/source/media/webrtc/signaling/gtest/jsep_session_unittest.cpp>`__
    921       `jsep_trak_unittest.cpp <https://searchfox.org/mozilla-central/source/media/webrtc/signaling/gtest/jsep_track_unittest.cpp>`__
    922   * - :code:`*Sdp*`
    923     - SDP parsing tests
    924     - `sdp_unittests.cpp <https://searchfox.org/mozilla-central/source/media/webrtc/signaling/gtest/sdp_unittests.cpp>`__
    925   * - :code:`*MediaPipeline*`
    926     - MediaPipline and MediaPipeline filter tests for RTP media handling
    927     - `mediapipeline_unittest.cpp <https://searchfox.org/mozilla-central/source/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp>`__
    928   * - :code:`*AudioConduit*`
    929     - AudioConduit tests for libwebrtc glue for RTP audio media
    930     - `audioconduit_unittests.cpp <https://searchfox.org/mozilla-central/source/media/webrtc/signaling/gtest/audioconduit_unittests.cpp>`__
    931   * - :code:`*VideoConduit*`
    932     - VideoConduit tests for libwebrtc glue for RTP video media
    933     - `videoconduit_unittests.cpp <https://searchfox.org/mozilla-central/source/media/webrtc/signaling/gtest/videoconduit_unittests.cpp>`__
    934 
    935 For more general information about gtests see the documentation `here </gtest/index.html>`__.
    936 
    937 Fuzz Testing
    938 ~~~~~~~~~~~~
    939 
    940 It is not common to need to run fuzz testing as it is run on a semi-continuous
    941 fashion in CI. It is more likely that one will need to respond to a bug filed
    942 by a fuzzing bot. If one is interested in fuzzing one should consult the
    943 excellent documentation available `here </tools/fuzzing/index.html>`__.
    944 
    945 .. _code-atlas:
    946 
    947 Code Atlas
    948 ----------
    949 
    950 There are a number of components that work together to create a successful
    951 WebRTC call. When debugging a call it can be difficult to see the larger puzzle
    952 for all the pieces. A listing of the WebRTC related source code directories is
    953 provided below to help one navigate.
    954 
    955 .. list-table:: WebRTC Code Atlas
    956   :header-rows: 1
    957 
    958   * - Directory
    959     - Component
    960     - Description
    961     - Notes
    962   * - `dom/media/webrtc <https://searchfox.org/mozilla-central/source/dom/media/webrtc>`__
    963     - WebRTC
    964     - This is the primary directory for Firefox WebRTC code
    965     -
    966   * - `dom/media/webrtc/common <https://searchfox.org/mozilla-central/source/dom/media/webrtc/common>`__
    967     - WebRTC
    968     - This contains WebRTC related utility code
    969     -
    970   * - `dom/media/webrtc/jsapi <https://searchfox.org/mozilla-central/source/dom/media/webrtc/jsapi>`__
    971     - JS API
    972     - This contains the C++ implementations of the JavaScript WebRTC interfaces
    973     -
    974   * - `dom/media/webrtc/jsep <https://searchfox.org/mozilla-central/source/dom/media/webrtc/jsep>`__
    975     - Signalling
    976     - This is the JSEP state engine implementation
    977     -
    978   * - `dom/media/webrtc/libwebrtcglue <https://searchfox.org/mozilla-central/source/dom/media/webrtc/libwebrtcglue>`__
    979     - WebRTC (various)
    980     - This is the glue code between libwebrtc and Firefox
    981     -
    982   * - `dom/media/webrtc/libwebrtc_overrides <https://searchfox.org/mozilla-central/source/dom/media/webrtc/libwebrtc_overrides>`__
    983     - WebRTC (various)
    984     - Firefox-specific overrides for libwebrtc components
    985     -
    986   * - `dom/media/webrtc/sdp <https://searchfox.org/mozilla-central/source/dom/media/webrtc/sdp>`__
    987     - Signalling
    988     - This contains the SDP parsing interface
    989     -
    990   * - `dom/media/webrtc/tests <https://searchfox.org/mozilla-central/source/dom/media/webrtc/tests>`__
    991     - Tests
    992     - This contains `some` of the WebRTC related tests
    993     -
    994   * - `dom/media/webrtc/third_party_build <https://searchfox.org/mozilla-central/source/dom/media/webrtc/third_party_build>`__
    995     - Build
    996     - The scripting and configuration for vendoring new versions of libwebrtc are here
    997     - This is unlikely to be of concern for debugging
    998   * - `dom/media/webrtc/transport <https://searchfox.org/mozilla-central/source/dom/media/webrtc/transport>`__
    999     - Network
   1000     - This contains the ICE implementation, the MDNS implementation, and transport code
   1001     -
   1002   * - `dom/media/webrtc/transport/ipc <https://searchfox.org/mozilla-central/source/dom/media/webrtc/transport/ipc>`__
   1003     - Network
   1004     - IPDL protocols for WebRTC transport, including STUN address requests and WebRTC TCP sockets
   1005     -
   1006   * - `dom/media/webrtc/transportbridge <https://searchfox.org/mozilla-central/source/dom/media/webrtc/transportbridge>`__
   1007     - WebRTC
   1008     - This contains the MediaPipeline and MediaPipeline filter code which is glue between transport and the libwebrtc RTP stack
   1009     -
   1010   * - `third_party/libsrtp <https://searchfox.org/mozilla-central/source/third_party/libsrtp>`__
   1011     - Network
   1012     - This is the SRTP implementation used by Firefox
   1013     -
   1014   * - `third_party/libwebrtc <https://searchfox.org/mozilla-central/source/third_party/libwebrtc>`__
   1015     - WebRTC (various)
   1016     - libwebrtc handles many aspects of WebRTC calls above the transport layer and below the presentation layer
   1017     -
   1018   * - `third_party/rust/webrtc-sdp <https://searchfox.org/mozilla-central/source/third_party/rust/webrtc-sdp>`__
   1019     - Signalling
   1020     - webrtc-sdp is a Rust implementation of a WebRTC-only SDP parser
   1021     -
   1022   * - `third_party/sipcc <https://searchfox.org/mozilla-central/source/third_party/sipcc>`__
   1023     - Signalling
   1024     - sipcc is a C implementation of a general SDP parser
   1025     - this carries many local modifications
   1026   * - `dom/media <https://searchfox.org/mozilla-central/source/dom/media>`__
   1027     - Media Capture
   1028     - GetUserMedia and related classes are here
   1029     - There are many other unrelated media source files here
   1030   * - `dom/media/systemservices <https://searchfox.org/mozilla-central/source/dom/media/systemservices>`__
   1031     - Media Capture
   1032     - System services for media capture including camera/microphone access
   1033     - Contains CamerasChild, CamerasParent, VideoEngine, and platform-specific implementations
   1034   * - `dom/media/encoder <https://searchfox.org/mozilla-central/source/dom/media/encoder>`__
   1035     - Media Encoding
   1036     - Media encoders for recording, including Opus and VP8 track encoders
   1037     -
   1038   * - `dom/media/gmp <https://searchfox.org/mozilla-central/source/dom/media/gmp>`__
   1039     - Media Codecs
   1040     - Gecko Media Plugin (GMP) framework for sandboxed codec plugins
   1041     - Used by WebRTC for H.264 codec support
   1042   * - `dom/media/platforms <https://searchfox.org/mozilla-central/source/dom/media/platforms>`__
   1043     - Media Codecs
   1044     - Platform-specific encoder/decoder implementations (Apple, Android, FFmpeg, WMF)
   1045     - Contains PlatformEncoderModule and EncoderConfig used by WebRTC
   1046   * - `netwerk/sctp/datachannel <https://searchfox.org/mozilla-central/source/netwerk/sctp/datachannel>`__
   1047     - Data Channels
   1048     - SCTP-based data channel implementation
   1049     -
   1050   * - `browser/components/webrtc <https://searchfox.org/mozilla-central/source/browser/components/webrtc>`__
   1051     - Browser UI
   1052     - Browser-level WebRTC UI components including permission prompts and indicators
   1053     -
   1054   * - `toolkit/content/aboutwebrtc <https://searchfox.org/mozilla-central/source/toolkit/content/aboutwebrtc>`__
   1055     - Debugging
   1056     - Implementation of the about:webrtc debugging page
   1057     -
   1058   * - `media/webrtc/signaling <https://searchfox.org/mozilla-central/source/media/webrtc/signaling>`__
   1059     - Signalling
   1060     - WebRTC signaling implementation and GTests
   1061     -
   1062   * - `browser/base/content/test/webrtc <https://searchfox.org/mozilla-central/source/browser/base/content/test/webrtc>`__
   1063     - Tests
   1064     - Browser chrome tests for WebRTC getUserMedia and getDisplayMedia
   1065     -
   1066   * - `testing/web-platform/tests/webrtc <https://searchfox.org/mozilla-central/source/testing/web-platform/tests/webrtc>`__
   1067     - Tests
   1068     - Web Platform Tests for WebRTC conformance
   1069     - Also includes webrtc-encoded-transform, webrtc-extensions, webrtc-ice, webrtc-identity, webrtc-priority, webrtc-stats, webrtc-svc
   1070   * - `dom/webidl <https://searchfox.org/mozilla-central/source/dom/webidl>`__
   1071     - WebIDL (JS API)
   1072     - This contains the WebIDL definitions for the WebRTC JS API amongst many other WebIDL definitions
   1073     -  :code:`RTC*.webidl`
   1074 
   1075 .. _standards-documentation:
   1076 
   1077 Standards Documentation
   1078 -----------------------
   1079 
   1080 When debugging API behavior it may be necessary to consult the specifications
   1081 for WebRTC. The ECMAScript API is defined in several W3C standards,
   1082 `webrtc-pc <https://www.w3.org/TR/webrtc/>`__, and
   1083 `webrtc-stats <https://www.w3.org/TR/webrtc-stats/>`__. The number of IETF
   1084 standards that are incorporated into WebRTC are too numerous to list here. One
   1085 can find these standards in the
   1086 `Normative References <https://www.w3.org/TR/webrtc/#normative-references>`__
   1087 section of the :code:`webrtc-pc` spec.
   1088 
   1089 .. _delay-calculation:
   1090 
   1091 Appendix: Delay Calculation
   1092 ---------------------------
   1093 
   1094 For all intents and purposes jitter and RTT are
   1095 additive in nature. If there was 25ms of jitter reported and a RTT of
   1096 272ms, one could estimate the expected delay from transmission at the
   1097 send side to play out on receive side to be
   1098 
   1099 ::
   1100 
   1101   25ms + (272ms / 2) = 161ms
   1102 
   1103 .. _glossary:
   1104 
   1105 Appendix: WebRTC Glossary
   1106 -------------------------
   1107 
   1108 Session Management Terms
   1109 ~~~~~~~~~~~~~~~~~~~~~~~~
   1110 
   1111 **Offer** An SDP document created by one peer to initiate a connection,
   1112 proposing media parameters and capabilities.
   1113 
   1114 **Answer** An SDP document created in response to an offer, accepting or
   1115 rejecting the proposed media parameters.
   1116 
   1117 **Pranswer (Provisional Answer)** A preliminary answer that may be
   1118 modified before the final answer is accepted, allowing for early media
   1119 establishment.
   1120 
   1121 **Rollback** The action of reverting to a previous stable session state,
   1122 typically used when negotiation fails or needs to be cancelled. During
   1123 offer/answer negotiation, the ICE agent automatically initiates rollback
   1124 when an offer collision occurs (e.g., receiving an offer while in
   1125 have-local-offer state). Learn more about `perfect
   1126 negotiation <https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation>`__
   1127 on MDN and RFC 9429
   1128 `§4.1.10.2 <https://www.rfc-editor.org/rfc/rfc9429#section-4.1.10.2>`__
   1129 and `§5.7 <https://www.rfc-editor.org/rfc/rfc9429#section-5.7>`__.
   1130 
   1131 **Perfect Negotiation** A design pattern for WebRTC signaling that
   1132 handles offer collisions gracefully using rollback, allowing both peers
   1133 to attempt to be the offerer simultaneously without complex glare
   1134 handling logic. Learn more about `perfect
   1135 negotiation <https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation>`__
   1136 on MDN.
   1137 
   1138 **Signaling State** The current state of the offer/answer negotiation
   1139 process (``stable``, ``have-local-offer``, ``have-remote-offer``,
   1140 ``have-local-pranswer``, ``have-remote-pranswer``, ``closed``). Learn
   1141 more about
   1142 `signalingState <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/signalingState>`__
   1143 on MDN and RFC 9429
   1144 `§3.2 <https://www.rfc-editor.org/rfc/rfc9429#section-3.2>`__.
   1145 
   1146 **Pending Description** An offer or answer that has been created or set
   1147 but not yet matched with a corresponding answer or offer. Learn more
   1148 about
   1149 `pendingLocalDescription <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/pendingLocalDescription>`__
   1150 and
   1151 `pendingRemoteDescription <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/pendingRemoteDescription>`__
   1152 on MDN and RFC 9429
   1153 `§4.1.14 <https://www.rfc-editor.org/rfc/rfc9429#section-4.1.14>`__ and
   1154 `§4.1.16 <https://www.rfc-editor.org/rfc/rfc9429#section-4.1.16>`__.
   1155 
   1156 **Current Description** The currently active local or remote session
   1157 description after successful negotiation. Learn more about
   1158 `currentLocalDescription <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/currentLocalDescription>`__
   1159 and
   1160 `currentRemoteDescription <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/currentRemoteDescription>`__
   1161 on MDN and RFC 9429
   1162 `§4.1.13 <https://www.rfc-editor.org/rfc/rfc9429#section-4.1.13>`__ and
   1163 `§4.1.15 <https://www.rfc-editor.org/rfc/rfc9429#section-4.1.15>`__.
   1164 
   1165 Transport and Bundle Terms
   1166 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   1167 
   1168 **Bundle Policy** Controls how multiple media tracks are combined onto a
   1169 single transport (``balanced``, ``max-compat``, ``max-bundle``). Learn
   1170 more about
   1171 `transports <https://developer.mozilla.org/en-US/docs/Web/API/RTCDtlsTransport#allocation_of_dtls_transports>`__
   1172 and `bundle
   1173 configuration <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#bundlepolicy>`__
   1174 on MDN.
   1175 
   1176 **Bundle Level** The m-line index of the media section that provides the
   1177 transport for bundled media.
   1178 
   1179 **Transport ID** A unique identifier for a transport used to carry media
   1180 or data.
   1181 
   1182 **ICE Restart** The process of restarting ICE candidate gathering and
   1183 connectivity checks, typically to recover from network changes.
   1184 
   1185 **ICE Trickle** A technique where ICE candidates are incrementally sent
   1186 to the remote peer as they are gathered, rather than waiting for all
   1187 candidates to be collected before beginning negotiation. Learn more
   1188 about
   1189 `connectivity <https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Connectivity>`__
   1190 on MDN and `trickle
   1191 detection <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/canTrickleIceCandidates>`__
   1192 on in the JSEP spec.
   1193 
   1194 **ICE Credentials (ufrag/pwd)** Username fragment and password used for
   1195 ICE connectivity checks.
   1196 
   1197 **DTLS Fingerprint** A cryptographic hash of the DTLS certificate used
   1198 to verify the identity of the peer. Learn more about `RTCCertificate
   1199 fingerprints <https://developer.mozilla.org/en-US/docs/Web/API/RTCCertificate/getFingerprints>`__
   1200 on MDN and RFC 8122
   1201 `§5 <https://www.rfc-editor.org/rfc/rfc8122#section-5>`__ and RFC 4572
   1202 `§1 <https://www.rfc-editor.org/rfc/rfc4572#section-1>`__.
   1203 
   1204 **ICE Lite** A simplified ICE implementation that only acts as a
   1205 controlled agent, used by servers. Learn more about ICE Lite in RFC 8445
   1206 `§3 <https://www.rfc-editor.org/rfc/rfc8445#section-3>`__.
   1207 
   1208 **ICE Controlling** The ICE agent role that makes the final decision on
   1209 which candidate pair to use.
   1210 
   1211 **Candidate** An ICE candidate describing the protocols and routing
   1212 needed for WebRTC to communicate with a remote device. Each candidate
   1213 specifies network connectivity information including IP address, port,
   1214 transport protocol, and candidate type (host, srflx, prflx, relay).
   1215 Candidates are gathered during connection establishment and exchanged
   1216 between peers. Learn more about
   1217 `RTCIceCandidate <https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate>`__
   1218 on MDN and RFC 8445
   1219 `§2 <https://www.rfc-editor.org/rfc/rfc8445#section-2>`__.
   1220 
   1221 **Candidate Pair** A pairing of a local and remote ICE candidate that
   1222 together describe a viable connection path between two WebRTC endpoints.
   1223 During ICE connectivity checks, candidate pairs are tested to determine
   1224 which provides the best connection. The selected candidate pair is used
   1225 for media and data transport. Learn more about
   1226 `RTCIceCandidatePair <https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidatePair>`__
   1227 and `candidate pair
   1228 stats <https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidatePairStats>`__
   1229 on MDN and RFC 8445
   1230 `§2 <https://www.rfc-editor.org/rfc/rfc8445#section-2>`__.
   1231 
   1232 Codec and Media Encoding Terms
   1233 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1234 
   1235 **Payload Type (PT)** A numeric identifier (0-127) in RTP packets that
   1236 identifies the codec being used. Payload types 0-95 are statically
   1237 assigned for common codecs, while 96-127 are dynamically assigned and
   1238 negotiated via SDP. Learn more about `RTP
   1239 parameters <https://www.iana.org/assignments/rtp-parameters>`__ via the
   1240 IANA registry where many of the relevant RFCs for specific formats are
   1241 linked.
   1242 
   1243 **FMTP (Format Parameters)** SDP attribute containing codec-specific
   1244 parameters like profile, level, or packetization mode.
   1245 
   1246 **RTX (Retransmission)** A mechanism for retransmitting lost RTP
   1247 packets, using a separate payload type.
   1248 
   1249 **RED (Redundant Encoding)** A mechanism for including redundant data in
   1250 RTP packets to help with packet loss recovery.
   1251 
   1252 **ULPFEC (Uneven Level Protection Forward Error Correction)** Forward
   1253 error correction mechanism for protecting video streams against packet
   1254 loss. Learn more about ULPFEC in RFC 5109
   1255 `§1 <https://datatracker.ietf.org/doc/html/rfc5109#section-1>`__.
   1256 
   1257 **FEC (Forward Error Correction)** Technique of adding redundancy to
   1258 transmitted data to allow recovery from errors without retransmission.
   1259 
   1260 **Opus** A versatile audio codec widely used in WebRTC, supporting both
   1261 voice and music at various bitrates. Learn more about
   1262 `Opus <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#opus>`__
   1263 on MDN.
   1264 
   1265 **VP8** An open video codec developed by Google, mandatory for WebRTC
   1266 implementations. Learn more about
   1267 `VP8 <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#vp8>`__
   1268 on MDN.
   1269 
   1270 **VP9** An improved successor to VP8, offering better compression
   1271 efficiency.
   1272 
   1273 **AV1** A modern open video codec offering significant compression
   1274 improvements over VP9. Learn more about
   1275 `AV1 <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#av1>`__
   1276 on MDN.
   1277 
   1278 **H.264/AVC (Advanced Video Coding)** A widely-used video codec,
   1279 mandatory for WebRTC implementations. Learn more about
   1280 `AVC/H.264 <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#avc_h.264>`__
   1281 on MDN.
   1282 
   1283 **H.265/HEVC (High Efficiency Video Coding)** A successor to H.264
   1284 offering improved compression efficiency, with hardware-dependent
   1285 support in modern browsers. Chrome 136+ and Safari support H.265 in
   1286 WebRTC when available via hardware. Learn more about `video
   1287 codecs <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Video_codecs>`__
   1288 on MDN.
   1289 
   1290 **G.722** A wideband audio codec operating at 64 kbit/s. Learn more
   1291 about
   1292 `G.722 <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Audio_codecs#g.722_64_kbps_7_khz_audio_coding>`__
   1293 on MDN.
   1294 
   1295 **PCMU/PCMA** G.711 audio codecs (μ-law and A-law) offering basic audio
   1296 quality, mandatory for WebRTC. Learn more about
   1297 `G.711 <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#g.711>`__
   1298 on MDN.
   1299 
   1300 RTP Header Extensions and Features
   1301 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1302 
   1303 **RTP Extension (extmap)** RTP header extensions that carry additional
   1304 metadata like audio levels or video orientation.
   1305 
   1306 **SSRC (Synchronization Source)** A 32-bit identifier for a single
   1307 source of RTP packets within an RTP session.
   1308 
   1309 **CNAME (Canonical Name)** A persistent identifier for an RTP source
   1310 that remains constant across SSRCs.
   1311 
   1312 **RID (Restriction Identifier)** An identifier used in simulcast to
   1313 distinguish between different encodings of the same source.
   1314 
   1315 **MID (Media Identification)** An identifier that associates an RTP
   1316 stream with a specific m-line in the SDP.
   1317 
   1318 **MSID (Media Stream Identification)** An identifier that associates an
   1319 RTP stream with a MediaStream and track.
   1320 
   1321 Common RTP Header Extensions
   1322 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1323 
   1324 RTP header extensions carry additional metadata in RTP packets using the
   1325 framework defined in RFC 8285. All extensions must be negotiated via SDP
   1326 before use.
   1327 
   1328 **Audio Level (Client-to-Mixer)** Indicates the audio level of the RTP
   1329 packet payload in -dBov, allowing servers to identify active speakers
   1330 without decoding audio. URI:
   1331 ``urn:ietf:params:rtp-hdrext:ssrc-audio-level``. Learn more about `audio
   1332 level
   1333 indication <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/getParameters#headerextensions>`__
   1334 on MDN and RFC 6464
   1335 `§1 <https://www.rfc-editor.org/rfc/rfc6464#section-1>`__.
   1336 
   1337 **Audio Level (Mixer-to-Client)** Indicates audio levels of contributing
   1338 sources in a mixed audio stream. URI:
   1339 ``urn:ietf:params:rtp-hdrext:csrc-audio-level``. Learn more in RFC 6465
   1340 `§1 <https://www.rfc-editor.org/rfc/rfc6465#section-1>`__.
   1341 
   1342 **Video Orientation (CVO)** Indicates the rotation needed for video
   1343 frames (0, 90, 180, 270 degrees) to support orientation changes. URI:
   1344 ``urn:3gpp:video-orientation``. Learn more in 3GPP TS 26.114 and RFC
   1345 8285 `§1 <https://www.rfc-editor.org/rfc/rfc8285#section-1>`__.
   1346 
   1347 **Transport-Wide Sequence Number** Provides sequence numbers for
   1348 transport-wide congestion control feedback. URI:
   1349 ``http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions``.
   1350 Learn more in draft-holmer-rmcat-transport-wide-cc-extensions
   1351 `§2 <https://datatracker.ietf.org/doc/html/draft-holmer-rmcat-transport-wide-cc-extensions#section-2>`__.
   1352 
   1353 **MID Header Extension** Carries the media identification tag in RTP
   1354 packets for bundle multiplexing. URI:
   1355 ``urn:ietf:params:rtp-hdrext:sdes:mid``. Learn more in RFC 9143
   1356 `§1 <https://www.rfc-editor.org/rfc/rfc9143#section-1>`__.
   1357 
   1358 **RID Header Extension** Identifies RTP streams in simulcast scenarios.
   1359 URI: ``urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id``. Learn more in
   1360 RFC 8852 `§1 <https://www.rfc-editor.org/rfc/rfc8852#section-1>`__.
   1361 
   1362 **Absolute Capture Time** Timestamps packets with NTP time when media
   1363 was captured, enabling audio-video synchronization across hops. URI:
   1364 ``http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time``. Learn
   1365 more in draft-ietf-avtcore-abs-capture-time
   1366 `§1 <https://www.ietf.org/archive/id/draft-ietf-avtcore-abs-capture-time-00.html#section-1>`__.
   1367 
   1368 **Transmission Time Offset** Communicates the offset between RTP
   1369 timestamp and actual transmission time, useful for handling
   1370 retransmissions and buffering. URI:
   1371 ``urn:ietf:params:rtp-hdrext:toffset``. Learn more in RFC 5450
   1372 `§1 <https://www.rfc-editor.org/rfc/rfc5450#section-1>`__.
   1373 
   1374 **Absolute Send Time** Timestamps packets with departure time from the
   1375 sender, providing precise timing for bandwidth estimation. URI:
   1376 ``http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time``. Learn
   1377 more in the `abs-send-time
   1378 specification <https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/abs-send-time/>`__.
   1379 
   1380 **Video Content Type** Indicates whether video is screenshare or camera
   1381 content, enabling optimized rendering. URI:
   1382 ``http://www.webrtc.org/experiments/rtp-hdrext/video-content-type``.
   1383 Learn more in the `video-content-type
   1384 specification <https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/video-content-type/>`__.
   1385 
   1386 **Video Timing** Provides per-frame timing information including encode
   1387 start/finish, packetization, and pacer timestamps for performance
   1388 analysis. URI:
   1389 ``http://www.webrtc.org/experiments/rtp-hdrext/video-timing``. Learn
   1390 more in the `video-timing
   1391 specification <https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/video-timing/>`__.
   1392 
   1393 **Playout Delay** Allows sender to specify minimum and maximum playout
   1394 delay ranges, enabling latency control for different use cases (gaming,
   1395 streaming, conferencing). URI:
   1396 ``http://www.webrtc.org/experiments/rtp-hdrext/playout-delay``. Learn
   1397 more in the `playout-delay
   1398 specification <https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay/>`__.
   1399 
   1400 **Color Space** Communicates color space information and HDR metadata
   1401 for proper video rendering. URI:
   1402 ``http://www.webrtc.org/experiments/rtp-hdrext/color-space``. Learn more
   1403 in the `color-space
   1404 specification <https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/color-space/>`__.
   1405 
   1406 **Video Frame Tracking ID** Propagates VideoFrame ID field through RTP
   1407 packets for frame tracking. URI:
   1408 ``http://www.webrtc.org/experiments/rtp-hdrext/video-frame-tracking-id``.
   1409 This is only for quality testing purposes and should not be used in
   1410 production. Learn more in the `video-frame-tracking-id
   1411 specification <https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/video-frame-tracking-id/>`__.
   1412 
   1413 **Dependency Descriptor** Conveys information about video frames and
   1414 their dependencies in a codec-agnostic way, enabling selective
   1415 forwarding without decoding. Designed for AV1 but useful for other
   1416 codecs. URI:
   1417 ``https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension``.
   1418 Learn more in the `AV1 RTP
   1419 specification <https://aomediacodec.github.io/av1-rtp-spec/>`__.
   1420 
   1421 **SDES Items in RTP Headers** Allows rapid delivery of RTCP Source
   1422 Description items (like CNAME) via RTP header extensions. Learn more in
   1423 RFC 7941 `§1 <https://www.rfc-editor.org/rfc/rfc7941#section-1>`__.
   1424 
   1425 Simulcast and Encoding Terms
   1426 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1427 
   1428 **Simulcast** Simultaneously sending multiple encoded versions of the
   1429 same video source at different qualities. Codecs may have optimizations
   1430 that improve performance when encoding the same frame at different
   1431 resolutions.
   1432 
   1433 **SVC (Scalable Video Coding)** A video coding technique that encodes a
   1434 single bitstream that can be decoded at different resolutions, frame rates,
   1435 or quality levels to adapt to varying network conditions and receiver
   1436 capabilities. Unlike simulcast which sends multiple independent streams, WebRTC
   1437 SVC produces one encoded stream on a single SSRC. Scalability modes use **L**
   1438 for spatial layers (resolution scalability) and **T** for temporal layers
   1439 (frame rate scalability), such as L1T2 or L3T3. SVC is particularly useful
   1440 for Selective Forwarding Units (SFUs) which can selectively forward layers
   1441 to adapt to varying network conditions without re-encoding. Learn more about
   1442 `scalability modes
   1443 <https://developer.mozilla.org/en-US/docs/Web/API/RTCOutboundRtpStreamStats/scalabilityMode>`__
   1444 on MDN and in the W3C `Scalable Video Coding (SVC) Extension
   1445 <https://www.w3.org/TR/webrtc-svc/>`__ specification.
   1446 
   1447 **Encoding** A single encoded representation of media, identified by an
   1448 SSRC or RID.
   1449 
   1450 **Send Track / Recv Track** Internal representation of media direction -
   1451 tracks for sending media and tracks for receiving media.
   1452 
   1453 **Transceiver** A pairing of a sender and receiver that share a common
   1454 mid value, managing bidirectional media.
   1455 
   1456 **Negotiated Details** The final agreed-upon parameters for a track
   1457 after offer/answer negotiation completes.
   1458 
   1459 SDP Attributes and Parameters
   1460 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1461 
   1462 **M-line (Media Description Line)** An SDP line beginning with ``m=``
   1463 that defines a media stream, specifying the media type (audio, video,
   1464 etc.), port, transport protocol, and codec format. The interpretation of
   1465 the format is dependent on the selected protocol. Each m-line starts a
   1466 new media section that continues until the next m-line or end of the
   1467 SDP. Learn more about
   1468 `SDP <https://developer.mozilla.org/en-US/docs/Glossary/SDP>`__ on MDN
   1469 and RFC 8866
   1470 `§5.14 <https://www.rfc-editor.org/rfc/rfc8866#section-5.14>`__.
   1471 
   1472 **Direction Attribute** SDP attribute indicating media stream direction
   1473 (``sendrecv``, ``sendonly``, ``recvonly``, ``inactive``).
   1474 
   1475 **Setup Role** DTLS role in the connection (``active``, ``passive``,
   1476 ``actpass``) determining who initiates the handshake.
   1477 
   1478 **TIAS (Transport Independent Application Specific Maximum)** Bandwidth
   1479 constraint indicating maximum bitrate in bits per second. Learn more
   1480 about
   1481 `maxBitrate <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#maxbitrate>`__
   1482 on MDN and RFC 3890
   1483 `§6.2.2 <https://datatracker.ietf.org/doc/html/rfc3890#section-6.2.2>`__.
   1484 
   1485 H.264 Format Parameters
   1486 ~~~~~~~~~~~~~~~~~~~~~~~
   1487 
   1488 **H.264 Profile Level ID** H.264-specific parameter indicating the codec
   1489 profile (baseline, main, high) and level (capability). Signaled in SDP
   1490 via the ``profile-level-id`` FMTP parameter. Learn more about `H.264
   1491 profile-level-id <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#profile-level-id>`__
   1492 on MDN and RFC 6184
   1493 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1494 
   1495 **H.264 Max-FS (Maximum Frame Size)** Video codec parameter limiting the
   1496 maximum number of macroblocks in a frame. Signaled in SDP via the
   1497 ``max-fs`` FMTP parameter for H.264. Learn more about
   1498 `max-fs <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#max-fs>`__
   1499 on MDN and RFC 6184
   1500 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1501 
   1502 **H.264 Max-FR (Maximum Frame Rate)** Video codec parameter limiting the
   1503 maximum frame rate in frames per second. Signaled in SDP via the
   1504 ``max-fr`` FMTP parameter for H.264. Learn more about
   1505 `maxFramerate <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#maxframerate>`__
   1506 on MDN and RFC 6184
   1507 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1508 
   1509 **H.264 Max-BR (Maximum Bitrate)** Video codec parameter limiting the
   1510 maximum bitrate. Signaled in SDP via the ``max-br`` FMTP parameter for
   1511 H.264. Learn more about
   1512 `maxBitrate <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#maxbitrate>`__
   1513 on MDN and RFC 6184
   1514 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1515 
   1516 **H.264 Max-MBPS (Maximum Macroblocks Per Second)** H.264 parameter
   1517 limiting the processing rate. Signaled in SDP via the ``max-mbps`` FMTP
   1518 parameter. Learn more about
   1519 `max-mbps <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#max-mbps>`__
   1520 on MDN and RFC 6184
   1521 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1522 
   1523 **H.264 Sprop-parameter-sets** H.264 parameter containing SPS/PPS data
   1524 for decoder initialization. Signaled in SDP via the
   1525 ``sprop-parameter-sets`` FMTP parameter. Learn more in RFC 6184
   1526 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1527 
   1528 **H.264 Packetization Mode** H.264 parameter specifying the
   1529 packetization method for RTP packets. Mode 0 uses single NAL unit
   1530 packets, while Mode 1 allows for more efficient fragmentation and
   1531 aggregation of NAL units. Signaled in SDP via the ``packetization-mode``
   1532 FMTP parameter. Learn more in RFC 6184
   1533 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1534 
   1535 VP8 Format Parameters
   1536 ~~~~~~~~~~~~~~~~~~~~~
   1537 
   1538 **VP8 Max-FS (Maximum Frame Size)** VP8 parameter limiting the maximum
   1539 frame size in units of macroblocks that the decoder can decode. The
   1540 decoder can handle frame widths and heights up to int(sqrt(max-fs \* 8))
   1541 macroblocks. For example, max-fs=1200 supports up to 640x480 resolution
   1542 (97 macroblocks width/height, or 1552 pixels). Signaled in SDP via the
   1543 ``max-fs`` FMTP parameter. Learn more in RFC 7741
   1544 `§6.1 <https://www.rfc-editor.org/rfc/rfc7741#section-6.1>`__.
   1545 
   1546 **VP8 Max-FR (Maximum Frame Rate)** VP8 parameter limiting the maximum
   1547 frame rate in frames per second that the decoder can decode. Signaled in
   1548 SDP via the ``max-fr`` FMTP parameter. Learn more in RFC 7741
   1549 `§6.1 <https://www.rfc-editor.org/rfc/rfc7741#section-6.1>`__.
   1550 
   1551 VP9 Format Parameters
   1552 ~~~~~~~~~~~~~~~~~~~~~
   1553 
   1554 **VP9 Profile-ID** VP9 parameter indicating the codec profile (0-3).
   1555 Profile 0 supports 8-bit 4:2:0 only, Profile 1 adds 8-bit 4:2:2/4:4:4,
   1556 Profile 2 adds 10/12-bit 4:2:0, and Profile 3 adds 10/12-bit
   1557 4:2:2/4:4:4. When not present, a value of 0 is inferred. Signaled in SDP
   1558 via the ``profile-id`` FMTP parameter. Learn more in RFC 9628
   1559 `§6 <https://www.rfc-editor.org/rfc/rfc9628#section-6>`__.
   1560 
   1561 **VP9 Max-FS (Maximum Frame Size)** VP9 parameter limiting the maximum
   1562 frame size in units of macroblocks that the decoder can decode. Signaled
   1563 in SDP via the ``max-fs`` FMTP parameter. Learn more in RFC 9628
   1564 `§6 <https://www.rfc-editor.org/rfc/rfc9628#section-6>`__.
   1565 
   1566 **VP9 Max-FR (Maximum Frame Rate)** VP9 parameter limiting the maximum
   1567 frame rate in frames per second that the decoder can decode. Signaled in
   1568 SDP via the ``max-fr`` FMTP parameter. Learn more in RFC 9628
   1569 `§6 <https://www.rfc-editor.org/rfc/rfc9628#section-6>`__.
   1570 
   1571 AV1 Format Parameters
   1572 ~~~~~~~~~~~~~~~~~~~~~
   1573 
   1574 **AV1 Profile** AV1 parameter indicating the codec profile (Main, High,
   1575 or Professional). The profile determines the supported bit depths and
   1576 chroma subsampling formats. Signaled in SDP via the ``profile``
   1577 parameter. Learn more in the `AV1 RTP
   1578 specification <https://aomediacodec.github.io/av1-rtp-spec/#sdp-parameters>`__.
   1579 
   1580 **AV1 Level-IDX** AV1 parameter indicating the level, which defines the
   1581 decoder’s maximum processing capabilities including resolution, frame
   1582 rate, and bitrate. Signaled in SDP via the ``level-idx`` parameter.
   1583 Learn more in the `AV1 RTP
   1584 specification <https://aomediacodec.github.io/av1-rtp-spec/#sdp-parameters>`__.
   1585 
   1586 **AV1 Tier** AV1 parameter indicating the tier (Main or High), which
   1587 determines the maximum bitrate for a given level. High tier allows
   1588 roughly 2x the bitrate of Main tier. Signaled in SDP via the ``tier``
   1589 parameter. Learn more in the `AV1 RTP
   1590 specification <https://aomediacodec.github.io/av1-rtp-spec/#sdp-parameters>`__.
   1591 
   1592 H.265/HEVC Format Parameters
   1593 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1594 
   1595 **H.265 Profile-ID** H.265 parameter indicating the codec profile along
   1596 with profile-space. Profiles include Main, Main 10, Main Still Picture,
   1597 and others that determine supported bit depths and features. Signaled in
   1598 SDP via the ``profile-id`` FMTP parameter. Learn more in RFC 7798
   1599 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1600 
   1601 **H.265 Level-ID** H.265 parameter indicating the level, which defines
   1602 the decoder’s maximum processing capabilities including resolution,
   1603 frame rate, and bitrate. Signaled in SDP via the ``level-id`` FMTP
   1604 parameter. Learn more in RFC 7798
   1605 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1606 
   1607 **H.265 Tier-Flag** H.265 parameter indicating the tier (Main=0 or
   1608 High=1), which determines the maximum bitrate for a given level. High
   1609 tier supports higher bitrates than Main tier at the same level. Signaled
   1610 in SDP via the ``tier-flag`` FMTP parameter. Learn more in RFC 7798
   1611 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1612 
   1613 **H.265 Max-LSR (Maximum Luma Sample Rate)** H.265 parameter indicating
   1614 the maximum processing rate in units of luma samples per second,
   1615 allowing receivers to signal capabilities beyond the base level
   1616 requirements. Signaled in SDP via the ``max-lsr`` FMTP parameter. Learn
   1617 more in RFC 7798
   1618 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1619 
   1620 **H.265 Max-FPS (Maximum Frame Rate)** H.265 parameter indicating the
   1621 maximum picture rate in units of pictures per 100 seconds, used to
   1622 signal a constraint that lowers the maximum picture rate. Signaled in
   1623 SDP via the ``max-fps`` FMTP parameter. Learn more in RFC 7798
   1624 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1625 
   1626 **H.265 Max-BR (Maximum Bitrate)** H.265 parameter indicating the
   1627 maximum bitrate capability of the receiver, extending beyond the base
   1628 level requirements. Signaled in SDP via the ``max-br`` FMTP parameter.
   1629 Learn more in RFC 7798
   1630 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1631 
   1632 **H.265 Max-CPB (Maximum Coded Picture Buffer)** H.265 parameter
   1633 indicating the maximum coded picture buffer size capability, allowing
   1634 receivers to signal support for larger buffers than required by the base
   1635 level. Signaled in SDP via the ``max-cpb`` FMTP parameter. Learn more in
   1636 RFC 7798 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1637 
   1638 **H.265 Sprop-VPS/SPS/PPS** H.265 parameters containing VPS (Video
   1639 Parameter Set), SPS (Sequence Parameter Set), and PPS (Picture Parameter
   1640 Set) data for out-of-band decoder initialization. Signaled in SDP via
   1641 the ``sprop-vps``, ``sprop-sps``, and ``sprop-pps`` FMTP parameters.
   1642 Learn more in RFC 7798
   1643 `§7.1 <https://www.rfc-editor.org/rfc/rfc7798#section-7.1>`__.
   1644 
   1645 RTCP Feedback Types
   1646 ~~~~~~~~~~~~~~~~~~~
   1647 
   1648 **RTCP Feedback (rtcp-fb)** Mechanisms for providing rapid feedback
   1649 about media quality and requests.
   1650 
   1651 **NACK (Negative Acknowledgment)** RTCP feedback requesting
   1652 retransmission of lost packets.
   1653 
   1654 **PLI (Picture Loss Indication)** RTCP feedback requesting a full
   1655 intra-frame when video decoding fails. Learn more about PLI in RFC 4585
   1656 `§6.3.1 <https://www.rfc-editor.org/rfc/rfc4585.html#section-6.3.1>`__.
   1657 
   1658 **FIR (Full Intra Request)** RTCP feedback requesting a full intra-frame
   1659 for decoder refresh. Learn more about FIR in RFC 2032
   1660 `§5.2.1 <https://www.rfc-editor.org/rfc/rfc2032#section-5.2.1>`__.
   1661 
   1662 **TMMBR (“timber”, Temporary Maximum Media Stream Bitrate Request)**
   1663 RTCP feedback for requesting bitrate reduction. Learn more about TMMBR
   1664 in RFC 5104
   1665 `§3.5.4 <https://datatracker.ietf.org/doc/html/rfc5104#section-3.5.4>`__.
   1666 
   1667 **REMB (Receiver Estimated Maximum Bitrate)** RTCP feedback
   1668 communicating receiver’s bandwidth estimate to the sender. Learn more
   1669 about REMB in draft-alvestrand-rmcat-remb
   1670 `§2 <https://datatracker.ietf.org/doc/html/draft-alvestrand-rmcat-remb#section-2>`__.
   1671 
   1672 **Transport-CC (Transport-wide Congestion Control)** Mechanism for
   1673 gathering packet arrival times to estimate available bandwidth. Learn
   1674 more about transport-cc in
   1675 draft-holmer-rmcat-transport-wide-cc-extensions
   1676 `§2 <https://datatracker.ietf.org/doc/html/draft-holmer-rmcat-transport-wide-cc-extensions#section-2>`__.
   1677 
   1678 **FlexFEC** Flexible forward error correction mechanism for RTP streams
   1679 that can protect against packet loss by sending redundant recovery
   1680 packets. Uses a separate RTP stream for FEC packets, allowing flexible
   1681 configuration of protection levels. Learn more about FlexFEC in RFC 8627
   1682 `§1 <https://datatracker.ietf.org/doc/html/rfc8627#section-1>`__.
   1683 
   1684 Audio-Specific Terms
   1685 ~~~~~~~~~~~~~~~~~~~~
   1686 
   1687 **DTX (Discontinuous Transmission)** Not transmitting audio packets
   1688 during silence to save bandwidth. Signaled in SDP via the ``usedtx``
   1689 FMTP parameter for Opus. Learn more about DTX in `supported audio
   1690 codecs <https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/WebRTC_codecs#supported_audio_codecs>`__
   1691 on MDN and RFC 7587
   1692 `§6.1 <https://www.rfc-editor.org/rfc/rfc7587#section-6.1>`__.
   1693 
   1694 **In-band FEC** Opus-specific forward error correction included within
   1695 the audio stream. Signaled in SDP via the ``useinbandfec`` FMTP
   1696 parameter. Learn more in RFC 7587
   1697 `§6.1 <https://www.rfc-editor.org/rfc/rfc7587#section-6.1>`__.
   1698 
   1699 **Stereo** Two-channel audio encoding. Stereo can either be
   1700 independently encoded or, in some codecs like Opus, joint encoded.
   1701 
   1702 **Ptime (Packet Time)** The duration of media represented in a single
   1703 RTP packet, in milliseconds. Learn more about ptime in RFC 8866
   1704 `§6.4 <https://datatracker.ietf.org/doc/html/rfc8866#section-6.4>`__.
   1705 
   1706 **Maxptime (Maximum Packet Time)** The maximum acceptable ptime value.
   1707 Learn more about maxptime in RFC 8866
   1708 `§6.4 <https://www.rfc-editor.org/rfc/rfc8866#section-6.4>`__.
   1709 
   1710 **CBR (Constant Bitrate)** Encoding mode where bitrate remains constant
   1711 regardless of content complexity. For Opus, signaled in SDP via the
   1712 ``cbr`` FMTP parameter. Learn more in RFC 7587
   1713 `§6.1 <https://www.rfc-editor.org/rfc/rfc7587#section-6.1>`__.
   1714 
   1715 **VBR (Variable Bitrate)** Encoding mode where bitrate varies based on
   1716 content complexity, allowing more efficient compression. This is the
   1717 default mode for many codecs like Opus.
   1718 
   1719 **ABR (Adaptive Bitrate)** Encoding mode that dynamically adjusts
   1720 bitrate in real-time based on network conditions and receiver feedback.
   1721 In WebRTC, ABR uses bandwidth estimation algorithms (like Transport-CC)
   1722 to continuously monitor connection quality and adapt the encoding
   1723 bitrate to maintain optimal quality while preventing congestion. This
   1724 differs from VBR which adapts to content complexity but not network
   1725 conditions. Learn more about `bandwidth
   1726 estimation <https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidatePairStats/availableOutgoingBitrate>`__
   1727 on MDN.
   1728 
   1729 Data Channel Terms
   1730 ~~~~~~~~~~~~~~~~~~
   1731 
   1732 **SCTP (Stream Control Transmission Protocol)** Protocol used for WebRTC
   1733 data channels, providing reliable or unreliable delivery. Learn more
   1734 about
   1735 `RTCSctpTransport <https://developer.mozilla.org/en-US/docs/Web/API/RTCSctpTransport>`__
   1736 on MDN and RFC 9260
   1737 `§1 <https://datatracker.ietf.org/doc/html/rfc9260#section-1>`__.
   1738 
   1739 **Data Channel** A bidirectional data transport for arbitrary
   1740 application data over WebRTC. Learn more about
   1741 `RTCDataChannel <https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel>`__
   1742 on MDN and RFC 8831
   1743 `§6.4 <https://datatracker.ietf.org/doc/html/rfc8831#name-data-channel-definition>`__.
   1744 
   1745 **SCTP Port** The port number used for SCTP associations in data
   1746 channels.
   1747 
   1748 **Max Message Size** The maximum size of a single message that can be
   1749 sent over a data channel.
   1750 
   1751 Session State and Lifecycle
   1752 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1753 
   1754 **Associated** A transceiver that has been assigned a mid value during
   1755 negotiation.
   1756 
   1757 **Negotiated** A transceiver that has completed offer/answer exchange
   1758 and has agreed parameters.
   1759 
   1760 **Stopped** A transceiver that has been permanently stopped and cannot
   1761 be reused.
   1762 
   1763 **Receptive** A transceiver’s ability to receive media based on the
   1764 local description.
   1765 
   1766 **Add Track Magic** Special negotiation behavior where transceivers
   1767 created via ``addTrack()`` can be reused during negotiation, unlike
   1768 those created with ``addTransceiver()``. When applying a remote offer,
   1769 ``addTrack()``-created transceivers may be “stolen” to match incoming
   1770 m-lines, while ``addTransceiver()``-created transceivers are never
   1771 reused. Learn more about
   1772 `addTrack <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTrack>`__
   1773 and
   1774 `addTransceiver <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTransceiver>`__
   1775 on MDN.
   1776 
   1777 Advanced Terms
   1778 ~~~~~~~~~~~~~~
   1779 
   1780 **Subprofile** H.264 profiles like Constrained Baseline, Baseline, Main,
   1781 High, etc. Signaled in SDP via the ``profile-level-id`` FMTP parameter.
   1782 Learn more in RFC 6184
   1783 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1784 
   1785 **Level Asymmetry Allowed** H.264 parameter allowing different encoding
   1786 levels in each direction. Signaled in SDP via the
   1787 ``level-asymmetry-allowed`` FMTP parameter. Learn more in RFC 6184
   1788 `§8.1 <https://www.rfc-editor.org/rfc/rfc6184#section-8.1>`__.
   1789 
   1790 **Unique Receive Payload Types** Payload types that can be uniquely
   1791 identified for SSRC-to-PT matching.
   1792 
   1793 **Preferred Codecs** User-specified codec ordering that overrides
   1794 defaults. See Codec Preferences.
   1795 
   1796 **Codec Preferences** Settings controlling which codecs are enabled and
   1797 their configurations, specified as an array of ``RTCRtpCodecCapability``
   1798 objects in order of decreasing preference. Set via
   1799 ``setCodecPreferences()`` on an ``RTCRtpTransceiver`` to control which
   1800 codecs are used during negotiation. Codecs not included in the
   1801 preferences are excluded from negotiation. An empty list resets to user
   1802 agent defaults. Learn more about
   1803 `setCodecPreferences <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver/setCodecPreferences>`__
   1804 on MDN.
   1805 
   1806 **RTCRtpScriptTransform** An interface that enables custom processing of
   1807 encoded audio and video frames in WebRTC by inserting transform streams into
   1808 sender and receiver pipelines. The transform runs in a Worker thread and
   1809 receives encoded frames through a TransformStream, allowing real-time frame
   1810 manipulation, encryption, analytics, or bandwidth optimization. Developers
   1811 assign transforms to ``RTCRtpSender.transform`` for outgoing frames or
   1812 ``RTCRtpReceiver.transform`` for incoming frames. The worker receives an
   1813 ``rtctransform`` event with a ``transformer`` object containing readable and
   1814 writable streams for processing. Learn more about
   1815 `RTCRtpScriptTransform <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransform>`__
   1816 and `Using WebRTC Encoded Transforms
   1817 <https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Using_Encoded_Transforms>`__
   1818 on MDN.