Replies: 1 comment
-
QuestionRequirement scenario: Implement the pause and resume function of recording on the web interface. The recording stream is pushed to SRS through RTMP, and the web interface pulls the stream from SRS through WebRTC. AnswerCheck the configuration, there is a maximum waiting time for pushing the stream, by default, it will kick if there is no stream for 5 seconds, you can set it to a larger value. There is another solution, you can use FFmpeg to pull the stream and record it by yourself. In this way, users do not need to pause the stream, but keep pushing the stream. However, you can control when FFmpeg stops recording. A similar solution can also be used with HLS callback. The stream is always being pushed, and after generating the slice, it will callback to your system. You can decide whether to copy the slice based on your own needs. If paused, do not copy. There is another solution: you can use FFmpeg to pull the stream and record it yourself. This way, the user doesn't need to pause the stream push, but the stream is pushed continuously, and you can control when FFmpeg stops recording. A similar solution can also be achieved using HLS callback. The stream is always being pushed, and after generating the slice, it will callback to your system. You can decide whether to copy the slice based on your own needs. If paused, don't copy the slice. |
Beta Was this translation helpful? Give feedback.
-
Description
The client temporarily stops sending the stream to SRS. Due to the uncertainty of the pause time, if the time is too long, it may cause the SRS service to destroy the RTMP connection. Then, when requesting to push the stream to SRS again, an error occurs.
SRS Version: v5.0.155
SRS Log:
Replay
Please describe how to replay the bug?
Step 1: Request to play the recorded video.
Step 2: Use the pause function for the recording, and the client stops pushing the stream.
Step 3: If the pause time exceeds 1 minute, let the original client push the stream again.
Step 4: Pushing the stream results in an error (checking the SRS log, the RTMP stream is disconnected, and after exceeding the timeout, the SRS service actively destroys the connection).
Expect
Using RTMP to push the stream to SRS can achieve the pause function. There are many external requirements, and I hope the experts can adopt the implementation of this requirement.
(Suggestion: Can the timeout of the RTMP stream be dynamically set by controlling the stream ID when the stream is paused? It can also be triggered by a hook to reset the timeout.)
Beta Was this translation helpful? Give feedback.
All reactions