Live stream switching method and apparatus, electronic equipment, storage medium, and computer program
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-16
Smart Images

Figure 2026098084000001_ABST
Abstract
Claims
1. A step of receiving a stream switching request sent from a client, wherein the stream switching request includes a target resolution, The process involves pulling the original live stream and the target live stream corresponding to the target resolution from their respective sources, and sending the original live stream to the client. The steps include performing timestamp alignment between the original live stream and the target live stream, If it is determined that the alignment was successful, the transmission of the original live stream is stopped and the target live stream is sent to the client. Live stream switching methods, including those mentioned above.
2. Before performing the timestamp alignment between the original livestream and the target livestream, The live stream switching method according to claim 1, further comprising the step of pulling the original live stream and the target live stream from their respective sources until a pre-set time threshold is exceeded and / or until the ratio of the interval between playback timestamps and the interval between reception timestamps of two consecutive frames in the target live stream falls below a pre-set ratio threshold.
3. The live stream switching method according to claim 1, further comprising the step of determining that alignment has failed and stopping the pull process of the target live stream, depending on whether the absolute value of the difference between the timestamps of the latest video frame of the original live stream and the latest video frame of the target live stream is greater than or equal to a first pre-set time difference threshold.
4. The step of performing timestamp alignment between the original live stream and the target live stream is: If the absolute difference between the timestamps of the latest video frame of the original live stream and the latest video frame of the target live stream is less than or equal to a second pre-set time difference threshold, and the timestamp of the latest keyframe of the target live stream and the timestamp of the latest keyframe of the original live stream are the same, The process includes the step of continuing to transmit the original live stream until the target of the pull process becomes the next keyframe of the target live stream, and the transmission of the video frames in the current group of video frames of the original live stream is completed and it is determined that the alignment was successful. The step of sending the target live stream to the client is: The live stream switching method according to claim 3, further comprising the step of starting transmission of the target live stream to the client from the next keyframe of the target live stream.
5. The step of performing timestamp alignment between the original live stream and the target live stream is: Depending on whether the absolute difference between the timestamps of the latest video frame of the original live stream and the latest video frame of the target live stream is less than a first pre-set time difference threshold and greater than a second pre-set time difference threshold, and the timestamp of the latest video frame of the target live stream is greater than the timestamp of the latest video frame of the original live stream, and the timestamp of the latest keyframe of the target live stream is close to the timestamp of the latest keyframe of the original live stream, The process includes the step of continuing to transmit the original live stream until the target of the pull process becomes the next keyframe of the target live stream, and the transmission of the video frames in the current group of video frames of the original live stream is completed and it is determined that the alignment was successful. The step of sending the target live stream to the client is: The live stream switching method according to claim 4, further comprising the step of starting transmission of the target live stream to the client from the next keyframe of the target live stream.
6. The step of performing timestamp alignment between the original live stream and the target live stream is: If the absolute difference between the timestamps of the latest video frame of the original live stream and the latest video frame of the target live stream is less than a first pre-set time difference threshold and greater than a second pre-set time difference threshold, and the timestamp of the latest video frame of the target live stream is greater than the timestamp of the latest video frame of the original live stream, and the timestamp of the latest keyframe of the target live stream is not close to the timestamp of the latest keyframe of the original live stream, The process includes the step of continuing to transmit the original live stream until the target of the pull process becomes the next keyframe of the original live stream and it is determined that the alignment was successful. The step of sending the target live stream to the client is: The live stream switching method according to claim 5, further comprising the step of starting to transmit the target live stream to the client from the latest keyframe of the target live stream.
7. The step of performing timestamp alignment between the original live stream and the target live stream is: If the absolute difference between the timestamps of the latest video frame of the original live stream and the latest video frame of the target live stream is less than a first pre-set time difference threshold and greater than a second pre-set time difference threshold, and the timestamp of the latest video frame of the target live stream is less than or equal to the timestamp of the latest video frame of the original live stream, The transmission speed of the original live stream is reduced, and the original live stream is continued to be transmitted until the timestamp of the latest video frame of the target live stream is greater than the timestamp of the latest video frame of the original live stream, and the timestamp of the latest keyframe of the target live stream is the same as the timestamp of the latest keyframe of the original live stream. The process includes the step of continuing to transmit the original live stream until the target of the pull process becomes the next keyframe of the target live stream, and the transmission of the video frames in the current group of video frames of the original live stream is completed and it is determined that the alignment was successful. The step of sending the target live stream to the client is: The live stream switching method according to claim 6, further comprising the step of starting transmission of the target live stream to the client from the next keyframe of the target live stream.
8. A receiving module configured to receive a stream switching request sent from a client, wherein the stream switching request includes a target resolution, A pull processing module is configured to pull an original live stream and a target live stream corresponding to the target resolution from their respective sources, and to send the original live stream to the client. An alignment module configured to perform timestamp alignment of the original live stream and the target live stream, A transmission module is configured to stop transmitting the original live stream and transmit the target live stream to the client if it determines that the alignment was successful. A live stream switching device equipped with the following features.
9. An electronic device comprising at least one processor and a memory that is communicatively connected to the at least one processor, The memory stores a command that can be executed by the at least one processor, and when the command is executed by the at least one processor, the electronic device causes the at least one processor to execute the live stream switching method according to any one of claims 1 to 7.
10. A non-temporary computer-readable storage medium in which computer commands are stored, The computer command is a non-temporary computer-readable storage medium used to cause a computer to execute the livestream switching method described in any one of claims 1 to 7.
11. A computer program that, when executed by a processor, implements the live stream switching method described in any one of claims 1 to 7.