ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.79k stars 5.28k forks source link

RTC: Supports direct forwarding, does not change SSRC and Timestamp, making problem troubleshooting easier. #3850

Open winlinvip opened 8 months ago

winlinvip commented 8 months ago

Describe the bug When SRS forwards RTC packets, it modifies the SSRC and Timestamp, which is inconvenient for end-to-end troubleshooting.

Version 6.0.95

To Reproduce Steps to reproduce the behavior:

  1. Start packet capture with Wireshark.
  2. Use WHIP for streaming.
  3. Use WHEP for playback.
  4. Notice that the SSRC and Timestamp for streaming and playback are different.

Expected behavior Add a new configuration that can support not changing the SSRC and Timestamp, which is helpful for troubleshooting in certain scenarios.

Screenshots For example, when adding a weak network in tc, it can help identify which packets are being dropped or delay:

image image

Additional context Previously, SRS recalculated Timestamp to support scenarios such as starting a stream, stopping a stream, and restarting a stream, so that continuous playback could be achieved. Additionally, SRS allows for playback before streaming, which requires the generation of SSRC first.

TRANS_BY_GPT4

winlinvip commented 3 months ago

Direct forwarding with the same SSRC can be beneficial for debugging purposes, while indirect forwarding that rewrites the SSRC is helpful when needing to conceal the source SSRC.

winlinvip commented 3 months ago

This modification was made to ensure the continuity of timestamps, particularly when restreaming. Inconsistent timestamps can cause issues such as stuttering on the playback client.

TRANS_BY_GPT4