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.74k stars 5.28k forks source link

API: Query WebRTC push stream anomaly - occurs sporadically. #3960

Open ziyue7575 opened 4 months ago

ziyue7575 commented 4 months ago

Description

Describe the bug The SRS has been configured with the capability to convert WebRTC streams to RTMP. After initiating a WebRTC stream, the stream can be accessed through the API. However, within the client, there is no identifier for the WebRTC stream; there is only an identifier for the RTMP playback. This results in an inability to terminate the WebRTC stream using the ID found in the 'cid' within the stream. The only solutions appear to be restarting the SRS or having the streaming source disconnect and reconnect.

Version 4.0.215

To Reproduce Occasionally, there is an issue with a standard WebRTC stream.

Expected behavior The expectation is to successfully retrieve the client for the WebRTC stream using an API, and to be able to normally disconnect the stream when invoking the API for disconnection.

Additional context

The logs are too extensive and have been included in an attachment.

WebRTC Streaming Exception - Intermittent Log Issue Document WebRtc推流异常-偶现日志.md

TRANS_BY_GPT4

winlinvip commented 3 months ago

I believe this bug is caused by simultaneous play and publish actions. Thus, the first crucial step is to reproduce this issue. Given its randomly nature, you might attempt to start publishing and playing simultaneously to consistently reproduce the problem. If we can find the exact conditions that trigger this issue, fixing it would become straightforward. Conversely, if we're unable to reproduce the issue, we're left to guess what happened, making it difficult to resolve.