Video transmission method and apparatus
By selecting the target device with the largest transmission bandwidth and adjusting the video frame quality, the problem of low video upload efficiency caused by insufficient transmission bandwidth of the base station is solved, and efficient video transmission is achieved.
Patent Information
- Application Number
- CN202111146772.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2041-09-28
AI Technical Summary
In the prior art, due to insufficient transmission bandwidth of the base station, the camera is inefficient in uploading videos, and the surveillance video cannot be transmitted in time.
By selecting the target device with the largest transmission bandwidth from multiple video recording devices, and when the transmission bandwidth of the target device is insufficient, some video frames are deleted to adjust the video quality, the video is transmitted using the remaining bandwidth of the target device.
It improves the efficiency of video upload, ensures timely transmission of important video frames, and solves the problem of low upload efficiency caused by insufficient transmission bandwidth.
Smart Images

Figure CN113891043B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular, to a video transmission method and apparatus. Background Art
[0002] In the prior art, during the process of a camera monitoring a certain area, the monitored video can be uploaded. However, since the base station serves users within the base station at the same time, when the camera uploads the video, the transmission bandwidth of the base station may not be sufficient. In the prior art, if the transmission bandwidth of the base station is not sufficient, the video captured by the camera needs to be saved and can only be uploaded when the transmission bandwidth of the base station is sufficient, resulting in low video upload efficiency.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of the present invention provide a video transmission method and apparatus to at least solve the technical problem of low upload efficiency caused by insufficient transmission bandwidth during video upload.
[0005] According to one aspect of the embodiments of the present invention, a video transmission method is provided, including: obtaining a first video recorded by a first video recording device, where the first video recording device is used to transmit the first video to a video monitoring platform; determining a first target device from a plurality of second video recording devices when a first remaining transmission bandwidth between the first video recording device and the video monitoring platform is not sufficient to transmit the first video, where a first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest; deleting first-level video frames in a second video recorded by the first target device and determining a second target remaining transmission bandwidth between the first target device and the video monitoring platform when the first target remaining transmission bandwidth between the first target device and the video monitoring platform is not sufficient to transmit the first video, where the second video at least includes the first-level video frames and second-level video frames; and transmitting the first video using the second target remaining transmission bandwidth when the second target remaining transmission bandwidth can transmit the first video.
[0006] According to another aspect of the embodiments of the present invention, there is also provided a video transmission device, including: an acquisition unit configured to acquire a first video recorded by a first video recording device, where the first video recording device is used to transmit the first video to a video monitoring platform; a first determination unit configured to determine a first target device from a plurality of second video recording devices when the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is not sufficient to transmit the first video, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest; a second determination unit configured to delete first-level video frames in a second video and determine the second target remaining transmission bandwidth between the first target device and the video monitoring platform when the first target remaining transmission bandwidth between the first target device and the video monitoring platform is not sufficient to transmit the first video, where the first video at least includes the first-level video frames and second-level video frames; a first transmission unit configured to transmit the first video using the second target remaining transmission bandwidth when the second target remaining transmission bandwidth is capable of transmitting the first video.
[0007] According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, where the computer program is configured to execute the above video transmission method when running.
[0008] According to still another aspect of the embodiments of the present invention, there is also provided an electronic device including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to execute the above video transmission method through the computer program.
[0009] In an embodiment of the present invention, a first video recorded by a first video recording device is obtained, where the first video recording device is used to transmit the first video to a video monitoring platform; in a case where the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is not sufficient to transmit the first video, a first target device is determined from a plurality of second video recording devices, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest; in a case where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is not sufficient to transmit the first video, first-level video frames in a second video recorded by the first target device are deleted, and a second target remaining transmission bandwidth between the first target device and the video monitoring platform is determined, where the second video at least includes the first-level video frames and second-level video frames; in a case where the second target remaining transmission bandwidth can transmit the first video, the first video is transmitted using the second target remaining transmission bandwidth. Since in the above method, when uploading the first video recorded by a video recording device, if the first transmission bandwidth of the first video recording device is insufficient, the first video can be transmitted by other video recording devices. And if the transmission bandwidth of other video recording devices is also insufficient, it can be uploaded to the video monitoring platform by other video recording devices. In addition, in a case where the transmission bandwidth of other video recording devices is also insufficient, some unimportant content in other video recording devices can also be deleted, thereby improving the video upload efficiency, and further solving the technical problem of low upload efficiency caused by insufficient transmission bandwidth during video upload. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:
[0011] Figure 1 is a schematic diagram of an application environment of an optional video transmission method according to an embodiment of the present invention;
[0012] Figure 2 is a schematic diagram of a process of an optional video transmission method according to an embodiment of the present invention;
[0013] Figure 3 is a schematic diagram of a monitoring system under normal circumstances of an optional video transmission method according to an embodiment of the present invention;
[0014] Figure 4 is a schematic diagram of a monitoring system in a case of crowd gathering of an optional video transmission method according to an embodiment of the present invention;
[0015] Figure 5 Schematic diagram of a surplus bandwidth feedback system for an optional video transmission method according to an embodiment of the present invention;
[0016] Figure 6 Schematic diagram of the applicant processing flow for an optional video transmission method according to an embodiment of the present invention;
[0017] Figure 7 Schematic diagram of the process for feeding back surplus bandwidth for an optional video transmission method according to an embodiment of the present invention;
[0018] Figure 8 Schematic diagram of the process for low-level video frames with step size for an optional video transmission method according to an embodiment of the present invention;
[0019] Figure 9 Schematic diagram of the structure of an optional video transmission device according to an embodiment of the present invention. Detailed implementation manners
[0020] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0022] According to one aspect of an embodiment of the present invention, a video transmission method is provided. Optionally, as an alternative implementation manner, the above video transmission method can be but is not limited to being applied to an environment such as Figure 1 shown.
[0023] Such as Figure 1As shown in steps S102 to S110, the first video recording device 102 includes a memory 104 for storing the first video recorded during the operation of the first video recording device 102, a processor 106 for uploading the first video, and a display 108 for displaying the first video. The first video recording device 102 can upload the first video by itself. If its own transmission bandwidth is insufficient, the first target device 110 can be used to upload the first video. If the transmission bandwidth of the first target device 110 is also insufficient, the first-level video frames of the second target device 112 can be deleted. Then, the second target device 112 is used to upload the first video to the video transmission platform 114.
[0024] Optionally, in this embodiment, the above-mentioned first video recording device may include a smart device or a camera equipped with a camera, and may include at least one of the following: a mobile phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a handheld computer, a MID (Mobile Internet Devices), a PAD, etc. The above is only an example, and this embodiment does not make any limitation thereto.
[0025] Optionally, as an alternative implementation, as Figure 2 shown, the above video transmission method includes:
[0026] S202, obtaining the first video recorded by the first video recording device, where the first video recording device is used to transmit the first video to the video monitoring platform;
[0027] S204, in the case where the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is insufficient to transmit the first video, determining a first target device from multiple second video recording devices, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest;
[0028] S206, in the case where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is insufficient to transmit the first video, deleting the first-level video frames in the second video recorded by the first target device, and determining the second target remaining transmission bandwidth between the first target device and the video monitoring platform, where the second video includes at least first-level video frames and second-level video frames;
[0029] S208, in the case where the second target remaining transmission bandwidth can transmit the first video, using the second target remaining transmission bandwidth to transmit the first video.
[0030] Optionally, in the embodiments of the present application, the above video transmission method may be, but is not limited to, applied to the process of a camera uploading a video through a video recording device. After the camera captures a video, the captured video can be uploaded by itself or through the program or hardware where it is located. If the remaining transmission bandwidth is insufficient during uploading, the camera can upload the video through other cameras. If the remaining transmission bandwidth of other cameras is also insufficient, a part of the video frames in the videos captured by other cameras can be deleted and saved in the memory, and then the transmission bandwidth obtained by the deletion can be used to upload the video frames of the video captured by the camera. When the remaining transmission bandwidth of other cameras is sufficient, the video frames deleted and saved in the memory are uploaded again.
[0031] Optionally, in this embodiment, when the camera uploads the first video to the video surveillance platform, it can be uploaded through a base station. Each camera can correspond to a base station, and each base station transmits the video captured by one camera. If the transmission bandwidth of a base station is insufficient, other base stations can be used to assist in transmitting the video captured by the camera corresponding to this base station.
[0032] Optionally, the first video recording device in the embodiments of the present application can be a camera or other devices including a camera.
[0033] Optionally, in the embodiments of the present application, the second-level video frames and the first-level video frames can be the video frames obtained by splitting the video frames in the first video. There are various splitting methods. For example, they can be split randomly, according to a ratio, according to importance, etc. Taking splitting according to importance as an example, the first video can be split into key frames such as key I frames and non-key frames, and the non-key frames can be further split to obtain key P frames and non-key P frames in the non-key frames. That is, the first video is split into key frames, non-key frame type I, and non-key frame type II. The key frames are key I frames, and the non-key frames include non-key frame type I, that is, key P frames, and non-key frame type II, that is, non-key P frames. The ratio of non-key frame type I and non-key frame type II in the non-key frames can be adjusted according to the actual situation. When uploading the first video, the video frames of non-key frame type II can be deleted.
[0034] Optionally, in the embodiments of the present application, taking the first video recording device as a camera as an example, it can include 1 camera. One camera is within the coverage of multiple base stations, or it can include multiple cameras, with each camera under the scope of one base station. Data interaction can be carried out between multiple cameras. If the remaining transmission bandwidth of the first base station for the first camera to transmit the first video is insufficient, other base stations of the first camera can be used to transmit the first video. Or the first video can be transmitted by the second base station corresponding to the second camera.
[0035] If the remaining transmission bandwidth of the second base station is also insufficient to transmit the first video, unimportant video frames in the video that the second base station originally intended to transmit are deleted. For example, video frames of non-critical frame type II in the second video that the second base station originally intended to transmit are deleted. Then, the video frames of the first video are transmitted by the second base station.
[0036] In this embodiment, the deleted video frames are saved in a memory for subsequent uploading.
[0037] Through the embodiments of the present application, a first video recorded by a first video recording device is obtained, where the first video recording device is used to transmit the first video to a video monitoring platform; in the case where the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is insufficient to transmit the first video, a first target device is determined from multiple second video recording devices, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest; in the case where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is insufficient to transmit the first video, first-level video frames in the second video recorded by the first target device are deleted, and a second target remaining transmission bandwidth between the first target device and the video monitoring platform is determined, where the second video includes at least first-level video frames and second-level video frames; in the case where the second target remaining transmission bandwidth can transmit the first video, the first video is transmitted using the second target remaining transmission bandwidth. Since in the above method, when uploading the first video recorded by a video recording device, if the first transmission bandwidth of the first video recording device is insufficient, the first video can be transmitted by other video recording devices. And if the transmission bandwidth of other video recording devices is also insufficient, it can be uploaded to the video monitoring platform by other video recording devices. In addition, in the case where the transmission bandwidth of other video recording devices is also insufficient, some unimportant content in other video recording devices can also be deleted, thereby improving the efficiency of video uploading.
[0038] As an optional example, the above method further includes:
[0039] S1. In the case where the second target remaining transmission bandwidth is insufficient to transmit the second-level video frames, a second target device is determined from multiple third video recording devices;
[0040] S2. In the case where the third target remaining transmission bandwidth between the third target device and the video monitoring platform can transmit the first video, the second-level video frames are transmitted using the third target remaining transmission bandwidth.
[0041] It should be noted that if the remaining transmission bandwidth of the second target is still insufficient to transmit the first video after deleting the unimportant video frames in the second video, another target device, i.e., the second target device, can be determined again, and the second target device can be processed in the same logical manner until the transmission of the first video is completed.
[0042] As an optional example, the above method further includes:
[0043] In the case where the remaining transmission bandwidth of the third target is insufficient to transmit the first video, save the first-level video frames and the second-level video frames to the memory; or
[0044] In the case where the remaining transmission bandwidth of the third target can transmit the second-level video frames, save the first-level video frames to the memory.
[0045] That is to say, if the first video cannot be uploaded after deleting the first-level video frames, save the first video to the memory and wait for subsequent upload. If the first video can be transmitted after deleting the first video frames, upload the first video and the second-level video frames, and save the first-level video frames to the memory.
[0046] As an optional example, after saving the first-level video frames and the second-level video frames to the memory, or after saving the first-level video frames to the memory, the method further includes:
[0047] S1. In the case where the first remaining transmission bandwidth can transmit the target video, use the first remaining transmission bandwidth to transmit the target video, and transmit the first-level video frames and the second-level video frames in the memory through the first remaining transmission bandwidth, where the target video is the video after the first video recorded by the first video recording device; or
[0048] S2. In the case where the first remaining transmission bandwidth can transmit the target video, use the first remaining transmission bandwidth to transmit the target video, and use the first remaining transmission bandwidth to transmit the first-level video frames in the memory, where the target video is the video after the first video recorded by the first video recording device.
[0049] That is to say, when the first-level video frames and the second-level video frames are saved to the memory or the first video frames are saved to the memory, if the remaining transmission bandwidth of the first base station is sufficient and can transmit the target video, that is, can transmit the video after the first video, then at this time, the first base station can upload the saved first-level video frames and the second-level video frames or the first-level video frames alone. That is, when the remaining transmission bandwidth of the first base station is sufficient, upload the video frames saved to the memory.
[0050] As an optional example, the above method further includes:
[0051] When the first target remaining transmission bandwidth can transmit the first video, use the first target remaining transmission bandwidth to transmit the first video.
[0052] If the remaining transmission bandwidth of the first target base station can transmit the first video, there is no need to delete the first-level video frames, and the first video can be directly transmitted.
[0053] As an optional example, when the first remaining transmission bandwidth between the first video recording device and the video surveillance platform is insufficient to transmit the first video, determining the first target device from multiple second video recording devices includes:
[0054] Obtain the current remaining transmission bandwidth of each second video recording device, where the current remaining transmission bandwidth is the remaining transmission bandwidth when the second video recording device transmits the currently recorded video;
[0055] Determine the second video recording device with the largest current remaining transmission bandwidth as the first target device.
[0056] Optionally, when determining the first target base station of the first target video recording device in the second base station used by the second video recording device, it is necessary to determine the remaining transmission bandwidth of each second base station. The remaining bandwidth of the second base station can be determined according to the users currently served by the second base station and the videos that need to be uploaded currently. The remaining transmission bandwidth of the second base station itself sent by the second base station can be received. Then, determine the base station with the largest remaining transmission bandwidth as the first target base station.
[0057] As an optional example, determining the second target device from multiple third video recording devices includes:
[0058] S1. Obtain the current remaining transmission bandwidth of each third video recording device, where the current remaining transmission bandwidth of the third video recording device is the remaining transmission bandwidth when the third video recording device transmits the currently recorded video;
[0059] S2. Determine the second video recording device with the largest current remaining transmission bandwidth of the third video recording device as the second target device.
[0060] Optionally, to determine the second target base station of the second target device in the second base station of the second video recording device, it is necessary to determine the remaining transmission bandwidth of each second base station. The remaining bandwidth of the second base station can be determined according to the users currently served by the second base station and the videos that need to be uploaded currently, so as to determine the remaining transmission bandwidth of the second base station. It is possible to receive the remaining transmission bandwidth of the second base station sent by the second base station itself. Then, the base station with the largest remaining transmission bandwidth is determined as the second target base station. During the process of determining the second target base station, the second base station can also but is not limited to performing an operation of deleting some video frames of the current video being transmitted by itself, so as to provide more remaining transmission bandwidth.
[0061] As an optional example, obtaining the current remaining transmission bandwidth of each third video recording device includes:
[0062] Determine each third video recording device as the current video recording device, and perform the following operations on the current video recording device:
[0063] Obtain the current video recorded by the current video recording device;
[0064] Delete the first-level video frames in the current video;
[0065] Have the current video recording device upload the second-level video frames in the current video to the video monitoring platform;
[0066] When the current video recording device uploads the second-level video frames, determine the remaining transmission bandwidth as the current remaining transmission bandwidth of the current video recording device.
[0067] A specific example is combined for illustration.
[0068] The monitoring system in a normal network environment is as follows Figure 3 As shown, the front-end devices (that is, cameras, namely the first video recording devices in this application) A, B, and C (other relay front-end devices are omitted between the front-end devices A, B, and C) are respectively connected to their respective adjacent base station access points, that is, Figure 3 Base stations 1 to 3 in. Normally, the front-end devices and ordinary users can share a base station resource for network access. The front-end devices A, B, and C respectively monitor the pedestrian flow in their respective areas, evaluate the risk level of the current monitoring area through the density of the pedestrian flow, and adjust the transmission level of the monitoring video frames according to the risk level to ensure that the high-quality monitoring video in the high-risk monitoring area is transmitted to the video monitoring platform. When the pedestrian flow density is greater and the risk of the monitoring area is higher, high-level video transmission is required, and the network resources for the monitoring video need to be prioritized. When the pedestrian flow density is smaller and the risk of the monitoring area is lower, low-level video transmission can be performed, and by actively discarding the low-level video frame transmission, some network resources are vacated for the use of other key monitoring area devices.
[0069] The level assignment of the monitoring area in this application takes the pedestrian flow density parameter as an example, but is not limited to this basis, and also includes vehicle flow density, occurrence of accident scenes, occurrence of natural disasters, etc. The greater the pedestrian flow, the higher the monitoring level. For example, in the event of natural disasters, accidents, etc., the monitoring level will be increased. The smaller the pedestrian flow, or in the absence of disasters, accidents, etc., the lower the monitoring level.
[0070] In Figure 4 a situation where there is a crowd gathering at Base Station 1. Due to the large number of people, the number of users using Base Station 1 is large, and the remaining transmission bandwidth of Base Station 1 is insufficient to supply the network transmission of the video recorded by front-end device A. At the same time, the area where Base Station 1 is located belongs to a high-risk monitoring area and requires sufficient bandwidth to transmit the current monitoring images. At this time, device A initiates a D2D networking through the device to device (abbreviated as D2D) technology and selects front-end device B under the monitoring platform from the D2D network. Front-end device A forwards and transmits the monitoring images encoded by front-end device A to the video monitoring platform through front-end device B. At the same time, device B evaluates whether to discard its own low-level video frames for transmission according to the risk level of its own monitoring area to ensure the bandwidth requirements of device A. Through this method, the robustness of the monitoring network in the 4G / 5G environment and the network transmission resources of key monitoring areas are guaranteed, the number of base station deployments is reduced, and the load balancing ability of the base stations is improved. When the crowd gathering at Base Station 1 disappears and the network capacity of the base station is restored, monitoring device A resumes its original state and continues to transmit monitoring images through Base Station 1, and compensates and transmits the low-level video frames cached in the local memory card to the video monitoring platform.
[0071] The video encoder identifies non-key frames in the video frames as key P frames and non-key P frames according to the set encoding type ratio. The encoding frame type ratio of each GOP (Group Of Picture, referring to the interval between two I frames) is shown in Table 1 below. Table 1 shows the relationship between the video frame level and the encoding GOP frame type ratio. Among them, the identification of key P frames and non-key P frames can be detected and marked in advance according to the pedestrian flow density or other intelligent detection events. The ratio of non-key frame types I and II output by encoding can be automatically adjusted according to the risk level of the monitoring area and the video frame transmission strategy.
[0072] Table 1
[0073] Video frame level Video frame type Proportion of each encoded GOP frame type High-level frame Key frame, such as I-frame One encoded output Medium-level frame Non-key frame type I, such as key P-frame Encoded output proportion a, such as 40% of non-key frames Low-level frame Non-key frame type II, such as non-key P-frame Encoded output proportion b, such as 60% of non-key frames
[0074] The total number of video frames F transmitted by each GOP of the monitoring device out satisfies the following relationship:
[0075] F out = 1 + a * N + (1 - δ) * b * N
[0076] Wherein, N represents the total number of non-key frames in a GOP, a represents the percentage of type-I non-key frames in a GOP, b represents the percentage of type-II non-key frames in a GOP, and δ represents the video frame transmission frame loss factor, satisfying 0 ≤ δ ≤ 1.
[0077] The relationship between the monitoring area level and the video frame transmission level is shown in Table 2 below. Table 2 shows the relationship between the monitoring area level and the video frame transmission level. The higher the monitoring area level, the higher the proportion of non-key frames transmitted, the better the video quality, and the greater the required network bandwidth. This solution is illustrated by taking three monitoring levels and three video frame transmission levels as examples.
[0078] Table 2
[0079] Monitoring area level Video frame transmission level Frame type encoded output proportion Picture quality and bandwidth occupancy High-risk monitoring area High (at least including medium-level frames) a = 80%, b = 20% High quality, large bandwidth occupancy Low-risk monitoring area Medium (at least including medium-level frames) a = 60%, b = 40% Medium quality, medium bandwidth occupancy Normal monitoring area Low (at least including medium-level frames) a = 40%, b = 60% Low quality, small bandwidth occupancy
[0080] In the feedback system of the remaining bandwidth, that is, the remaining transmission bandwidth, for the front-end monitoring devices with a demand for the remaining bandwidth, they are processed through the monitoring device remaining bandwidth feedback system of D2D networking, as follows Figure 5 shown. When the bandwidth for the front-end device A to access the base station is insufficient, it will obtain the IP, serial number, MAC address information, etc. of all front-end devices accessing the platform from the video monitoring platform. At the same time, the video monitoring platform authorizes device A to allow access through other front-end monitoring devices for forwarding. The front-end device B under the same video monitoring platform that best matches device A is searched out through the D2D network. Other monitoring devices C can also be matched. The following steps are illustrated by taking the negotiation between device A and device B as an example.
[0081] Device A (the applicant) initiates a request for remaining bandwidth from Device B (the feedback party), carrying its own monitoring area level, video frame transmission level, as well as information such as its own device IP, serial number, and MAC address for verification. If Device A does not carry authorization information, it requests verification authorization from the video monitoring platform through Device B to avoid the situation where Device A cannot obtain authorization from the video monitoring platform due to network anomalies in Base Station 1. After Device B obtains successful platform verification, it returns the remaining bandwidth evaluated by itself to Device A. The specific method for evaluating the remaining bandwidth of Device B is described later. The front-end Device A evaluates whether to forward the video through Device B based on the remaining bandwidth feedback by Device B. The specific method for how Device A selects the best device to forward the video is described later. Here, only the subsequent process of selecting Device B is described. If Device A forwards the video through Device B, Device A needs to notify Device B that video forwarding will be performed. If Device A detects that the network with the video monitoring platform has returned to normal, Device A resumes directly sending videos to the monitoring platform, notifies Device B to stop forwarding, and ends sending videos to Device B. At the same time, both Device A and Device B also resume their original video transmission states and compensate for the discarded low-level video frames uploaded from local storage.
[0082] For the remaining bandwidth applicant (such as Device A), when the peer device (other devices, there may be multiple) returns its remaining bandwidth, the applicant performs the following Figure 6 strategy for adjusting the remaining bandwidth and video frame transmission level. When the remaining bandwidth of a single forwarding device is sufficient, select one of them to forward and transmit all levels of video frames. When the remaining bandwidth of a single device is insufficient, the applicant sets the transmission frame loss factor to 1, actively discards the transmission of low-level frames, and selects one of the forwarding devices with matching remaining bandwidth to transmit high- and medium-level video frames. In addition, the applicant continuously detects the network status with the video monitoring platform. If the network resumes, it resumes directly transmitting videos to the video monitoring platform and notifies the forwarding device to stop forwarding and ends sending videos to the forwarding device. At the same time, when the monitoring device has a local memory card, the actively discarded low-level frames are cached in the local storage according to the video coding time and frame sequence number, and are compensated and sent to the video monitoring platform when the access network resumes normal, to avoid missing video recordings on the video monitoring platform.
[0083] For the remaining bandwidth feedback party (such as Device B), the strategy for adjusting the remaining bandwidth and video frame transmission level is as follows Figure 7As shown in the figure. The feedback party evaluates the appropriate remaining bandwidth based on its own remaining bandwidth, the current monitoring area level, and the monitoring area level of the device to be forwarded, and finally feeds back the appropriate remaining bandwidth to the requesting party. When the remaining bandwidth is insufficient and the current monitoring area level of the feedback party is lower than that of the applicant, the feedback party will evaluate the new remaining bandwidth after setting the frame loss factor to 1 (actively discarding the transmission of low-level frames), and allocate a part of the bandwidth to the devices in the high-risk monitoring area for video transmission. When the applicant notifies to forward the video, the feedback party will actually adjust the frame loss factor of the video frame transmission of its own monitoring device (if necessary). When the applicant notifies to stop forwarding the video, the feedback party will restore the original video transmission state. At the same time, when the monitoring device has a local memory card, the actively discarded low-level frames are cached in the local storage according to the video coding time and frame sequence number. When receiving the notification from the applicant to stop forwarding the video, the feedback party compensates and sends the actively discarded low-level frames to the video monitoring platform to avoid missing video recordings on the video monitoring platform.
[0084] The method for the video monitoring platform to receive and process the compensated transmission of low-level video frames is as follows Figure 8 As shown in the figure, where the frame sequence numbers are not equal in the same device.
[0085] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0086] According to another aspect of the embodiments of the present invention, there is also provided a video transmission device for implementing the above video transmission method. As Figure 9 shown in the figure, the device includes:
[0087] An acquisition unit 902, configured to acquire a first video recorded by a first video recording device, where the first video recording device is used to transmit the first video to the video monitoring platform;
[0088] A first determination unit 904, configured to determine a first target device from multiple second video recording devices when the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is insufficient to transmit the first video, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest;
[0089] A second determination unit 906, configured to delete first-level video frames in a second video and determine a second target remaining transmission bandwidth between the first target device and the video surveillance platform when the first target remaining transmission bandwidth between the first target device and the video surveillance platform is insufficient to transmit a first video, where the first video includes at least first-level video frames and second-level video frames;
[0090] A first transmission unit 908, configured to transmit the first video using the second target remaining transmission bandwidth when the second target remaining transmission bandwidth can transmit the first video.
[0091] Optionally, in the embodiments of the present application, the above video transmission device may be, but is not limited to, applied to the process of a camera uploading a video through a video recording device. After the camera captures a video, the captured video can be uploaded by itself or through the program or hardware where it is located. If the remaining transmission bandwidth is insufficient during uploading, the camera can upload the video through other cameras. If the remaining transmission bandwidth of other cameras is also insufficient, the camera can delete a part of the video frames in the captured video and save them in the memory, and then upload another part of the video frames. When the remaining transmission bandwidth of the camera is sufficient, the video frames deleted and saved in the memory are uploaded again.
[0092] Optionally, in this embodiment, when uploading the first video to the video surveillance platform, the camera can upload it through a base station. Each camera can correspond to a base station, and each base station transmits the video captured by one camera. If the transmission bandwidth of one base station is insufficient, other base stations can be used to assist in transmitting the video captured by the camera corresponding to this base station.
[0093] Optionally, the first video recording device in the embodiments of the present application may be a camera or other devices including a camera.
[0094] Optionally, in the embodiments of the present application, the second-level video frames and the first-level video frames may be video frames obtained by splitting the video frames in the first video. There are various splitting methods. For example, they can be split randomly, according to a ratio, according to importance, etc. Taking splitting according to importance as an example, the first video can be split into key frames such as key I frames and non-key frames, and the non-key frames can be further split into key P frames and non-key P frames in the non-key frames. That is, the first video is split into key frames, non-key frame type I, and non-key frame type II. The key frames are key I frames, and the non-key frames include non-key frame type I, that is, key P frames, and non-key frame type II, that is, non-key P frames. The ratio of non-key frame type I and non-key frame type II in the non-key frames can be adjusted according to the actual situation. When uploading the first video, the video frames of non-key frame type II can be deleted.
[0095] Optionally, in the embodiments of the present application, taking the first video recording device as a camera as an example, it may include 1 camera. One camera is within the coverage of multiple base stations, or it may include multiple cameras, with each camera within the range of one base station. Data interaction can be performed between multiple cameras. If the remaining transmission bandwidth of the first base station that the first camera transmits the first video to is insufficient, the first video can be transmitted using other base stations of the first camera. Or the first video can be transmitted by the second base station corresponding to the second camera.
[0096] If the remaining transmission bandwidth of the second base station is also insufficient to transmit the first video, unimportant video frames in the video that the second base station originally wanted to transmit are deleted. For example, video frames of non-critical frame type II in the second video that the second base station originally wanted to transmit. Then the second base station transmits the video frames of the first video.
[0097] The video frames deleted in this embodiment are saved in the memory for subsequent upload. For other examples of this embodiment, please refer to the above examples and will not be elaborated here.
[0098] According to another aspect of the embodiments of the present invention, an electronic device for implementing the above video transmission method is further provided. The electronic device may be a terminal device or a server. The electronic device includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to execute the steps in any of the above method embodiments by running the computer program.
[0099] In other embodiments, the above terminal device or server may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication. Among them, the nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as electronic devices like servers and terminals, can become a node in the blockchain system by joining the peer-to-peer network.
[0100] According to yet another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium, and when the computer program is run by the processor, it executes the steps in any of the above method embodiments.
[0101] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing the relevant hardware of the terminal device. The program can be stored in a computer-readable storage medium, and the storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, etc.
[0102] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0103] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0104] In the above embodiments of the present invention, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0105] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0106] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, in each embodiment of the present invention, each functional unit can be integrated into a processing unit, can exist separately as individual physical units, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0108] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A video transmission method, characterized in that, Including: Obtain a first video recorded by a first video recording device, where the first video recording device is used to transmit the first video to a video monitoring platform; In the case where the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is not sufficient to transmit the first video, determine a first target device from multiple second video recording devices, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest; In the case where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is not sufficient to transmit the first video, delete first-level video frames in a second video recorded by the first target device and save the first-level video frames to a memory of the first target device, and determine a second target remaining transmission bandwidth between the first target device and the video monitoring platform, where the second video at least includes the first-level video frames and second-level video frames; In the case where the second target remaining transmission bandwidth can transmit the first video, use the second target remaining transmission bandwidth to transmit the first video; Wherein, a set of video frames recorded by a video recording device satisfies the following relationship: ; Where N represents the total number of non-key frames in the set of video frames, a represents the percentage of the second-level video frames in the set of video frames, and b represents the percentage of the first-level video frames in the set of video frames. represents the video frame transmission frame loss factor and satisfies , the higher the percentage of the second-level video frames in the set of video frames, the greater the bandwidth occupied for transmitting the set of video frames. The percentages of the first-level video frames and the second-level video frames are adjusted according to the risk level of the monitoring area of the video recording device. The greater the number of people in the monitoring area, the higher the risk level. The set of video frames includes one key frame and multiple non-key frames. The video recording device includes the first video recording device, the first target device, and the second target device. Different video recording devices are connected to different base stations.
2. The method according to claim 1, characterized in that, The method further includes: In the case where the second target remaining transmission bandwidth is not sufficient to transmit the first video, determine a second target device from multiple third video recording devices; In the case where a third target remaining transmission bandwidth between the second target device and the video monitoring platform can transmit the second-level video frames, use the third target remaining transmission bandwidth to transmit the second-level video frames.
3. The method according to claim 1, characterized in that, The method further includes: In the case where the first target remaining transmission bandwidth can transmit the first video, use the first target remaining transmission bandwidth to transmit the first video.
4. The method according to claim 1, wherein The step of determining a first target device from multiple second video recording devices in the case where the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is not sufficient to transmit the first video includes: Obtain the current remaining transmission bandwidth of each of the second video recording devices, where the current remaining transmission bandwidth is the remaining transmission bandwidth when the second video recording device transmits the currently recorded video; Determine the second video recording device with the largest current remaining transmission bandwidth as the first target device.
5. The method according to claim 1, wherein The step of determining a second target device from multiple third video recording devices includes: Obtain the current remaining transmission bandwidth of each of the third video recording devices, where the current remaining transmission bandwidth of the third video recording device is the remaining transmission bandwidth when the third video recording device transmits the currently recorded video; Determine the second video recording device with the largest current remaining transmission bandwidth of the third video recording devices as the second target device.
6. The method according to claim 5, characterized in that, The step of obtaining the current remaining transmission bandwidth of each of the third video recording devices includes: Determine each of the third video recording devices as the current video recording device, and perform the following operations on the current video recording device: Obtain the current video recorded by the current video recording device; Delete the first-level video frames in the current video; Upload the second-level video frames in the current video to the video monitoring platform by the current video recording device; Determine the remaining transmission bandwidth when the current video recording device uploads the second-level video frames as the current remaining transmission bandwidth of the current video recording device.
7. A video transmission device, characterized in that, Comprising: An obtaining unit, configured to obtain a first video recorded by a first video recording device, where the first video recording device is used to transmit the first video to a video monitoring platform; A first determining unit, configured to determine a first target device from multiple second video recording devices when the first remaining transmission bandwidth between the first video recording device and the video monitoring platform is not sufficient to transmit the first video, where the first target remaining transmission bandwidth between the first target device and the video monitoring platform is the largest; A second determining unit, configured to, when the first target remaining transmission bandwidth between the first target device and the video monitoring platform is not sufficient to transmit the first video, delete the first-level video frames in the second video and save the first-level video frames to the memory of the first target device, and determine the second target remaining transmission bandwidth between the first target device and the video monitoring platform, where the first video at least includes the first-level video frames and the second-level video frames; A first transmission unit, configured to transmit the first video using the second target remaining transmission bandwidth when the second target remaining transmission bandwidth can transmit the first video; Wherein, a set of video frames recorded by a video recording device satisfies the following relationship: ; Wherein, N represents the total number of non-key frames in the set of video frames, a represents the percentage of the second-level video frames in the set of video frames, and b represents the percentage of the first-level video frames in the set of video frames. represents the video frame transmission frame loss factor and satisfies , the higher the percentage of the second-level video frames in the set of video frames, the greater the bandwidth occupied for transmitting the set of video frames. The percentages of the first-level video frames and the second-level video frames are adjusted according to the risk level of the monitoring area of the video recording device. The greater the number of people in the monitoring area, the higher the risk level. The set of video frames includes one key frame and multiple non-key frames. The video recording device includes the first video recording device, the first target device, and the second target device. Different video recording devices are connected to different base stations.
8. The device according to claim 7, characterized in that, The apparatus further includes: A third determining unit, configured to determine a second target device from multiple third video recording devices when the second target remaining transmission bandwidth is not sufficient to transmit the first video; A second transmission unit, configured to transmit the second-level video frames using the third target remaining transmission bandwidth when the third target remaining transmission bandwidth between the second target device and the video monitoring platform can transmit the second-level video frames.
Citation Information
Patent Citations
Negotiation transmission method based on video layering, electronic equipment and storage medium
CN112055177A