Video transmission method and device, storage medium and electronic device

By exchanging parameter information and collision detection between shooting devices within the same communication network, and adjusting the transmission time slots of key video frames, the problem of video frame collision caused by the inability to adjust in time by the network platform, and improving transmission efficiency and picture quality.

CN114679570BActive Publication Date: 2025-08-12ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210290601.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2025-08-12
Estimated Expiration
2042-03-23

AI Technical Summary

Technical Problem

When a network platform receives multiple key video frames, the prior art cannot adjust in time, resulting in video frame collisions, resulting in data congestion and increased screen delay.

Method used

By obtaining the parameter information of the current shooting device and the reference shooting device, perform collision detection, and adjust the transmission timing of key video frames in the idle time slot to avoid collisions.

Benefits of technology

It effectively avoids collisions of key video frames, reduces network data bursts, and improves transmission efficiency and picture quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114679570B_ABST
    Figure CN114679570B_ABST
Patent Text Reader

Abstract

The present invention discloses a video transmission method and device, a storage medium and an electronic device, wherein the above method includes: obtaining first parameter information of a first key video frame to be transmitted by a current shooting device, and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the current shooting device; using the first parameter information and the second parameter information, performing collision detection on the first key video frame and the second key video frame; when the result of the collision detection indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, determining a target idle time slot from an idle period of the current shooting device; adjusting the first key video frame to the target idle time slot for transmission; adopting the above technical solution solves the technical problem of untimely adjustment caused by the network platform performing adjustment after multiple key video frames arrive.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a video transmission method and device, a storage medium, and an electronic device. Background Art

[0002] Currently, network platforms can pull video streams from multiple IP cameras (IPCs) simultaneously. The greater the number of IPCs, the greater the probability that multiple key video frames will arrive at the network platform simultaneously, leading to key video frame collisions. These collisions can cause a burst of large amounts of data within the same communication network, potentially leading to data congestion, increased video latency, and even freezes.

[0003] In related technologies, to avoid key frame collisions, after multiple key frames arrive at the network platform, the network platform adjusts the timing of key frame generation by multiple IPCs to reduce the probability of key frame collisions. However, before the key frames arrive at the network platform, multiple key frames have already collided during network transmission. Therefore, if the network platform makes adjustments after multiple key frames arrive, the adjustments will be delayed.

[0004] Regarding the technical problem in related technologies, since the network platform makes adjustments after multiple key video frames arrive, resulting in untimely adjustments, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of the present invention provide a video transmission method and apparatus, a storage medium, and an electronic device to at least solve the technical problem in related technologies that a network platform performs adjustments after multiple key video frames arrive, resulting in untimely adjustments.

[0006] According to an embodiment of the present invention, a video transmission method is provided, including: obtaining first parameter information of a first key video frame to be transmitted by a current shooting device, and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the above-mentioned current shooting device, wherein the above-mentioned current shooting device and the above-mentioned reference shooting device are located in the same communication network; using the above-mentioned first parameter information and the above-mentioned second parameter information, performing collision detection on the above-mentioned first key video frame and the above-mentioned second key video frame; when the result of the collision detection indicates that a video frame collision occurs between the above-mentioned first key video frame and at least one of the above-mentioned second key video frames, determining a target idle time slot from the idle period of the above-mentioned current shooting device; and adjusting the above-mentioned first key video frame to the above-mentioned target idle time slot for transmission.

[0007] In an exemplary embodiment, the collision detection of the first key video frame and the second key video frame using the first parameter information and the second parameter information includes: determining the first time period of the first key video frame in the first transmission cycle corresponding to the first picture group to which it belongs according to the first parameter information; determining the second time period of each of the second key video frames in the second transmission cycle matching the first transmission cycle according to each of the second parameter information, wherein the first transmission cycle and the second transmission cycle are the same cycle; in the case that the first time period and at least one of the second time periods are the same time period, determining that a video frame collision occurs between the first key video frame and the second key video frame located in the same time period.

[0008] In an exemplary embodiment, before obtaining the first parameter information of the first key video frame to be transmitted by the current shooting device and the second parameter information of the second key video frame to be transmitted by the reference shooting device associated with the current shooting device, it also includes: dividing the first transmission period corresponding to the first key video frame into a first time period sequence according to a unit time interval, wherein each time period in the first time period sequence includes N time slots; dividing the second transmission period corresponding to each of the second key video frames into a second time period sequence according to the unit time interval, wherein each time period in the second time period sequence includes N time slots, and the above N is a positive integer; aligning the first time period sequence and each of the second time period sequences in chronological order.

[0009] In an exemplary embodiment, the above-mentioned determination of the target idle time slot from the idle period of the above-mentioned current shooting device includes: obtaining the first candidate time period in which the above-mentioned first key video frame is not transmitted in the above-mentioned first transmission cycle, and the second candidate time period in which the above-mentioned second key video frame is not transmitted in each of the above-mentioned second transmission cycles; determining the above-mentioned idle time period based on the intersection result of the above-mentioned first candidate time period and the above-mentioned second candidate time period; and determining the above-mentioned target idle time slot within the above-mentioned idle time period.

[0010] In an exemplary embodiment, the above-mentioned idle period is determined based on the intersection result of the above-mentioned first candidate time period and the above-mentioned second candidate time period, including: when the above-mentioned intersection result indicates that it includes at least one candidate time period, the above-mentioned at least one candidate time period is determined as the above-mentioned idle period; when the above-mentioned intersection result indicates that it includes zero, the number of shooting devices in which video frame collisions occur in each candidate time period is counted; and the time period with the smallest number is determined as the above-mentioned idle period.

[0011] In an exemplary embodiment, the above-mentioned determination of the target idle time slot within the above-mentioned idle period includes: when the number of the above-mentioned reference shooting devices where the above-mentioned second key video frame that collides with the above-mentioned first key video frame is located is less than the target threshold, determining the time slot located at the center position of the above-mentioned idle period as the above-mentioned target idle time slot; when the number of the above-mentioned reference shooting devices where the above-mentioned second key video frame that collides with the above-mentioned first key video frame is located is greater than the above-mentioned target threshold, determining the time slot with the lowest bit rate as the above-mentioned target idle time slot.

[0012] In an exemplary embodiment, adjusting the first key video frame to the target idle time slot for transmission includes: generating a third key video frame matching the first key video frame in the target idle time slot, wherein the third key video frame is used to replace the first key video frame for transmission.

[0013] In an exemplary embodiment, before adjusting the above-mentioned first key video frame to the above-mentioned target idle time slot for transmission, it also includes: obtaining the first adjustment priority corresponding to the above-mentioned current shooting device, and the second adjustment priority corresponding to the above-mentioned reference shooting device where the above-mentioned second key video frame that has a video frame collision with the above-mentioned first key video frame is located; when the above-mentioned first adjustment priority is higher than the above-mentioned second adjustment priority, determining to adjust the above-mentioned first key video frame; when the above-mentioned first adjustment priority is lower than the above-mentioned second adjustment priority, determining not to adjust the above-mentioned first key video frame; when the above-mentioned first adjustment priority is equal to the above-mentioned second adjustment priority, determining whether to adjust the above-mentioned first key video frame according to the device identification of the above-mentioned current shooting device.

[0014] In an exemplary embodiment, the above-mentioned determination of whether to adjust the above-mentioned first key video frame based on the device identification of the above-mentioned current shooting device includes: obtaining the first device identification corresponding to the above-mentioned current shooting device, and the second device identification corresponding to the above-mentioned reference shooting device where the above-mentioned second key video frame that has a video frame collision with the above-mentioned first key video frame is located; when the above-mentioned first device identification is greater than the above-mentioned second device identification, determining to adjust the above-mentioned first key video frame; when the above-mentioned first device identification is less than the above-mentioned second device identification, determining not to adjust the above-mentioned first key video frame.

[0015] According to another embodiment of the present invention, a video transmission device is also provided, including: an acquisition module for acquiring first parameter information of a first key video frame to be transmitted by a current shooting device, and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the above-mentioned current shooting device, wherein the above-mentioned current shooting device and the above-mentioned reference shooting device are located in the same communication network; a detection module for performing collision detection on the above-mentioned first key video frame and the above-mentioned second key video frame using the above-mentioned first parameter information and the above-mentioned second parameter information; a determination module for determining a target idle time slot from the idle time period of the above-mentioned current shooting device when the result of the collision detection indicates that the above-mentioned first key video frame has a video frame collision with at least one of the above-mentioned second key video frames; and an adjustment module for adjusting the above-mentioned first key video frame to the above-mentioned target idle time slot for transmission.

[0016] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned video transmission method when running.

[0017] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the video transmission method through the computer program.

[0018] In an embodiment of the present invention, first parameter information of a first key video frame to be transmitted by a current shooting device and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the current shooting device are obtained, wherein the current shooting device and the reference shooting device are located in the same communication network; collision detection is performed on the first key video frame and the second key video frame using the first parameter information and the second parameter information; when the result of the collision detection indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, a target idle time slot is determined from the idle period of the current shooting device; the first key video frame is adjusted to the target idle time slot for transmission; using the above technical solution, before the shooting device transmits the key video frame, multiple shooting devices self-negotiate to complete the key video frame collision detection and the key video frame staggered sending adjustment to avoid the key video frame collision, thereby solving the technical problem of untimely adjustment caused by the network platform performing adjustments after multiple key video frames arrive. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0020] Figure 1 (a)-(c) are schematic diagrams of application scenarios of an optional video transmission method according to an embodiment of the present invention;

[0021] Figure 2 is a flow chart of an optional video transmission method according to an embodiment of the present invention;

[0022] Figure 3 is a schematic diagram of an optional video transmission method according to an embodiment of the present invention;

[0023] Figure 4 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0024] Figure 5 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0025] Figure 6 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0026] Figure 7 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0027] Figure 8 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0028] Figure 9 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0029] Figure 10 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0030] Figure 11 is a schematic diagram of another optional video transmission method according to an embodiment of the present invention;

[0031] Figure 12 This is a structural block diagram of an optional video transmission device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] In an embodiment of the present invention, an embodiment of the above-mentioned video transmission method is provided. As an optional implementation, the video transmission method can be applied to, but not limited to, Figure 1 In the application environment shown.

[0035] Optionally, in this embodiment, if Figure 1 As shown in (a), the shooting devices 101, 102, and 103 are located in the same communication network. The shooting devices 101, 102, and 103 transmit the acquired video data to the video preview device 105 via the network 104. Before adjusting the key video frames transmitted by the shooting devices 101, 102, and 103, the transmission diagram of the key video frames is as shown in FIG. Figure 1 As shown in (b), the dotted line represents the key video frame transmitted by the shooting device 101, the solid line represents the key video frame transmitted by the shooting device 102, and the bold solid line represents the key video frame transmitted by the shooting device 103. Figure 1 As shown in (b), the key video frames transmitted by the shooting devices 101, 102 and 103 collide. After the time slots for the shooting devices 101, 102 and 103 to transmit the key video frames are adjusted, the transmission diagram of the key video frames transmitted by the shooting devices 101, 102 and 103 is as follows: Figure 1 As shown in (c), it can be seen that the key video frames of shooting devices 101, 102 and 103 are transmitted in staggered manner, and no key video frame collision occurs, thereby avoiding sudden bursts of large amounts of data in the network in a short period of time.

[0036] In this embodiment, a video transmission method is provided. Figure 2 1 is a flow chart of a video transmission method according to an embodiment of the present invention, the flow chart comprising the following steps:

[0037] Step S202: obtaining first parameter information of a first key video frame to be transmitted by a current capture device, and second parameter information of a second key video frame to be transmitted by a reference capture device associated with the current capture device, wherein the current capture device and the reference capture device are located in the same communication network;

[0038] Step S204: performing collision detection on the first key video frame and the second key video frame using the first parameter information and the second parameter information;

[0039] Step S206 , when the collision detection result indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, determining a target idle time slot from an idle period of the current shooting device;

[0040] Step S208: Adjust the first key video frame to the target idle time slot for transmission.

[0041] Optionally, in this embodiment, the camera device may include, but is not limited to, a network camera, a night vision camera, or a digital camera. It may also include, but is not limited to, cameras with different resolutions, such as standard definition, high definition, and full high definition. The first and second key video frames may be, but are not limited to, key video frames. The parameter information may include, but is not limited to, device identification, priority, channel number, stream type, bitrate, frame rate, group of pictures (GOP) size, key video frame transmission timestamp, and key video frame transmission duration. The current camera device may broadcast the parameter information to the associated reference camera device through, but is not limited to, multicast, broadcast, or D2D multicast; the reference camera device obtains the parameter information broadcast by the current camera device through real-time monitoring. The current camera device and the associated reference camera device have a broadcast-and-real-time monitoring relationship. That is, each camera within the same communication network broadcasts the parameter information of its transmitted key video frames to other associated cameras, and simultaneously monitors the parameter information of the key video frames broadcast by other associated cameras in real time. The obtained parameter information of the key video frames can be locally cached and updated in real time.

[0042] Optionally, in this embodiment, the collision between the first key video frame and the second key video frame may include, but is not limited to, the first key video frame and the second key video frame being in the same transmission period, or the first key video frame and the second key video frame having an overlapping transmission period. The sending time and end time of the key video frame can be determined using the sending timestamp and the sending duration of the key video frame; after determining the sending time and end time of each key video frame, it can be determined whether a collision has occurred between the key video frames.

[0043] Optionally, in this embodiment, the above-mentioned time period may include but is not limited to one or more time slots; the above-mentioned idle time period may be a time period in which no key video frames are transmitted, for example, a time period in which P frames are transmitted or a time period in which B frames are transmitted; or it may be a time period in which a small number of key video frames are transmitted, which is not limited here. Determining the target idle time slot from the idle time period of the current shooting device may include but is not limited to determining the target idle time slot according to a preset rule. For example, if there are multiple idle time slots between two adjacent key video frames, the idle time slot in the middle position is determined as the target idle time slot; or, when there are a large number of shooting devices and there are no idle time slots, the time slot with the smallest total video bit rate is determined as the target idle time slot.

[0044] Optionally, in this embodiment, adjusting the first key video frame to the target idle time slot may include but is not limited to shifting the time when the current shooting device generates the key video frame backward by a preset time to regenerate the key video frame.

[0045] For example, Figure 3 As shown, there are three shooting devices in the same communication network, among which the shooting device represented by the dotted line and the shooting device represented by the solid line have a key video frame collision, and the shooting device represented by the bold solid line has not collided with the other two shooting devices. Assuming that the shooting device represented by the solid line is the device to be adjusted, after the device to be adjusted is adjusted to the idle period, the shooting device represented by the dotted line and the shooting device represented by the solid line transmit the key video frames at staggered times, thereby avoiding collisions between the shooting devices.

[0046] Through the solution provided in the embodiment of the present application, first parameter information of the first key video frame to be transmitted by the current shooting device and second parameter information of the second key video frame to be transmitted by the reference shooting device associated with the current shooting device are obtained, wherein the current shooting device and the reference shooting device are located in the same communication network; collision detection is performed on the first key video frame and the second key video frame using the first parameter information and the second parameter information; when the result of the collision detection indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, a target idle time slot is determined from the idle period of the current shooting device; the first key video frame is adjusted to the target idle time slot for transmission; using the above-mentioned technical solution, before the shooting device transmits the key video frame, multiple shooting devices self-negotiate to complete the key video frame collision detection and the key video frame staggered sending adjustment to avoid the collision of the key video frames, thereby solving the technical problem of untimely adjustment caused by the network platform performing adjustments after multiple key video frames arrive.

[0047] In an exemplary embodiment, collision detection between a first key video frame and a second key video frame is performed using first parameter information and second parameter information, including: determining a first time period of the first key video frame in a first transmission cycle corresponding to the first picture group to which it belongs according to the first parameter information; determining a second time period of each second key video frame in a second transmission cycle matching the first transmission cycle according to each second parameter information, wherein the first transmission cycle and the second transmission cycle are the same cycle; and when the first time period and at least one second time period are the same time period, determining that a video frame collision occurs between the first key video frame and the second key video frame located in the same time period.

[0048] Optionally, in this embodiment, the size of the above-mentioned group of pictures, i.e., GOP, can be but is not limited to the transmission period of the key video frame. For example, a video stream with FPS = 25 frames / second and GOP = 50 frames generates 25 frames of video data per second, and the interval between each frame = 1 second / 25 = 40ms, that is, the size of a time slot is 40ms; a key video frame is generated every 50 frames, so the transmission period of the key video frame GOP = 50*40ms = 2000ms = 2s.

[0049] Optionally, in this embodiment, the transmission period can be divided into multiple time periods, each of which can include, but is not limited to, one or more time slots. For example, if a time period is 120ms, each time period includes three time slots. The time period size can be dynamically adjusted based on, but is not limited to, parameters such as the number of cameras, GOP size, and frame rate.

[0050] Optionally, in this embodiment, determining the first time period of the first transmission period corresponding to the first group of pictures to which the first key video frame belongs based on the first parameter information may be, but is not limited to, performing a modulo operation on the GOP using the key video frame's transmission time. The time period to which the key video frame belongs is determined based on the modulo operation and the time period length. This hashes each key video frame into the GOP period, unifying the comparison criteria. It should be noted that since the key video frames of a video stream are periodically generated and transmitted based on the GOP, the transmission time of the key video frames and the result of the GOP modulo operation remain unchanged. For example, if the GOP = 2s and the camera begins generating and transmitting key video frames at 10ms, the second key video frame occurs at 2s + 10ms, and the third key video frame occurs at 2s + 2s + 10ms. However, the transmission time of the key video frames and the result of the GOP modulo operation are both at 10ms within the GOP period. If a time period is 120ms, the key video frame is located in the first time period. If the camera begins generating and transmitting key video frames at 150ms, the key video frame is located in the second time period.

[0051] Optionally, in this embodiment, if there are two or more key video frames in a certain time period of a GOP, it is considered that a video frame collision occurs in the time period.

[0052] With the solution provided in the embodiment of the present application, the accuracy of collision detection is improved by dividing the transmission cycle into multiple time periods and performing collision detection within the time periods.

[0053] In an exemplary embodiment, before obtaining the first parameter information of the first key video frame to be transmitted by the current shooting device and the second parameter information of the second key video frame to be transmitted by the reference shooting device associated with the current shooting device, it also includes: dividing the first transmission period corresponding to the first key video frame into a first time period sequence according to a unit time interval, wherein each time period in the first time period sequence includes N time slots; dividing the second transmission period corresponding to each second key video frame into a second time period sequence according to a unit time interval, wherein each time period in the second time period sequence includes N time slots, and N is a positive integer; aligning the first time period sequence and each second time period sequence in chronological order.

[0054] Optionally, in this embodiment, the time period sequence may include but is not limited to multiple time periods, and each time period may include but is not limited to one or more time slots.

[0055] For example, a video stream with an FPS of 25 frames per second and a GOP of 50 frames generates 25 frames of video data per second. The frame interval is 1 second / 25 = 40 ms, meaning a time slot is 40 ms. A key video frame is generated every 50 frames, so the key video frame transmission period is GOP = 50 * 40 ms = 2000 ms = 2 seconds. If a time slot is 120 ms, each time slot consists of 3 time slots.

[0056] For example, suppose there are three cameras, IPC-1, IPC-2 and IPC-3, and the time slots of the three cameras sending video frames are as follows: Figure 4 The time period when these three shooting devices send video frames is shown in Figure 5 As shown. Figure 5 It can be seen that there are two key video frames in period 1, so it is considered that IPC-1 and IPC-3 collide in period 1.

[0057] With the solution provided in the embodiment of the present application, the accuracy of collision detection is improved by dividing the transmission cycle into multiple time periods and performing collision detection within the time periods.

[0058] In an exemplary embodiment, determining a target idle time slot from an idle period of the current shooting device includes: obtaining a first candidate time period in which the first key video frame is not transmitted in a first transmission cycle, and a second candidate time period in which the second key video frame is not transmitted in each second transmission cycle; determining an idle time period based on the intersection result of the first candidate time period and the second candidate time period; and determining a target idle time slot within the idle time period.

[0059] It should be noted that, since the same time period includes two or more key video frames, it is considered that the key video frames collide within the time period, and the intersection time period of the first candidate time period and each second candidate time period is a time period in which no key video frame is transmitted. Therefore, after a key video frame is moved to the intersection time period, the intersection time period includes a key video frame, so no collision occurs in the intersection time period.

[0060] For example, Figure 5 As shown in the figure, IPC-1 transmits a key video frame in period 1, so the candidate periods where IPC-1 does not transmit a key video frame are period 2, period 3, and period 4. IPC-2 transmits a key video frame in period 2, so the candidate periods where IPC-2 does not transmit a key video frame are period 1, period 3, and period 4. IPC-3 transmits a key video frame in period 1, so the candidate periods where IPC-3 does not transmit a key video frame are period 2, period 3, and period 4. The intersection of IPC-1, IPC-2, and IPC-3 is period 3 and period 4. Therefore, the target idle time slot can be determined from period 3 and period 4.

[0061] Through the solution provided in the embodiment of the present application, an idle period is determined by performing an intersection operation on candidate time periods in which each shooting device does not transmit a key video frame, thereby improving the efficiency and accuracy of determining the idle period.

[0062] In an exemplary embodiment, determining an idle period based on the intersection result of the first candidate period and the second candidate period includes: when the intersection result indicates that at least one candidate period is included, determining at least one candidate period as an idle period; when the intersection result indicates that it is zero, counting the number of shooting devices in which video frame collisions occur in each candidate period; and determining the period with the smallest number as the idle period.

[0063] Optionally, in this embodiment, when the number of shooting devices in the same communication network is small and there are candidate time periods, the shooting devices that collide will be adjusted to the selected candidate time period; when the number of shooting devices in the same communication network is large and there are no candidate time periods, the shooting devices that collide will be adjusted to the time period with the smallest number of shooting devices.

[0064] It should be noted that, in the same video transmission cycle, each shooting device transmits one key video frame. Therefore, the number of key video frames in each time period is the number of shooting devices.

[0065] For example, Figure 6 As shown, the number of IPCs of the shooting devices in period 2 is 2. Therefore, it is considered that a collision has occurred in the key video frames, and there are candidate periods in which the key video frames are not transmitted. Then, an idle period can be determined from the multiple candidate periods.

[0066] For example, Figure 7 As shown, at this time, the number of camera IPCs in the network is relatively large, and there are no candidate time periods in which key video frames are not transmitted. Therefore, the cameras in time period 2, which has the largest number of camera IPCs, are adjusted to the time period with the smallest number of camera IPCs (time period 3, time period 4, or time period 5). It should be noted that the number of camera IPCs in the time period with the smallest number of camera IPCs must be two or more less than the number of camera IPCs in the time period to be adjusted to ensure that the overall transmission bit rate remains balanced.

[0067] Through the solution provided in the embodiment of the present application, by determining the time period with the smallest number as the idle time period, it is possible to ensure that the overall transmission code rate remains balanced.

[0068] In an exemplary embodiment, determining a target idle time slot within an idle period includes: when the number of reference shooting devices where a second key video frame that has a video frame collision with a first key video frame is located is less than a target threshold, determining a time slot located at a center position within the idle period as a target idle time slot; when the number of reference shooting devices where a second key video frame that has a video frame collision with a first key video frame is located is greater than a target threshold, determining a time slot with the lowest bit rate as a target idle time slot.

[0069] It should be noted that since key video frames have a transmission duration, that is, key video frames will be transmitted for a period of time in the communication network, therefore, when there are not many shooting devices and there are a certain number of idle periods, in order to avoid the overlap of transmission times between different key video frames, the time slot at the center of the idle period is determined as the target idle time slot. Figure 6 As shown in Figure 1, there are 3 shooting devices in the communication network, which is not a large number, and there are a certain number of idle time slots (time slots 3-10). At this time, the time slot at the center of time slots 6 and 7 can be determined as the target idle time slot. Figure 8 shown.

[0070] It should be noted that since each camera will broadcast the parameter information of each key video frame it sends, such as device identification, priority, channel number, stream type, bit rate, frame rate, and GOP size, each camera can know the total transmission bit rate of each time period in the network channel. Therefore, when there are a large number of cameras and there are no idle periods, the time slot with the lowest bit rate can be determined as the target idle time slot to ensure that the overall transmission bit rate remains balanced. For example, Figure 9 As shown, there are a large number of shooting devices in the communication network and there is no idle period. In order to ensure that the overall transmission bit rate remains balanced, the shooting devices to be adjusted can be adjusted to the point where the total transmission bit rate is minimized.

[0071] Through the solution provided in the embodiment of the present application, the adjustment method is determined according to the number of shooting devices in the communication network, which can avoid the intersection of transmission time between different key video frames and ensure that the overall transmission bit rate remains balanced.

[0072] In an exemplary embodiment, adjusting the first key video frame to the target idle time slot for transmission includes generating a third key video frame matching the first key video frame in the target idle time slot, wherein the third key video frame is used to replace the first key video frame for transmission.

[0073] For example, Figure 8 As shown, the first key video frame is adjusted from period 2 to period 6. Assuming that the length of each period is 120ms, the time when the current shooting device generates the first key video frame is shifted back 4*120=480ms. The current shooting device adjusts its own encoding and regenerates the third key video frame.

[0074] Through the solution provided in the embodiment of the present application, by regenerating key video frames in the target idle time slot, collision of key video frames can be avoided.

[0075] In an exemplary embodiment, before adjusting the first key video frame to the target idle time slot for transmission, it also includes: obtaining a first adjustment priority corresponding to the current shooting device, and a second adjustment priority corresponding to the reference shooting device where the second key video frame that has a video frame collision with the first key video frame is located; when the first adjustment priority is higher than the second adjustment priority, determining to adjust the first key video frame; when the first adjustment priority is lower than the second adjustment priority, determining not to adjust the first key video frame; when the first adjustment priority is equal to the second adjustment priority, determining whether to adjust the first key video frame according to the device identification of the current shooting device.

[0076] Optionally, in this embodiment, when the current camera collides with another reference camera, a predetermined adjustment order may be used to determine whether to adjust the current camera or the other reference camera. The predetermined adjustment order may include, but is not limited to, prioritizing the camera with the highest priority. If the current camera and the other reference cameras have the same priority, adjustments may be made based on, but are not limited to, other attributes, such as the size of the device identifier, the size of the IP address, or the order in which the cameras were started.

[0077] Through the solution provided in the embodiment of the present application, adjustment conflicts can be avoided by determining the adjustment order according to certain rules.

[0078] In an exemplary embodiment, determining whether to adjust the first key video frame based on the device identification of the current shooting device includes: obtaining the first device identification corresponding to the current shooting device, and the second device identification corresponding to the reference shooting device where the second key video frame that has a video frame collision with the first key video frame is located; when the first device identification is greater than the second device identification, determining to adjust the first key video frame; when the first device identification is less than the second device identification, determining not to adjust the first key video frame.

[0079] Optionally, in this embodiment, when the current camera has the same priority as other reference cameras, the adjustment order may be determined, but is not limited to, based on the size of the device identifiers. For example, cameras with larger device identifiers may be adjusted first, or cameras with smaller device identifiers may be adjusted first.

[0080] For example, Figure 10 As shown in the figure, there are three shooting devices in the same communication network, and the shooting device IDs are 1, 5, and 3 respectively. The current shooting device ID is 5. The current shooting device determines for the first time that the three shooting devices have a key video frame collision. Therefore, the current shooting device needs to determine whether it needs to adjust the time it generates the key video frame. Among the three shooting devices, the shooting device with the highest priority has an ID of 1 and a priority of 2, while the priority of the current shooting device is 1, which is not the highest priority. Therefore, the current shooting device does not need to be adjusted. After the shooting device with ID 1 is adjusted, as shown in the figure, Figure 11 As shown, the current camera determines that a key video frame collision has occurred again. Therefore, the current camera needs to determine whether to adjust the timing of its key video frame generation. The current camera has the same priority as the camera with ID = 3, which is priority = 1. However, the ID value of the current camera is greater than the ID value of the camera with ID = 3. Therefore, the current camera needs to adjust its encoding and regenerate key video frames during the idle period.

[0081] Through the solution provided in the embodiment of the present application, adjustment conflicts can be avoided by determining the adjustment order according to certain rules.

[0082] In this embodiment, a video transmission method is provided. The solution flow of the video transmission method is described as follows:

[0083] Step S1: A group of shooting devices access the real-time streaming backend service (platform / network video recorder NVR) through a wireless network such as 4G / 5G / WIFI, and preview the video through a real-time video preview device;

[0084] Step S2: Each time the camera sends a key video frame, it multicasts key video frame parameter information, such as device identification, priority, channel number, stream type, bit rate, frame rate, GOP size, and sending duration.

[0085] Step S3: The camera monitors the multicast parameter messages in real time. After receiving the multicast message of key video frame parameters from other cameras, it combines its own key video frame parameter information with the "collision detection service" to perform key video frame collision detection.

[0086] Step S4: The "collision detection service" detects whether the current camera has a key video frame collision with other associated reference cameras based on the multicast timestamp, transmission duration, GOP and other parameters of the camera's key video frame, combined with the key video frame information distribution of the group of cameras;

[0087] Step S5: When a key frame collision occurs, the "Traffic Peak Staggering" service determines whether the current camera's key frame generation timing needs to be adjusted, as well as the target time slot to which it should be adjusted. The key frame timing is then adjusted by adjusting the camera's own encoding. For example, if a collision occurs and the optimal time slot for the current camera's key frame generation is 100ms later, the camera's encoding is adjusted to delay the generation of key frames in the GOP by 100ms.

[0088] The specific method of the "collision detection service" in step S4 is described as follows:

[0089] Step S4.1: After the collision detection service is started, it will remain in the background and provide continuous service until the service ends;

[0090] Step S4.2: The service blocks and waits for the injection of key video frame parameter information of the shooting device (parameter information, such as device identification, priority, channel number, stream type, bit rate, frame rate, GOP size, transmission duration, etc.);

[0091] Step S4.3: receiving the key video frame parameter information multicasted by other shooting devices, and updating the parameter information of the current shooting device in the local cache;

[0092] Step S4.4: performing time-sharing hashing on the received key video frame parameter information;

[0093] Among them, the time hash processing method includes:

[0094] Step S4.4.1: Hash the key video frame information to the GOP period to obtain the hash time slot HashTimeSlot, and unify the comparison standard; wherein, the hash time slot HashTimeSlot = key video frame broadcast timestamp % GOP (modulus operation);

[0095] Step S4.4.2: Dynamically adjust the time interval HashTimeInterval based on the number of cameras, GOP, and frame rate. Distribute the key video frames from all cameras into multiple time intervals within the GOP. Hash Time Interval = Ceiling(HashTimeSlot / HashTimeInterval), where Ceiling() is a round-up function.

[0096] Step S4.5: Determine whether the key video frame of the current camera is in the same time period as the key video frames of other cameras. If so, a key video frame collision occurs. Otherwise, continue receiving key video frames from other cameras and continue collision detection.

[0097] Step S4.6: After a collision occurs, the traffic flow is adjusted to a staggered peak through the staggered peak handling process.

[0098] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0099] Figure 12 is a structural block diagram of a video transmission device according to an embodiment of the present invention; Figure 12 Shown, including:

[0100] An acquisition module 1201 is configured to acquire first parameter information of a first key video frame to be transmitted by a current capture device, and second parameter information of a second key video frame to be transmitted by a reference capture device associated with the current capture device, wherein the current capture device and the reference capture device are located in the same communication network;

[0101] A detection module 1202 is configured to perform collision detection on the first key video frame and the second key video frame using the first parameter information and the second parameter information;

[0102] A determination module 1203 is configured to determine a target idle time slot from an idle period of a current shooting device when a result of the collision detection indicates that a video frame collision occurs between the first key video frame and at least one second key video frame;

[0103] The adjustment module 1204 is configured to adjust the first key video frame to a target idle time slot for transmission.

[0104] Through the solution provided in the embodiment of the present application, first parameter information of the first key video frame to be transmitted by the current shooting device and second parameter information of the second key video frame to be transmitted by the reference shooting device associated with the current shooting device are obtained, wherein the current shooting device and the reference shooting device are located in the same communication network; collision detection is performed on the first key video frame and the second key video frame using the first parameter information and the second parameter information; when the result of the collision detection indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, a target idle time slot is determined from the idle period of the current shooting device; the first key video frame is adjusted to the target idle time slot for transmission; using the above-mentioned technical solution, before the shooting device transmits the key video frame, multiple shooting devices self-negotiate to complete the key video frame collision detection and the key video frame staggered sending adjustment to avoid the collision of the key video frames, thereby solving the technical problem of untimely adjustment caused by the network platform performing adjustments after multiple key video frames arrive.

[0105] An embodiment of the present invention further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0106] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0107] S1, obtaining first parameter information of a first key video frame to be transmitted by a current shooting device, and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the current shooting device, wherein the current shooting device and the reference shooting device are located in the same communication network;

[0108] S2, performing collision detection on the first key video frame and the second key video frame using the first parameter information and the second parameter information;

[0109] S3, when the collision detection result indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, determining a target idle time slot from an idle period of the current shooting device;

[0110] S4, adjusting the first key video frame to the target idle time slot for transmission.

[0111] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0112] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0113] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0114] S1, obtaining first parameter information of a first key video frame to be transmitted by a current shooting device, and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the current shooting device, wherein the current shooting device and the reference shooting device are located in the same communication network;

[0115] S2, performing collision detection on the first key video frame and the second key video frame using the first parameter information and the second parameter information;

[0116] S3, when the collision detection result indicates that a video frame collision occurs between the first key video frame and at least one second key video frame, determining a target idle time slot from an idle period of the current shooting device;

[0117] S4, adjusting the first key video frame to the target idle time slot for transmission.

[0118] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0119] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0120] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0121] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A video transmission method, characterized in that: include: Obtain the first parameter information of the first key video frame to be transmitted by the current shooting device, and Second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the current shooting device, wherein the current shooting device and the reference shooting device are located in the same communication network; Performing collision detection on the first key video frame and the second key video frame using the first parameter information and the second parameter information; When the collision detection result indicates that the first key video frame has a video frame collision with at least one of the second key video frames, determining a target idle time slot from an idle period of the current shooting device; Adjusting the first key video frame to the target idle time slot for transmission; The determining of the target idle time slot from the idle time period of the current shooting device includes: obtaining a first candidate time period in which the first key video frame is not transmitted in a first transmission cycle, and a second candidate time period in which the second key video frame is not transmitted in each second transmission cycle, wherein the first transmission cycle is a transmission cycle corresponding to a first picture group to which the first key video frame belongs, and the first transmission cycle and the second transmission cycle are the same cycle; and determining the idle time period according to an intersection result of the first candidate time period and the second candidate time period; The target idle time slot is determined within the idle period.

2. The video transmission method according to claim 1, wherein: The performing collision detection on the first key video frame and the second key video frame by using the first parameter information and the second parameter information includes: Determine, according to the first parameter information, a first time period of the first key video frame in a first transmission cycle corresponding to the first group of pictures to which it belongs; Determine, according to each piece of the second parameter information, a second time period of each of the second key video frames in a second transmission period that matches the first transmission period; In a case where the first time period and at least one of the second time periods are the same time period, it is determined that a video frame collision occurs between the first key video frame and the second key video frame located in the same time period.

3. The video transmission method according to claim 2, wherein: Before obtaining the first parameter information of the first key video frame to be transmitted by the current shooting device and the second parameter information of the second key video frame to be transmitted by the reference shooting device associated with the current shooting device, the method further includes: Dividing the first transmission period corresponding to the first key video frame into a first time period sequence according to unit time intervals, wherein each time period in the first time period sequence includes N time slots; Dividing the second transmission period corresponding to each of the second key video frames into a second time period sequence according to the unit time interval, wherein each time period in the second time period sequence includes N time slots, where N is a positive integer; The first time period sequence and each of the second time period sequences are aligned in time order.

4. The video transmission method according to claim 1, wherein: The determining the idle period according to the intersection result of the first candidate period and the second candidate period includes: if the intersection result indicates that at least one candidate period is included, determining the at least one candidate period as the idle period; When the intersection result indicates zero, the number of shooting devices that have video frame collisions in each candidate time period is counted; and the time period with the smallest number is determined as the idle time period.

5. The video transmission method according to claim 1, wherein: Determining the target idle time slot within the idle period includes: When the number of the reference shooting devices where the second key video frame having a video frame collision with the first key video frame is located is less than a target threshold, determining a time slot located at a center position within the idle period as the target idle time slot; When the number of the reference shooting devices where the second key video frame having a video frame collision with the first key video frame is located is greater than the target threshold, the time slot with the lowest bit rate is determined as the target idle time slot.

6. The video transmission method according to claim 1, wherein: The adjusting the first key video frame to the target idle time slot for transmission includes: A third key video frame matching the first key video frame is generated in the target idle time slot, wherein the third key video frame is used to replace the first key video frame for transmission.

7. The video transmission method according to claim 6, wherein: Before adjusting the first key video frame to the target idle time slot for transmission, the method further includes: Obtaining a first adjustment priority corresponding to the current shooting device and a second adjustment priority corresponding to the reference shooting device where the second key video frame having a video frame collision with the first key video frame is located; When the first adjustment priority is higher than the second adjustment priority, determining to adjust the first key video frame; When the first adjustment priority is lower than the second adjustment priority, determining not to adjust the first key video frame; When the first adjustment priority is equal to the second adjustment priority, it is determined whether to adjust the first key video frame according to the device identification of the current shooting device.

8. The video transmission method according to claim 7, wherein: The determining whether to adjust the first key video frame according to the device identification of the current shooting device includes: Obtaining a first device identifier corresponding to the current shooting device and a second device identifier corresponding to the reference shooting device where the second key video frame having a video frame collision with the first key video frame is located; When the first device identifier is greater than the second device identifier, determining to adjust the first key video frame; When the first device identifier is smaller than the second device identifier, it is determined that the first key video frame is not adjusted.

9. A video transmission device, characterized in that: include: an acquisition module, configured to acquire first parameter information of a first key video frame to be transmitted by a current shooting device, and second parameter information of a second key video frame to be transmitted by a reference shooting device associated with the current shooting device, wherein the current shooting device and the reference shooting device are located in the same communication network; a detection module, configured to perform collision detection on the first key video frame and the second key video frame using the first parameter information and the second parameter information; a determination module configured to determine a target idle time slot from an idle period of the current shooting device when a result of the collision detection indicates that a video frame collision occurs between the first key video frame and at least one of the second key video frames; an adjusting module, configured to adjust the first key video frame to the target idle time slot for transmission; The device is also used to obtain a first candidate time period in which the first key video frame is not transmitted within a first transmission cycle, and a second candidate time period in which the second key video frame is not transmitted within each second transmission cycle, wherein the first transmission cycle is a transmission period corresponding to the first picture group to which the first key video frame belongs, and the first transmission cycle and the second transmission cycle are the same cycle; the idle time period is determined based on the intersection result of the first candidate time period and the second candidate time period; and the target idle time slot is determined within the idle time period.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 8 when executed.

11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.

Citation Information

Patent Citations

  • Data transmission method based on multiple pieces of front-end video equipment and related device

    CN112399141A