Video transmission control method, streaming media server and computer program product
By setting up two input paths in the video streaming system and using a video health checker to automatically switch between them, the problem of video stream interruption in traditional systems is solved, achieving improvements in stability and efficiency, supporting multiple video streams and providing a user-friendly interface.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional video streaming systems lack robust failover mechanisms, leading to streaming service interruptions in unstable network environments, and they also struggle to provide user-friendly path management and automatic switching capabilities.
By setting up two input paths and utilizing a video health checker to detect data packet error rates, the system automatically switches to the backup path, ensuring the stability and continuity of video transmission. It also provides a user-friendly interface and flexible system configuration options.
It reduces streaming media interruptions, improves the stability and efficiency of video transmission, supports simultaneous transmission of multiple video streams and independent configuration of failover parameters, and provides an intuitive user interface and an efficient automatic switching mechanism.
Smart Images

Figure CN121644534A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video transmission technology, and in particular to a video transmission control method, a streaming media server, and a program product. Background Technology
[0002] Traditional video streaming systems often lack robust failover mechanisms for UDP inputs, leading to streaming service interruptions when the primary path fails. Ensuring uninterrupted streaming playback in unstable network environments remains a challenge. Traditional methods struggle to provide automatic yet user-controlled dynamic switching capabilities, and many systems fail to offer intuitive path management user interfaces, forcing users to manually resolve complex network issues or face prolonged service outages. Summary of the Invention
[0003] To solve, or at least partially solve, the above-mentioned technical problems, this application provides a video transmission control method, a streaming media server, and a program product that can flexibly switch between the main input path and the backup input path, thereby reducing streaming media interruptions.
[0004] In a first aspect, this application provides a video transmission control method, the method comprising: The first video source transmitted via the main input path is received, and the first video source is divided into multiple first video data packets for transmission. A video health check is performed on the first video data packet to obtain the first data packet error rate within a first set time window. The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the first set time window to the total number of data packets. If the error rate of the first data packet is greater than the first preset error rate, then switch to the backup input path and input the backup video source through the backup input path.
[0005] Secondly, this application provides a streaming media server, which includes a signal switcher and a first video health checker; The signal switcher is used to receive a first video source transmitted through the main input path, and the first video source is divided into multiple first video data packets for transmission. The first video health checker is used to perform a video health check on the first video data packet to obtain the first data packet error rate within a first set time window. The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the first set time window to the total number of data packets. If the error rate of the first data packet is greater than the first preset error rate, the signal switcher is further used to switch to the backup input path and input the backup video source through the backup input path.
[0006] Thirdly, embodiments of this application also provide a computer program product, wherein the computer program in the computer program product enables the computer to perform the aforementioned video transmission control method when executed by a computer.
[0007] In this embodiment, a first video source transmitted via the main input path is received. The first video source is divided into multiple first video data packets for transmission. A video health check is performed on the first video data packets to obtain the error rate of the first data packets within a first set time window. The error rate of the first data packets represents the ratio of the number of unhealthy data packets transmitted within the first set time window to the total number of data packets. If the error rate of the first data packets is greater than a first preset error rate, the system switches to the backup input path and inputs a backup video source through the backup input path. By setting two input paths, the system can flexibly switch between the main input path and the backup input path, reducing streaming media interruptions. Attached Figure Description
[0008] To more clearly illustrate the embodiments of this application, the relevant drawings will be briefly described below. It is understood that the drawings described below are only for illustrating some embodiments of this application, and those skilled in the art can obtain many other technical features and connections not mentioned herein based on these drawings.
[0009] Figure 1 A schematic diagram of the structure of a streaming media server provided for an embodiment of this application; Figure 2 A flowchart illustrating a video transmission control method provided in an embodiment of this application; Figure 3 A flowchart illustrating another video transmission control method provided in this application embodiment; Figure 4 This is a schematic diagram of the structure of a streaming media server provided for an embodiment of this application. Detailed Implementation
[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0011] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0012] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0013] Traditional video streaming systems typically lack robust failover mechanisms for UDP (User Datagram Protocol) inputs. This results in streaming service interruptions when the main path fails. Ensuring continuous and uninterrupted streaming in environments with unstable network conditions remains a challenge.
[0014] Existing streaming solutions often rely on single-path configurations or manual intervention to handle path failures, which can lead to server downtime or require extensive manual monitoring. While some systems offer basic automatic path switching, they still fall short in terms of granular control and the intelligence of the switching mechanism. Beyond solutions requiring manual or automatic switching, some systems even transmit video streams simultaneously through two paths and switch at the output. This solution keeps the backup stream always ready and can be considered a high-quality service, but it also has clear drawbacks. This approach struggles to provide users with controllable dynamic switching capabilities while offering automatic switching. Many systems fail to provide an intuitive path management user interface, forcing users to manually resolve complex network issues or face prolonged service interruptions. Simple manual switching modes, in the worst case, require users to monitor continuously 24 / 7, or, at best, only provide some form of alert system to notify users to switch video sources according to instructions.
[0015] Therefore, this solution provides a video transmission control method that, by setting two input paths, can flexibly switch between the main input path and the backup input path, reduce streaming media interruptions, and acquire the optimal channel based on stability and availability, ensuring that the required channel is actively used.
[0016] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0017] Example 1 like Figure 1 As shown, Figure 1 The present application provides a schematic diagram of the structure of a streaming media server. The streaming media server 10 includes a signal switcher 100, a main video health checker 200, and a backup video health checker 300. The main video health checker 200 includes an error rate counter 210, and the backup video health checker 300 has the same function as the main video health checker 200.
[0018] The signal switcher 100 can receive a signal source switching command, which can be manually input by the user.
[0019] The signal switcher 100 switches between the main input path and the backup input path. This switching can be based on a signal source switching command manually input by the user, or it can be triggered by a specific event or condition. It can achieve a combination of automatic and manual switching to minimize the interruption of streaming media services.
[0020] On the one hand, it provides intuitive user interface options, enabling users to control path management and manually switch during video streaming; on the other hand, through automatic switching, it can efficiently handle real-time faults or performance degradation issues in the network path without user intervention.
[0021] The primary input path is used to transmit the first video source, and the secondary input path is used to transmit the backup video source. The backup video source and the primary video source can be the same video source or different video sources.
[0022] The main video health checker 200 can perform a video health check on the first video data packet to obtain the error rate of the first data packet within a first set time window. The error rate of the first data packet represents the ratio of the number of unhealthy data packets transmitted within the first set time window to the total number of data packets.
[0023] If the error rate of the first data packet is greater than the first preset error rate, the signal switcher 100 switches to the backup input path and inputs the backup video source through the backup input path.
[0024] By setting a first preset error rate, it can be ensured that the main input path has been detected and is stable, thereby ensuring that the path for video transmission has passed the health check.
[0025] The first preset error rate is adjustable, providing users with more flexible system configuration options. Specifically, users can adjust the first preset error rate according to the error tolerance, making the main video health checker 200 more flexible. The lower the first preset error rate, the more sensitive the system is to switching to the backup input path (Path B) when the main input path (Path A) encounters a network interruption. The higher the first preset error rate, the more tolerable the source data corruption is, and the less likely it is to easily trigger input path switching.
[0026] The first set time window refers to a pre-defined time window used to detect unhealthy data packets within that time window. The first data packet error rate is determined based on the number of unhealthy data packets transmitted within the first set time window. For example, the first set time window can be set between 5 and 30 seconds. The first preset error rate can be set between 3% and 10%.
[0027] By using the backup input path to input the backup video source, and by setting two input paths, you can flexibly switch between the main input path and the backup input path, reducing streaming media interruptions.
[0028] Optionally, in performing a video health check on the first video data packet to obtain the error rate of the first data packet within a first set time window, the main video health checker 200 is specifically used for: Determine whether the first video data packet meets any of the following conditions; if so, increment the error rate counter 210 by one: The sequential count bits of consecutive video data packets are out of order; The error flag of the first video data packet is set; The size of the video service data in the first video data packet differs from the set standard; The packet error rate is determined based on the count of the error rate counter and the total number of packets.
[0029] The main video health checker 200 can detect the health status of the first video data packet, thereby ensuring the stability of the video transmission path.
[0030] In practice, the counter status can be checked first. If the sequential count bits of the continuous video data packets are out of order, it indicates that the counter is abnormal, such as no data being counted. In this case, it is determined to be unhealthy, and the error rate counter 210 is incremented by one. If the counter is normal...
[0031] Further check the error flag bit of the first video data packet. If the error flag bit of the first video data packet is set, it is determined to be unhealthy, and the error rate counter 210 is incremented by one. If the error flag bit is normal, continue to check whether the size of the video service data in the first video data packet meets the standard. Specifically, it can be determined whether there is a difference between the size of the video service data in the first video data packet and the set standard. If so, it is determined to be unhealthy, and the error rate counter 210 is incremented by one.
[0032] The set standard refers to the pre-set standard memory size of the service data. The difference is determined by comparing the size of the video service data in the first video data packet with the set standard.
[0033] If the size of the video service data in the first video data packet is consistent with the set standard, it is considered normal. The error rate of the data packet is then determined based on the count of the error rate counter and the total number of data packets. If the error rate of the data packet is greater than the first preset error rate, the first video data packet transmitted through the main input path is deemed unhealthy, and the count of the error rate counter 210 is incremented by one. If the error rate of the data packet is not greater than the first preset error rate, the input is deemed healthy.
[0034] Optionally, the main video health checker 200 is also specifically used for: Determine the sum of the header length of the first video data packet and the first value of the data index; If the offset of the basic stream field of the group differs from the sum of the first values, it is determined that the size of the video service data in the first video data packet differs from the set standard.
[0035] Furthermore, during the operation of the backup input path, the main path recovery condition can be determined. If the main path recovery condition is met, the transmission of the first video source can be restored to the main input path.
[0036] Optionally, during the operation of the backup input path, the main video health checker 200 is also specifically used to detect whether the main input path has recovered to a healthy state after a preset recovery time interval. If the main input path recovers to a healthy state, the signal switcher 100 switches to the main input path and re-inputs the first video source through the main input path.
[0037] Specifically, after switching to the backup input path, the system can check in the background whether the main input path has returned to a healthy state. This process will not interfere with the normal transmission of backup video sources by the backup input path.
[0038] By configuring a corresponding video health checker for each video transmission path, it is possible to support the simultaneous transmission of multiple video streams, and each video stream can be configured with failover parameters independently, improving the scalability and flexibility of the system.
[0039] By processing only one input path (the primary input path) when the primary input path is healthy, and periodically checking the health status of the primary path during failover, computational resources for the critical path can be saved.
[0040] Compared to transmitting video streams and performing health checks simultaneously through both the primary and backup input paths, this solution reduces redundancy by avoiding transmitting backup video streams through the backup input path when the primary input path is functioning correctly. This maximizes reliability while reducing system workload and improving system efficiency.
[0041] Optionally, regarding the detection of whether the main input path has returned to a healthy state, the main video health checker 200 is specifically used for: Determine whether the main input path meets the following conditions; if so, determine that the main input path has recovered to a healthy state: A connection has been established with the main input path; The first video data packet of the first video source flows continuously, and the time interval between two adjacent first video data packets does not exceed the set interval duration; Whether the error rate of the first data packet within the second set time window is less than or equal to the second preset error rate; The first video source has transmitted multiple first video data packets, including keyframes and video headers.
[0042] Optionally, if the first video source input from the main input path cannot be detected, the signal switcher 100 is also used to switch to the backup input path and input a backup video source through the backup input path.
[0043] If the data from the first video source is completely missing, and there is no data packet transmission and error detection cannot be performed, then the input path can be switched to the backup input path, and the backup video source can be input through the backup input path.
[0044] If the first video data packet meets the health conditions, the streaming media server will transcode the first video data packet and output the transcoded first video data packet.
[0045] The streaming media server may also include a stream manager and a video processor. After the stream manager and video processor are started, the main input path is active, and the first video source is transmitted through the main input path Path A. The first video data packet transmitted through the main input path Path A is transcoded into the input to output a video stream. If the main video health checker 200 detects that the main input path Path A is unhealthy, it switches to the backup input path Path B as the transcoding input and outputs the video stream; it sets the recovery time of Path A to the current time + the set duration, sends a recovery command to the system, and after the recovery time is reached, it re-checks the health status of the main input path Path A; if the main input path Path A is still unhealthy, it waits for another set duration after the previous health status check ends, and then re-checks the health status of the main input path Path A again.
[0046] If the main input path Path A is detected to be healthy, the process can be switched to the main input path, the transcoding process can be restarted, the main input path Path A can be started as the input for transcoding, and the video stream can be output.
[0047] In this embodiment, the streaming media server receives a first video source transmitted via the main input path. The first video source is divided into multiple first video data packets for transmission. A video health check is performed on the first video data packets to obtain the error rate of the first data packets within a set time window. The error rate of the first data packets represents the ratio of the number of unhealthy data packets transmitted within the set time window to the total number of data packets. If the error rate of the first data packets is greater than a first preset error rate, the system switches to the backup input path and inputs a backup video source through the backup input path. By setting two input paths, the system can flexibly switch between the main input path and the backup input path, reducing streaming media interruptions.
[0048] Example 2 like Figure 2 As shown, one embodiment of this application proposes a video transmission control method. Figure 2 A flowchart illustrating a video transmission control method provided in this application embodiment, the method comprising: 101. Receive the first video source transmitted via the main input path. The first video source is divided into multiple first video data packets for transmission.
[0049] In this application, by dividing the first video source into multiple first video data packets for transmission, a video health check can be performed based on each first video data packet after transmission.
[0050] 102. Perform a video health check on the first video data packet to obtain the error rate of the first data packet within a set time window.
[0051] The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the set time window to the total number of data packets.
[0052] After each transmission of the first video data, a video monitoring check can be performed to determine whether the first video data is healthy. Unhealthy first video data is counted to obtain the number of unhealthy data packets. Then, the ratio between the number of unhealthy data packets and the total number of data packets transmitted is calculated to obtain the error rate of the first data packet.
[0053] 103. If the error rate of the first data packet is greater than the first preset error rate, then switch to the backup input path and input the backup video source through the backup input path.
[0054] By setting a first preset error rate, it can be ensured that the main input path has been detected and is stable, thereby ensuring that the path for video transmission has passed the health check.
[0055] The first preset error rate is adjustable, providing users with more flexible system configuration options. Specifically, users can adjust the first preset error rate according to the error tolerance, making the main video health checker 200 more flexible. The lower the first preset error rate, the more sensitive the system is to switching to the backup input path (Path B) when the main input path (Path A) encounters a network interruption. The higher the first preset error rate, the more tolerable the source data corruption is, and the less likely it is to easily trigger input path switching.
[0056] By using the backup input path to input the backup video source, and by setting two input paths, you can flexibly switch between the main input path and the backup input path, reducing streaming media interruptions.
[0057] In an embodiment of this application, the streaming media server receives a first video source transmitted via the main input path. The first video source is divided into multiple first video data packets for transmission. A video health check is performed on the first video data packets to obtain the first data packet error rate within a set time window. The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the set time window to the total number of data packets. If the first data packet error rate is greater than a first preset error rate, the system switches to the backup input path and inputs a backup video source through the backup input path. By setting two input paths, the system can flexibly switch between the main input path and the backup input path, reducing streaming media interruptions.
[0058] Optionally, performing a video health check on the first video data packet to obtain the first data packet error rate within a first set time window includes: Determine whether the first video data packet meets any of the following conditions; if so, increment the error rate counter by one: The sequential count bits of consecutive video data packets are out of order; The error flag of the first video data packet is set; The size of the video service data in the first video data packet differs from the set standard; The packet error rate is determined based on the count of the error rate counter and the total number of packets.
[0059] By performing video health checks, the health status of the first video data packet can be detected, thereby ensuring the stability of the video transmission path.
[0060] In practice, the counter status can be checked first. If the sequential count bits of the continuous video data packets are out of order, it indicates that the counter is abnormal, such as no data being counted. In this case, it is determined to be unhealthy, and the error rate counter 210 is incremented by one. If the counter is normal...
[0061] Further check the error flag bit of the first video data packet. If the error flag bit of the first video data packet is set, it is determined to be unhealthy, and the error rate counter 210 is incremented by one. If the error flag bit is normal, continue to check whether the size of the video service data in the first video data packet meets the standard. Specifically, it can be determined whether there is a difference between the size of the video service data in the first video data packet and the set standard. If so, it is determined to be unhealthy, and the error rate counter 210 is incremented by one.
[0062] If the size of the video service data in the first video data packet is consistent with the set standard, it is considered normal. The error rate of the data packet is then determined based on the count of the error rate counter and the total number of data packets. If the error rate of the data packet is greater than the first preset error rate, the first video data packet transmitted through the main input path is deemed unhealthy, and the count of the error rate counter 210 is incremented by one. If the error rate of the data packet is not greater than the first preset error rate, the input is deemed healthy.
[0063] Optionally, the method further includes: Determine the sum of the header length of the first video data packet and the first value of the data index; If the offset of the basic stream field of the group differs from the sum of the first values, it is determined that the size of the video service data in the first video data packet differs from the set standard.
[0064] Furthermore, during the operation of the backup input path, the main path recovery condition can be determined. If the main path recovery condition is met, the transmission of the first video source can be restored to the main input path.
[0065] Optionally, during the operation of the alternative input path, the method further includes: After a preset recovery time interval, check whether the main input path has returned to a healthy state; If the main input path recovers to a healthy state, switch to the main input path and re-input the first video source through the main input path.
[0066] Specifically, after switching to the backup input path, the system can check in the background whether the main input path has returned to a healthy state. This process will not interfere with the normal transmission of backup video sources by the backup input path.
[0067] By configuring a corresponding video health checker for each video transmission path, it is possible to support the simultaneous transmission of multiple video streams, and each video stream can be configured with failover parameters independently, improving the scalability and flexibility of the system.
[0068] By processing only one input path (the primary input path) when the primary input path is healthy, and periodically checking the health status of the primary path during failover, computational resources for the critical path can be saved.
[0069] Compared to transmitting video streams and performing health checks simultaneously through both the primary and backup input paths, this solution reduces redundancy by avoiding transmitting backup video streams through the backup input path when the primary input path is functioning correctly. This maximizes reliability while reducing system workload and improving system efficiency.
[0070] Optionally, detecting whether the main input path has returned to a healthy state includes: Determine whether the main input path meets the following conditions; if so, determine that the main input path has recovered to a healthy state: A connection has been established with the main input path; The first video data packet of the first video source flows continuously, and the time interval between two adjacent first video data packets does not exceed the set interval duration; Whether the error rate of the first data packet within the second set time window is less than or equal to the second preset error rate; The first video source has transmitted multiple first video data packets, including keyframes and video headers.
[0071] To maintain the health of the main input path, it is necessary to ensure that the connection of the main input path is normal, that is, to maintain the connection between the streaming media server and the link address of the first video source of the main input path.
[0072] Secondly, it is necessary to ensure that the video data packets of the main input path can be continuously transmitted, and that the transmission interval does not exceed the set interval duration.
[0073] A second preset time window can also be set, for example, 30 seconds, to ensure that the error rate of the first data packet within the second preset time window does not exceed the second preset error rate. The second preset error rate can be the same as or different from the first preset error rate, and users can set it flexibly.
[0074] To maintain the health of the main input path, it is necessary to ensure that the connection of the main input path is normal, that is, to maintain the connection between the streaming media server and the link address of the first video source of the main input path.
[0075] Secondly, it is necessary to ensure that the video data packets of the main input path can be continuously transmitted, and that the transmission interval does not exceed the set interval duration.
[0076] A second preset time window can also be set, for example, 30 seconds, to ensure that the error rate of the first data packet within the second preset time window does not exceed the second preset error rate. The second preset error rate can be the same as or different from the first preset error rate, and users can set it flexibly.
[0077] Optionally, the method further includes: If the first video source input from the main input path cannot be detected, switch to the backup input path and input the backup video source through the backup input path.
[0078] If the data from the first video source is completely missing, and there is no data packet transmission and error detection cannot be performed, then the input path can be switched to the backup input path, and the backup video source can be input through the backup input path.
[0079] Optionally, the method further includes: If the first video data packet meets the health conditions, the first video data packet is transcoded and the transcoded first video data packet is output.
[0080] In practice, after the stream manager and video processor are started, the main input path is active. The first video source is transmitted through the main input path Path A, and the first video data packet transmitted through the main input path Path A is transcoded into the input to output the video stream. If the main video health checker 200 detects that the main input path Path A is unhealthy, it switches to the backup input path Path B as the transcoding input and outputs the video stream; it sets the recovery time of Path A to the current time + the set duration, sends a recovery command to the system, and after the recovery time is reached, it re-checks the health status of the main input path Path A; if the main input path Path A is still unhealthy, it waits for another set duration after the previous health status check ends, and then re-checks the health status of the main input path Path A again.
[0081] If the main input path Path A is detected to be healthy, the process can be switched to the main input path, the transcoding process can be restarted, the main input path Path A can be started as the input for transcoding, and the video stream can be output.
[0082] Example 3 Consistent with the foregoing embodiments, such as Figure 3 As shown, one embodiment of this application proposes a video transmission control method. Figure 3 A flowchart illustrating the steps of a video transmission control method provided in this application, the method comprising: 201. Receive the first video source transmitted from the main input path. The first video source is divided into multiple first video data packets for transmission.
[0083] 202. Perform a video health check on the first video data packet to obtain the error rate of the first data packet within a set time window.
[0084] In specific implementation, it is determined whether the first video data packet meets any of the following conditions; if so, the error rate counter is incremented by one: The sequential count bits of consecutive video data packets are out of order; The error flag of the first video data packet is set; The size of the video service data in the first video data packet differs from the set standard; The packet error rate is determined based on the count of the error rate counter and the total number of packets.
[0085] The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the set time window to the total number of data packets.
[0086] 203. If the error rate of the first data packet is greater than the first preset error rate, then switch to the backup input path and input the backup video source through the backup input path.
[0087] 204. During the operation of the backup input path, after a preset recovery time interval, it is determined whether the main input path has recovered to a healthy state. If so, the system switches to the main input path and re-inputs the first video source through the main input path.
[0088] The detection of whether the main input path has returned to a healthy state includes: Determine whether the main input path meets the following conditions; if so, determine that the main input path has recovered to a healthy state: A connection has been established with the main input path; The first video data packet of the first video source flows continuously, and the time interval between two adjacent first video data packets does not exceed the set interval duration; Whether the error rate of the first data packet within the second set time window is less than or equal to the second preset error rate; The first video source has transmitted multiple first video data packets, including keyframes and video headers.
[0089] 205. If the first video source input from the main input path cannot be detected, switch to the backup input path and input the backup video source through the backup input path.
[0090] 206. If the first video data packet meets the health conditions, then the first video data packet is transcoded and the transcoded first video data packet is output.
[0091] By processing only one input path (the primary input path) when the primary input path is healthy, and periodically checking the health status of the primary path during failover, computational resources for the critical path can be saved.
[0092] Compared to transmitting video streams and performing health checks simultaneously through both the primary and backup input paths, this solution reduces redundancy by avoiding transmitting backup video streams through the backup input path when the primary input path is functioning correctly. This maximizes reliability while reducing system workload and improving system efficiency.
[0093] Example 4 like Figure 4 As shown, Figure 4 A streaming media server provided in this application includes a processor 410 and a memory 420; and one or more programs stored in the memory. The memory 420 can be high-speed RAM or non-volatile memory, such as disk storage. The memory 420 is used to store a set of program code, and the processor 410 is used to call the program code stored in the memory 420 to perform the following operations: The first video source transmitted via the main input path is received, and the first video source is divided into multiple first video data packets for transmission. A video health check is performed on the first video data packet to obtain the first data packet error rate within a set time window. The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the set time window to the total number of data packets. If the error rate of the first data packet is greater than the first preset error rate, then switch to the backup input path and input the backup video source through the backup input path.
[0094] In one possible example, regarding the process of performing a video health check on the first video data packet to obtain the first data packet error rate within a first set time window, the processor 410 is further configured to: Determine whether the first video data packet meets any of the following conditions; if so, increment the error rate counter by one: The sequential count bits of consecutive video data packets are out of order; The error flag of the first video data packet is set; The size of the video service data in the first video data packet differs from the set standard; The packet error rate is determined based on the count of the error rate counter and the total number of packets.
[0095] In one possible example, the processor 410 described above is also used for: Determine the sum of the header length of the first video data packet and the first value of the data index; If the offset of the basic stream field of the group differs from the sum of the first values, it is determined that the size of the video service data in the first video data packet differs from the set standard.
[0096] In one possible example, during the operation of the alternative input path, the processor 410 is also specifically used for: After a preset recovery time interval, check whether the main input path has returned to a healthy state; If the main input path recovers to a healthy state, switch to the main input path and re-input the first video source through the main input path.
[0097] In one possible example, regarding the detection of whether the main input path has returned to a healthy state, the processor 410 is further specifically configured to: Determine whether the main input path meets the following conditions; if so, determine that the main input path has recovered to a healthy state: A connection has been established with the main input path; The first video data packet of the first video source flows continuously, and the time interval between two adjacent first video data packets does not exceed the set interval duration; Whether the error rate of the first data packet within the second set time window is less than or equal to the second preset error rate; The first video source has transmitted multiple first video data packets, including keyframes and video headers.
[0098] In one possible example, the processor 410 described above is also specifically used for: If the first video source input from the main input path cannot be detected, switch to the backup input path and input the backup video source through the backup input path.
[0099] In one possible example, the processor 410 described above is also specifically used for: If the first video data packet meets the health conditions, the first video data packet is transcoded and the transcoded first video data packet is output.
[0100] In an embodiment of this application, the streaming media server receives a first video source transmitted via the main input path. The first video source is divided into multiple first video data packets for transmission. A video health check is performed on the first video data packets to obtain the first data packet error rate within a set time window. The first data packet error rate represents the ratio of the number of unhealthy data packets transmitted within the set time window to the total number of data packets. If the first data packet error rate is greater than a first preset error rate, the system switches to the backup input path and inputs a backup video source through the backup input path. By setting two input paths, the system can flexibly switch between the main input path and the backup input path, reducing streaming media interruptions.
[0101] The embodiments of this application also provide a computer-readable program product storing program instructions, which, when executed by a computer, cause the computer to perform the aforementioned video transmission control method.
[0102] This application also provides a computer program product, comprising a non-transitory computer-readable program product storing a computer program operable to cause a computer to perform some or all of the steps described in any of the video transmission control methods recounted in this application. This computer program product may be a software installation package.
[0103] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0104] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus (devices), or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The computer program may be stored / distributed in a suitable medium, provided with or as part of other hardware, or may take other distribution forms, such as via the Internet or other wired or wireless telecommunications systems.
[0105] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable vehicle trajectory analysis device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable vehicle trajectory analysis device, generate instructions for implementing the process... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0106] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable human and vehicle trajectory analysis device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0107] These computer program instructions can also be loaded onto a computer or other programmable human and vehicle trajectory analysis device, causing a series of operational steps to be executed on the computer or other programmable device to produce computer-implemented processing, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0108] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
Claims
1. A video transmission control method characterized by comprising: The method comprises: receiving a first video source transmitted by a main input path, the first video source being divided into a plurality of first video data packets for transmission; performing a video health check on the first video data packets to obtain a first data packet error rate within a first set time window, the first data packet error rate representing a ratio of the number of unhealthy data packets transmitted within the first set time window to the total number of data packets; if the first data packet error rate is greater than a first preset error rate, switching to a backup input path to input a backup video source through the backup input path.
2. The method of claim 1, wherein, The video health check on the first video data packets to obtain the first data packet error rate within the first set time window comprises: determining whether the first video data packets satisfy any of the following conditions, and if so, increasing the count of an error rate counter by one: the order count bits of consecutive video data packets are out of order; an error flag bit of the first video data packets is set; the size of video service data in the first video data packets is different from a set standard; determining the data packet error rate according to the count of the error rate counter and the total number of data packets.
3. The method of claim 2, wherein, The method further comprises: determining the sum of the first number of the header length and the data index of the first video data packets; if the offset of the packet elementary stream field is different from the sum of the first number, determining that the size of video service data in the first video data packets is different from a set standard.
4. The method of claim 1, wherein, During the operation of the backup input path, the method further comprises: after a preset recovery time interval, detecting whether the main input path recovers to a healthy state; if the main input path recovers to the healthy state, switching to the main input path to input the first video source through the main input path again.
5. The method of claim 4, wherein, The detection of whether the main input path recovers to the healthy state comprises: determining whether the main input path satisfies the following conditions, and if so, determining that the main input path recovers to the healthy state: a connection with the main input path has been established; the first video data packets of the first video source continuously flow, and the time interval between adjacent first video data packets does not exceed a set interval length; the first data packet error rate within a second set time window is less than or equal to a second preset error rate; the plurality of first video data packets transmitted by the first video source include key frames and video headers.
6. The method of claim 1, wherein, The method further comprises: if the first video source input from the main input path cannot be detected, switching to the backup input path to input the backup video source through the backup input path.
7. The method of claim 1, wherein, The method further comprises: if the first video data packets satisfy the healthy condition, transcoding the first video data packets and outputting the transcoded first video data packets.
8. A streaming server, characterized by The streaming media server comprises a signal switcher and a first video health checker; the signal switcher is configured to receive a first video source transmitted by a main input path, the first video source being divided into a plurality of first video data packets for transmission; The first video health checker is configured to perform a video health check on the first video data packet to obtain a first data packet error rate within a first set time window, the first data packet error rate representing a ratio of a number of unhealthy data packets transmitted within the first set time window to a total number of data packets; If the first data packet error rate is greater than a first preset error rate, the signal switcher is further configured to switch to a backup input path to input a backup video source through the backup input path.
9. The streaming media server of claim 8, wherein, The computer program product further comprises a backup health checker configured to detect whether the main input path recovers to a healthy state after a preset recovery time interval during operation of the backup input path. If the main input path recovers to the healthy state, the signal switcher is further configured to switch to the main input path to input the first video source through the main input path again.
10. A computer program product, characterised in that, The computer program in the computer program product, when executed, implements the steps of the video transmission control method in any one of claims 1 to 7.
Citation Information
Patent Citations
Double-code-stream video switching method and system
CN111756583A
Data transmission control method and device, mobile terminal and storage medium
CN112367493A
Path switching method and path switching device
CN112866187A
Double-link video transmission method, system and device and storage medium
CN118803303A
Link switching device and its method in communication system
CN1859020A