Closed skill7899 closed 3 months ago
The RTC audio and video utilize a separate clock and require waiting for the sender report to synchronize. If this is not done, the timestamps for audio and video when converting to RTMP will be out of sync. This is the primary reason for the slow first frame. What is your scenario that requires RTMP to start quickly?
TRANS_BY_GPT4
The RTC audio and video utilize a separate clock and require waiting for the sender report to synchronize. If this is not done, the timestamps for audio and video when converting to RTMP will be out of sync. This is the primary reason for the slow first frame. What is your scenario that requires RTMP to start quickly?
TRANS_BY_GPT4
H5 video anti fraud requires instant activation, otherwise the waiting time will be too long, which will greatly affect the user experience,H5 uses webrtc to connect to SRS, and the backend service pulls the RTMP stream from SRS. @xiaozhihong
Are there any other methods to speed up this conversion process to achieve second-level speed, such as disabling sound? @xiaozhihong
TRANS_BY_GPT4
I believe we cannot fix this issue because it stems from a fundamental design choice. Specifically, WebRTC is not designed to prioritize the immediate display of the first frame. In online meetings, the rendering time of the first frame is not a concern, unlike in live streaming, where it is crucial. Therefore, there is a distinct design philosophy between WebRTC and live streaming.
Describe the bug
The first frame of WebRTC to RTMP conversion is very slow
Version
5.0
To Reproduce Steps to reproduce the behavior:
srs.conf
1.Execute the Docker command to run a container interactively with a pseudo-TTY,
docker run --rm -it -p 1935:1935 -v /srs.conf:/usr/local/srs/conf/srs.conf -p 1985:1985 -p 8080:8080 \ --env CANDIDATE=$CANDIDATE -p 8000:8000/udp \ registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 ./objs/srs -c conf/srs.conf
2.Execute the command
ffplay rtmp://localhost/live/livestream -analyzeduration 1000000 -fflags nobuffer
Open the specified HTTP URL in a web browser to access the RTC publisher page and initiate an RTP push by clicking the appropriate button or link.
for 10 seconds, after which FFplay should begin displaying the video feed.
Review the output log for information.
Expected behavior
1s can see the image in ffplay for fist frame
Screenshots