Video transmission method, device, equipment and computer program product
By detecting and analyzing the I-frame collision situation when multiple cameras transmit videos, and performing I-frame timing adjustments, the problems of high peak rate, increased delay and lag of video streams of multiple cameras are solved, and the effect of reducing network bandwidth requirements is achieved.
Patent Information
- Application Number
- CN202110816052.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-19
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-07-19
AI Technical Summary
As the number of cameras under a cell or base station increases, when multiple cameras transmit videos at the same time, the I-frame density transmitted by the network increases, resulting in a sharp increase in the probability of I-frame collisions, causing problems such as increasing latency, lag and screen loss of video streams.
By detecting the video stream rate information when multiple cameras transmit videos at the same time under a single cell, if an I-frame collision behavior is detected, collision analysis is performed, the camera identification information and collision time information of an I-frame collision occurred, and the multiple cameras are adjusted in I-frame timing to avoid collisions.
It effectively avoids the I-frame collision behavior of video transmission, reduces the peak rate of video streams, thereby reducing network transmission bandwidth requirements, and reducing video delay and lag problems.
Smart Images

Figure CN115643366B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video technology, and in particular to a video transmission method, device, equipment and computer program product. Background Art
[0002] With the rapid development of communication network technology, in order to meet the needs of industry customers, multiple cameras are usually deployed in an area, that is, multiple cameras are deployed in a cellular cell or a base station. For example, multiple cameras are deployed in a property in a residential area, and the video return addresses of multiple cameras are usually the same. As the number of cameras in a cellular cell or a base station increases, multiple cameras transmit videos at the same time, resulting in an increase in the density of I frames (IntraCoded Pictures) transmitted over the network, which in turn leads to a sharp increase in the probability of I frame collisions, resulting in a higher peak rate of the video stream, causing problems such as increased video delay, freezes, and screen distortion. Therefore, how to avoid I frame collisions to reduce the peak rate of multi-camera video streams is an issue that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the present invention is to provide a video transmission method, apparatus, device and computer program product, aiming to avoid I frame collision behavior in video transmission, so as to reduce the peak rate of video stream and thus reduce the network transmission bandwidth requirement.
[0004] To achieve the above object, the present invention provides a video transmission method, which comprises the following steps:
[0005] When it is detected that multiple cameras in a single cell transmit videos at the same time, obtaining rate information of the video stream sent by the single cell;
[0006] If a key frame I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain camera identification information and collision time information of the I frame collision;
[0007] Based on the camera identification information and the collision time information, I frame timing adjustment is performed on the multiple cameras.
[0008] Optionally, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, the several measurement periods correspond to the several measurement rates one by one, and when it is detected that multiple cameras in a single cell simultaneously transmit videos, after the step of obtaining the rate information of the video stream sent by the single cell, it also includes:
[0009] Dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios;
[0010] If at least one of the several rate ratios is greater than a preset threshold, it is determined that an I frame collision behavior exists;
[0011] If the plurality of rate ratios are all less than or equal to a preset threshold, it is determined that there is no I frame collision behavior.
[0012] Optionally, the rate information includes a peak rate and an average rate within a statistical period, and the step of performing collision analysis based on the rate information to obtain camera identification information where an I-frame collision occurs includes:
[0013] Determine the time when the peak rate is generated, and obtain multiple bandwidth rates of the multiple cameras at the time when the peak rate is generated;
[0014] The multiple bandwidth rates are compared with the average rate respectively, a number of cameras whose bandwidth rates are greater than the average rate are determined, and camera identification information of the several cameras is obtained, where the several cameras are cameras where I frame collision occurs in video transmission.
[0015] Optionally, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, the several measurement periods correspond to the several measurement rates one by one, and the step of performing collision analysis based on the rate information to obtain collision time information of an I frame collision includes:
[0016] Dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios;
[0017] Comparing the plurality of rate ratios with preset thresholds respectively, and determining a plurality of measurement moments at which the rate ratios are greater than the preset thresholds;
[0018] Based on the several measurement moments, collision time information of the occurrence of the I frame collision is obtained.
[0019] Optionally, the video transmission method is applied to an edge computing MEC platform, and the step of adjusting the I frame timing of the multiple cameras based on the camera identification information and the collision time information includes:
[0020] The camera identification information and the collision time information are sent to the video platform, so that the video platform can adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0021] Optionally, the video transmission method further includes:
[0022] Acquiring cell information of the single cell;
[0023] The cell information is sent to the video platform so that the video platform can determine the access locations of the multiple cameras based on the cell information.
[0024] Optionally, before the step of acquiring rate information of the video stream sent by the single cell when it is detected that multiple cameras in a single cell transmit videos at the same time, the step further includes:
[0025] Determine the video service of the same return address, and obtain the camera tag information and cell information of the video service;
[0026] A corresponding single cell is determined based on the cell information, and whether multiple cameras simultaneously transmit videos in the single cell is determined based on the camera tag information.
[0027] In addition, to achieve the above object, the present invention further provides a video transmission device, the video transmission device comprising:
[0028] An acquisition module, used for acquiring rate information of a video stream sent by a single cell when it is detected that multiple cameras in a single cell transmit videos at the same time;
[0029] An analysis module, configured to perform a collision analysis based on the rate information to obtain camera identification information and collision time information of the camera where the I-frame collision occurs, if a key frame I-frame collision behavior is detected based on the rate information;
[0030] An adjustment module is used to adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a video transmission device, which includes: a memory, a processor, and a video transmission program stored in the memory and executable on the processor, and the video transmission program, when executed by the processor, implements the steps of the video transmission method described above.
[0032] In addition, to achieve the above object, the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the video transmission method described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a video transmission program is stored, and when the video transmission program is executed by a processor, the steps of the video transmission method described above are implemented.
[0034] The present invention provides a video transmission method, device, equipment and computer program product. When it is detected that multiple cameras in a single cell transmit videos at the same time, the rate information of the video stream sent by the single cell is obtained; if the I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain the camera identification information and collision time information of the I frame collision; based on the camera identification information and the collision time information, the I frame timing of the multiple cameras is adjusted. In the above manner, the video stream is analyzed to detect whether there is an I frame collision behavior between the multiple cameras. If there is an I frame collision behavior, the I frame timing of the camera corresponding to the camera identification information is adjusted to avoid the I frame collision behavior of the video transmission, thereby reducing the peak rate of the video stream, and further reducing the network transmission bandwidth demand. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a flow chart of a first embodiment of a video transmission method of the present invention;
[0037] Figure 3 A schematic diagram of a video stream involved in an embodiment of the present invention;
[0038] Figure 4 A schematic diagram of rate calculation involved in an embodiment of the present invention;
[0039] Figure 5 A schematic diagram of a flow chart of a second embodiment of a video transmission method of the present invention;
[0040] Figure 6 FIG. 4 is a flow chart of a third embodiment of a video transmission method according to the present invention.
[0041] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0043] The main solution of the embodiment of the present invention is: when it is detected that multiple cameras in a single cell are transmitting videos at the same time, the rate information of the video stream sent by the single cell is obtained; if an I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain the camera identification information and collision time information of the I frame collision; based on the camera identification information and the collision time information, the I frame timing of the multiple cameras is adjusted. In the above manner, the video stream is analyzed to detect whether there is an I frame collision behavior between multiple cameras. If there is an I frame collision behavior, the I frame timing of the camera corresponding to the camera identification information is adjusted to avoid the I frame collision behavior of the video transmission, thereby reducing the peak rate of the video stream, and further reducing the network transmission bandwidth requirements.
[0044] It should be noted that by reducing the demand for network transmission bandwidth, the operator's network construction and optimization costs can be reduced, thereby improving the video service carrying capacity under the unit wireless network bandwidth, and then reducing the customer's demand for purchasing dedicated line bandwidth, thereby improving customer experience and promoting better development of the industry's video business.
[0045] In addition, it should be noted that after I-frame collision avoidance is performed on multiple cameras in each cell, since the video return addresses of each cell are usually different, I-frame collision avoidance between cells can also be performed. Based on this, even if a base station includes multiple cells, I-frame collision avoidance can be performed on the base station.
[0046] Technical terms involved in the embodiments of the present invention:
[0047] Video streams are composed of a series of coded frames, including I-frames, P-frames, and B-frames. I-frames are key frames, which means that a frame is completely preserved. P-frames and B-frames are compressed based on I-frames, and only contain the difference data between the previous and next frames. A GOP of a video stream includes an I-frame and several P-frames. The data volume of I-frames and P-frames may differ by dozens of times. Therefore, when multiple cameras transmit I-frames at the same time, I-frame collisions will cause the transmission bandwidth requirements to overlap.
[0048] I-frame, also known as ICP (Intra Coded Pictures), is a key frame, an independent frame with all information, which can be decoded independently without referring to other images. It can be simply understood as a static picture. The first frame in a video sequence is always an I-frame. Each video stream group of pictures GOP (Group of Pictures) starts with an I-frame and ends with the next I-frame.
[0049] P frame, also known as PCP (Predictive Coded Pictures), is an image generated by motion compensation prediction based on the most recent I picture or P picture.
[0050] MEC (Multi-access Edge Computing) edge computing provides connection and computing services at the edge of the 5G network, bringing new features such as ultra-low latency, ultra-large bandwidth and ultra-high security, making it possible to develop industry video services under mobile networks. MEC is a technology based on the architecture of 5G evolution and deeply integrates mobile access networks with Internet services. It sinks computing and processing capabilities to the edge closest to the business. On the one hand, MEC can improve user experience, save bandwidth resources, reduce congestion and burden on core networks and transmission networks, alleviate network bandwidth pressure, and achieve low latency. On the other hand, by sinking computing power to mobile edge nodes and providing third-party application integration, it provides unlimited possibilities for service innovation at the mobile edge entrance, and can quickly respond to user requests and improve service quality.
[0051] A cell, also known as a cellular cell, refers to an area covered by a base station or a part of a base station (sector antenna) in a cellular mobile communication system, within which a mobile terminal can communicate reliably with the base station through a wireless channel.
[0052] DPI (Deep Packet Inspection) technology adds application protocol identification, packet content detection and deep decoding of application layer data on top of traditional IP packet detection technology (detection and analysis of packet elements contained between OSI L2-L4). By capturing the original data packets of network communications, DPI technology can use three types of detection methods: feature value detection based on application data, identification detection based on application layer protocols, and data detection based on behavior patterns. According to different detection methods, the data that may be contained in the communication data packet is unpacked and analyzed one by one, and subtle data changes in the macro data stream are deeply excavated.
[0053] IMSI (International Mobile Subscriber Identity) is an international mobile subscriber identification code used to distinguish different users in a cellular network. It is a unique identification code that is not repeated in all cellular networks.
[0054] The embodiments of the present invention take into account that in existing related solutions, I frame avoidance is usually achieved through the camera's own mechanism, that is, when the camera is powered on or the video monitoring platform pulls the video stream from the camera, the camera randomly generates the timing of I frame generation to avoid all cameras transmitting I frames at the same time. However, for scenarios such as industrial generation, when multiple cameras are densely deployed, the uplink bandwidth is still a bottleneck compared to the fixed network. It is impossible to adjust the I frame timing of cameras that already have I frame collision behavior during video transmission.
[0055] Among them, the existing technical solution to avoid video I-frame collision only relies on random access on the terminal side to reduce the probability, and there are still many problems under the 5G network. The main problems include two aspects: first, I-frame collision is a high-frequency problem; second, I-frame collision brings a significant increase in the network peak transmission bandwidth, that is, when the number of cameras is certain, the average bandwidth is basically stable, but I-frame collision causes a linear increase in peak bandwidth.
[0056] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.
[0057] The terminal in the embodiment of the present invention is a video transmission device, which can be a terminal device with processing function such as a PC (personal computer), a microcomputer, a notebook computer, a server, etc.
[0058] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0059] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0060] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a video transmission program.
[0061] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the video transmission program stored in the memory 1005 and perform the following operations:
[0062] When it is detected that multiple cameras in a single cell transmit videos at the same time, obtaining rate information of the video stream sent by the single cell;
[0063] If a key frame I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain camera identification information and collision time information of the I frame collision;
[0064] Based on the camera identification information and the collision time information, I frame timing adjustment is performed on the multiple cameras.
[0065] Further, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, the several measurement periods correspond one to one with the several measurement rates, and the processor 1001 can be used to call the video transmission program stored in the memory 1005, and further perform the following operations:
[0066] Dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios;
[0067] If at least one of the several rate ratios is greater than a preset threshold, it is determined that an I frame collision behavior exists;
[0068] If the plurality of rate ratios are all less than or equal to a preset threshold, it is determined that there is no I frame collision behavior.
[0069] Further, the rate information includes a peak rate and an average rate within a statistical period. The processor 1001 can be used to call the video transmission program stored in the memory 1005, and further perform the following operations:
[0070] Determine the time when the peak rate is generated, and obtain multiple bandwidth rates of the multiple cameras at the time when the peak rate is generated;
[0071] The multiple bandwidth rates are compared with the average rate respectively, a number of cameras whose bandwidth rates are greater than the average rate are determined, and camera identification information of the several cameras is obtained, where the several cameras are cameras where I frame collision occurs in video transmission.
[0072] Further, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, the several measurement periods correspond one to one with the several measurement rates, and the processor 1001 can be used to call the video transmission program stored in the memory 1005, and further perform the following operations:
[0073] Dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios;
[0074] Comparing the plurality of rate ratios with preset thresholds respectively, and determining a plurality of measurement moments at which the rate ratios are greater than the preset thresholds;
[0075] Based on the several measurement moments, collision time information of the occurrence of the I frame collision is obtained.
[0076] Further, the processor 1001 may be used to call the video transmission program stored in the memory 1005, and further perform the following operations:
[0077] The camera identification information and the collision time information are sent to the video platform, so that the video platform can adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0078] Further, the processor 1001 may be used to call the video transmission program stored in the memory 1005, and further perform the following operations:
[0079] Acquiring cell information of the single cell;
[0080] The cell information is sent to the video platform so that the video platform can determine the access locations of the multiple cameras based on the cell information.
[0081] Further, the processor 1001 may be used to call the video transmission program stored in the memory 1005, and further perform the following operations:
[0082] Determine the video service of the same return address, and obtain the camera tag information and cell information of the video service;
[0083] A corresponding single cell is determined based on the cell information, and whether multiple cameras simultaneously transmit videos in the single cell is determined based on the camera tag information.
[0084] Based on the above hardware structure, various embodiments of the video transmission method of the present invention are proposed.
[0085] The invention provides a video transmission method.
[0086] Reference Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a video transmission method according to the present invention.
[0087] In this embodiment, the video transmission method includes:
[0088] Step S10, when it is detected that multiple cameras in a single cell transmit videos at the same time, obtaining rate information of the video stream sent by the single cell;
[0089] In this embodiment, the video transmission method can be applied to a video transmission device, which can be a terminal device with processing functions such as a PC (personal computer), a microcomputer, a laptop computer, a server, etc. The video transmission method can also be applied to a MEC (Multi-access Edge Computing) platform, which can be a 5G edge computing platform, so as to perform collision detection and avoidance on I frames in the process of camera video backhaul in a 5G network scenario through the 5G edge computing platform. It can also be applied to a video transmission system composed of the MEC platform and other terminal devices (such as a video platform and a camera, etc.), which is subordinate to the above-mentioned Figure 1 In this embodiment, the MEC platform is used as an example for explanation.
[0090] In one embodiment, before the above step S10, the video transmission method further includes:
[0091] The transmission traffic of the video platform is obtained; the transmission traffic is analyzed by deep packet inspection (DPI) to obtain characteristic data of the transmission traffic, so as to perform I-frame collision detection and I-frame collision avoidance based on the characteristic data. The video platform is a platform for managing cameras, which is used to display, store and analyze videos.
[0092] The format of the transmission traffic can be pre-set. Specifically, the transmission traffic can be set by mirroring or subscribing to the video on the MEC platform. Among them, the characteristic data may include at least one of the following: user identification, service identification, network type, access location, traffic, duration, rate, etc. The user identification includes at least one of the following: number, IMSI (International Mobile Subscriber Identity), client IP, etc. The service identification includes at least one of the following: URL (uniform resource locator), destination IP, destination port number, etc. The network type includes at least RAT (Radio Access Technology). The access location includes at least one of the following: TAC (Terminal Access Controller), CI (Cell Identity), etc. The traffic includes at least one of the following: single stream byte count, single application cumulative byte count, single rate cumulative byte count, etc. The duration includes at least one of the following: stream start time, stream end time, stream duration. The rate includes at least one of the following: uplink average, downlink average, uplink maximum, downlink maximum, etc.
[0093] In this embodiment, when it is detected that multiple cameras in a single cell transmit videos at the same time, the rate information of the video stream sent by the single cell is obtained. The single cell refers to a single cell, which is a cellular cell. When multiple cameras in a cell transmit videos wirelessly at the same time, I frame collision may occur.
[0094] It should be noted that the video stream sent by a single cell is the video stream after the various code streams of the multiple cameras are superimposed. For details, please refer to Figure 3 , Figure 3 Schematic diagram of video stream involved in the embodiment of the present invention. The number of multiple cameras is N. The code streams of each camera of the multiple cameras are superimposed to obtain the peak code stream superposition of the cameras in the same cell. At this time, the video stream sent by a single cell is as shown in FIG. Figure 3 As shown, the peak rate of its video stream exceeds the uplink peak rate of the cell, that is, an I frame collision occurs.
[0095] Among them, the rate information includes the average rate, the measurement rate, the peak rate, etc. Specifically, the video stream can be divided into several statistical periods, and one statistical period includes several measurement periods. One statistical period can be set to 1 second, and one measurement period can be set to 20 milliseconds, then one statistical period includes 50 measurement periods. Of course, the measurement period and the statistical period can be set to other values according to actual needs. For example, the measurement period is less than or equal to 20 milliseconds, so as to ensure that the I frame of the mainstream video transmission scene of 50 frames / second or less can be accurately identified in each statistical period. One measurement period corresponds to one measurement rate, and the calculation formula of the measurement rate is as follows:
[0096] Measurement rate = number of bytes in the measurement period / measurement period;
[0097] Specifically, refer to Figure 4 , Figure 4 This is a schematic diagram of rate calculation involved in an embodiment of the present invention. Calculating an instantaneous rate based on the number of bytes in a measurement period is to calculate the measurement rate, wherein a data packet may include multiple bytes, for example, a data packet includes 1400 bytes.
[0098] In one embodiment, the average rate may be the average rate in a statistical period, that is, the average rate is the average of several measured rates in a statistical period. The peak rate may be the peak rate in a statistical period, that is, the maximum measured rate in a statistical period.
[0099] Furthermore, before the above step S10, the video transmission method further includes:
[0100] Step A40, determining the video service of the same return address, and obtaining the camera tag information and cell information of the video service;
[0101] First, determine the video services with the same return address, and obtain the camera tag information and cell information for the video services. Specifically, obtain the return address sent by the video platform, determine the video services that need to perform I-frame collision detection based on the return address, and then determine the video services with the same return address from the video services that need to perform I-frame collision detection, and obtain the camera identification information and cell information for the video services.
[0102] The return address includes at least one of the following: the destination IP address or URL, etc. The camera tag information includes at least one of the following: the terminal IP, number, IMSI, etc. of the camera. The camera tag information may include one tag information or multiple tag information. It can be understood that if the camera tag information includes one tag information, it means that there are no multiple cameras transmitting videos at the same time in a single cell, and if the camera tag information includes multiple tag information, it means that there are multiple cameras transmitting videos at the same time in a single cell. The cell information includes at least one of the following: TAC, CI.
[0103] It should be noted that the camera that performs the video service is the currently started camera and is transmitting the video to the camera at the transmission address. That is to say, further detecting multiple cameras that perform the same video service in the community, compared with detecting all cameras in the community, because the probability of I frame collision at the same transmission address is higher, and the probability of I frame collision at different transmission addresses is lower, so the multiple cameras that perform the same video service can detect I frame collision behavior more accurately.
[0104] Step A50, determining a corresponding single cell based on the cell information, and determining whether there are multiple cameras transmitting videos simultaneously in the single cell based on the camera tag information.
[0105] Then, the corresponding single cell is determined based on the cell information, and whether there are multiple cameras transmitting videos simultaneously in the single cell is determined based on the camera tag information. Specifically, the corresponding single cell is determined based on the cell information, so as to collect statistics on whether there are multiple cameras transmitting videos simultaneously according to the cell aggregation, that is, the number of cameras is determined based on the camera tag information, so as to determine whether there are multiple cameras transmitting videos simultaneously based on the number of cameras.
[0106] In one embodiment, the step of determining whether there are multiple cameras transmitting videos simultaneously in the single cell based on the camera tag information includes:
[0107] The number of cameras is determined based on the camera tag information; if the number of cameras is greater than a preset number threshold, it is determined that multiple cameras are transmitting videos simultaneously in the single cell; if the number of cameras is less than or equal to the preset number threshold, it is determined that multiple cameras are not transmitting videos simultaneously in the single cell. The preset number threshold can be set according to actual needs, such as 1 or 2.
[0108] In another embodiment, the step of determining whether there are multiple cameras transmitting videos simultaneously in the single cell based on the camera tag information includes:
[0109] The number of cameras is determined based on the camera tag information; if the number of cameras is greater than 1, it is determined that there are multiple cameras transmitting video simultaneously in the single cell; if the number of cameras is 1 or 0, it is determined that there are no multiple cameras transmitting video simultaneously in the single cell.
[0110] In some embodiments, when it is detected that multiple cameras in a single cell are transmitting videos at the same time, the cell information and the camera tag information are recorded, so that the cell information and the camera tag information (which may also be the camera identification information) can be directly obtained for subsequent I frame collision detection and I frame collision avoidance. For example, the cell can record the CI number, and the camera can record the terminal IP address.
[0111] Step S20, if a key frame I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain camera identification information and collision time information of the I frame collision;
[0112] In this embodiment, if a key frame I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain the camera identification information and collision time information of the I frame collision. Specifically, the rate information includes a peak rate, an average rate, and a measurement rate. Based on the measurement rate and the average rate, the collision time information of the I frame collision is determined; based on the peak rate and the measurement rate, the camera identification information of the I frame collision is determined. The average rate is the average of several measurement rates. The peak rate is the maximum measurement rate.
[0113] It should be noted that the calculation formula of the measurement rate is as follows:
[0114] Measurement rate = number of bytes in the measurement period / measurement period;
[0115] Specifically, refer to Figure 4 Calculating the instantaneous rate once based on the number of bytes in the measurement period is to calculate the measurement rate, wherein a data packet may include multiple bytes, for example, a data packet includes 1400 bytes.
[0116] The camera identification information at least includes: the terminal IP, number, IMSI, etc. of the camera. The collision time information includes several measurement moments when the I-frame collision occurs.
[0117] In one embodiment, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, and the several measurement periods correspond to the several measurement rates one by one. After the above step S10, the video transmission method further includes:
[0118] Step A60, dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios;
[0119] Step A70, if at least one of the plurality of rate ratios is greater than a preset threshold, it is determined that an I frame collision behavior exists;
[0120] Step A80: If the plurality of rate ratios are all less than or equal to a preset threshold, it is determined that there is no I frame collision behavior.
[0121] In this embodiment, a plurality of measured rates are divided by the average rate to obtain a plurality of rate ratios, and then the plurality of rate ratios are compared with a preset threshold value. If at least one of the plurality of rate ratios is greater than the preset threshold value, it is determined that an I-frame collision behavior exists; if the plurality of rate ratios are less than or equal to the preset threshold value, it is determined that an I-frame collision behavior does not exist. The preset threshold value can be set according to actual needs, such as 1.5, and is not limited here.
[0122] It should be noted that the video stream can be divided into several statistical cycles, and one statistical cycle includes several measurement cycles. One statistical cycle can be set to 1 second, and one measurement cycle can be set to 20 milliseconds, then one statistical cycle includes 50 measurement cycles. Of course, the measurement cycle and the statistical cycle can be set to other values according to actual needs. For example, the measurement cycle is less than or equal to 20 milliseconds, so as to ensure that the I frame of the mainstream video transmission scene of 50 frames / second or less can be accurately identified in each statistical cycle. One measurement cycle corresponds to a measurement rate, and the calculation formula of the measurement rate is as follows:
[0123] Measurement rate = number of bytes in the measurement period / measurement period;
[0124] Specifically, refer to Figure 4 Calculating the instantaneous rate once based on the number of bytes in the measurement period is to calculate the measurement rate, wherein a data packet may include multiple bytes, for example, a data packet includes 1400 bytes.
[0125] In one embodiment, the average rate may be the average rate in a statistical period, that is, the average rate is the average of several measured rates in a statistical period. The peak rate may be the peak rate in a statistical period, that is, the maximum measured rate in a statistical period.
[0126] In a specific embodiment, after the above step A70, the video transmission method further includes:
[0127] A number of measurement moments at which I frame collision behaviors occur are determined, so as to obtain collision time information at which the I frame collision occurs based on the number of measurement moments.
[0128] In another embodiment, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, and the several measurement periods correspond one to one with the several measurement rates. After the above step S10, the video transmission method further includes:
[0129] The several measured rates are compared with the average rate to obtain comparison results; and whether there is I frame collision behavior is determined based on the comparison results. It can be understood that comparing the several measured rates with the average rate can be the comparison method described in the previous embodiment, or can be a comparison method of other calculation methods, and the principles are basically the same, which will not be described one by one here.
[0130] Step S30: Based on the camera identification information and the collision time information, I frame timing adjustment is performed on the multiple cameras.
[0131] In this embodiment, I frame timing adjustment is performed on multiple cameras based on camera identification information and collision time information. Specifically, the camera that needs to perform I frame timing adjustment (i.e., the camera where I frame collision occurs) among multiple cameras is determined based on camera identification information, and then I frame timing adjustment is performed on the camera that needs to perform I frame timing adjustment based on collision time information, i.e., the sending time of the camera I frame is adjusted.
[0132] It should be noted that the adjustment unit for adjusting the I frame timing of the multiple cameras is in milliseconds. Specifically, the adjustment unit can be set to 20 milliseconds, that is, the minimum adjustment period of the I frame timing adjustment is 20 milliseconds.
[0133] In one embodiment, the video transmission method is applied to an edge computing MEC platform, and the above step S30 includes:
[0134] Step A31, sending the camera identification information and the collision time information to the video platform, so that the video platform can adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0135] In this embodiment, the camera identification information and the collision time information are sent to the video platform, so that the video platform can adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information. Specifically, the MEC platform outputs the collision camera identification information and the collision time information of the collision to the video platform.
[0136] The camera identification information at least includes: the terminal IP, number, IMSI, port information, etc. of the camera. The collision time information includes several measurement moments when the I frame collision occurs.
[0137] It should be noted that the step of the video platform adjusting the I frame timing of the multiple cameras based on the camera identification information and the collision time information includes:
[0138] The video platform performs I frame timing adjustment on the multiple cameras based on the camera identification information and the collision time information. Specifically, the camera that needs to perform I frame timing adjustment (i.e., the camera where the I frame collision occurs) is determined based on the camera identification information, and then the camera that needs to perform I frame timing adjustment is adjusted based on the collision time information, i.e., the sending time of the camera I frame is adjusted.
[0139] Furthermore, the video transmission method further includes:
[0140] Step A90, obtaining cell information of the single cell;
[0141] In this embodiment, the cell information of the single cell is obtained. Specifically, based on the above-mentioned recorded cell information, the cell information of the single cell is obtained from a database recording the cell information.
[0142] The cell information includes at least one of the following: TAC, CI, etc.
[0143] Step A100, sending the cell information to the video platform, so that the video platform can determine the access locations of the multiple cameras based on the cell information.
[0144] In this embodiment, the cell information is sent to the video platform so that the video platform can determine the access positions of the multiple cameras based on the cell information. Specifically, the MEC platform outputs the camera identification information of the collision, the collision time information of the collision, and the cell information to the video platform so that the video platform can determine the access positions of the multiple cameras, thereby adjusting the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0145] It can be understood that sending the cell information to the video platform allows the video platform to quickly locate multiple cameras that require I frame timing adjustment.
[0146] The embodiment of the present invention provides a video transmission method, when it is detected that multiple cameras in a single cell are transmitting videos at the same time, the rate information of the video stream sent by the single cell is obtained; if the I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain the camera identification information and collision time information of the I frame collision; based on the camera identification information and the collision time information, the I frame timing of the multiple cameras is adjusted. Through the above method, the video stream is analyzed to detect whether there is an I frame collision behavior between multiple cameras. If there is an I frame collision behavior, the I frame timing of the camera corresponding to the camera identification information is adjusted to avoid the I frame collision behavior of the video transmission, thereby reducing the peak rate of the video stream, and further reducing the network transmission bandwidth requirements.
[0147] Furthermore, based on the above first embodiment, a second embodiment of the video transmission method of the present invention is proposed.
[0148] Reference Figure 5 , Figure 5 FIG. 4 is a flow chart of a second embodiment of a video transmission method according to the present invention.
[0149] In this embodiment, the rate information includes a peak rate and an average rate within a statistical period. In the above step S20, collision analysis is performed based on the rate information to obtain camera identification information where an I frame collision occurs, including:
[0150] Step S21, determining the generation time of the peak rate, and obtaining multiple bandwidth rates of the multiple cameras at the generation time;
[0151] In this embodiment, the generation time of the peak rate is determined, and multiple bandwidth rates of multiple cameras at the generation time are obtained. The bandwidth rate is the original rate of each camera, that is, the rate before the camera code streams are superimposed.
[0152] Step S22, compare the multiple bandwidth rates with the average rate respectively, determine several cameras whose bandwidth rates are greater than the average rate, and obtain camera identification information of the several cameras, wherein the several cameras are cameras where I frame collision occurs in video transmission.
[0153] In this embodiment, multiple bandwidth rates are compared with the average rate respectively, and several cameras whose bandwidth rates are greater than the average rate are determined, and the camera identification information of several cameras is obtained, and the several cameras are the cameras where the I frame collision occurs in the video transmission. Specifically, according to the rate of multiple cameras, the camera whose bandwidth rate of a single camera is greater than the statistical mean of all cameras (the mean of multiple cameras, i.e., the average rate) at the time when the peak rate is generated is identified, and it is determined as the camera where the collision occurs, and the camera identification information of the camera where the collision occurs is obtained, so as to output the camera identification information to the video platform.
[0154] The camera identification information includes at least one of the following: the camera's terminal IP, number, IMSI, port information, etc.
[0155] In this embodiment, the generation time of the peak rate is determined, and multiple bandwidth rates of multiple cameras at the generation time are obtained; the multiple bandwidth rates are compared with the average rate respectively, and several cameras whose bandwidth rates are greater than the average rate are determined, and the camera identification information of several cameras is obtained, and the several cameras are cameras where I frame collision occurs in video transmission. Through the above method, the generation time of the peak rate is first determined to determine the time of I frame collision, and then the multiple bandwidth rates of multiple cameras are compared with the average rate respectively to determine the camera where I frame collision occurs, so as to accurately determine the camera where I frame collision occurs, so as to improve the accuracy of subsequent I frame timing adjustment, and then improve the accuracy of avoiding I frame collision behavior.
[0156] Furthermore, based on the above first embodiment, a third embodiment of the video transmission method of the present invention is proposed.
[0157] Reference Figure 6 , Figure 6 FIG. 4 is a flow chart of a third embodiment of a video transmission method according to the present invention.
[0158] In this embodiment, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, and the several measurement periods correspond to the several measurement rates one by one. In the above step S20, collision analysis is performed based on the rate information to obtain collision time information of the I frame collision, including:
[0159] Step S23, dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios;
[0160] Step S24, comparing the several rate ratios with preset thresholds respectively, and determining several measurement moments at which the rate ratios are greater than the preset thresholds;
[0161] Step S25: Based on the plurality of measurement moments, collision time information of the occurrence of the I frame collision is obtained.
[0162] In this embodiment, first, a plurality of measured rates are divided by the average rate to obtain a plurality of rate ratios, and then the plurality of rate ratios are compared with preset thresholds to determine a plurality of measurement moments at which the rate ratios are greater than the preset thresholds; finally, based on the plurality of measurement moments, the collision time information of the occurrence of the I frame collision is obtained. The preset threshold can be set according to actual needs, such as 1.5, which is not limited here. The collision time information may include one or more moments, that is, it may include the time of one I frame collision and the time of multiple I frame collisions.
[0163] It should be noted that the video stream can be divided into several statistical cycles, and one statistical cycle includes several measurement cycles. One statistical cycle can be set to 1 second, and one measurement cycle can be set to 20 milliseconds, then one statistical cycle includes 50 measurement cycles. Of course, the measurement cycle and the statistical cycle can be set to other values according to actual needs. For example, the measurement cycle is less than or equal to 20 milliseconds, so as to ensure that the I frame of the mainstream video transmission scene of 50 frames / second or less can be accurately identified in each statistical cycle. One measurement cycle corresponds to a measurement rate, and the calculation formula of the measurement rate is as follows:
[0164] Measurement rate = number of bytes in the measurement period / measurement period;
[0165] Specifically, refer to Figure 4 Calculating the instantaneous rate once based on the number of bytes in the measurement period is to calculate the measurement rate, wherein a data packet may include multiple bytes, for example, a data packet includes 1400 bytes.
[0166] In one embodiment, the average rate may be the average rate in a statistical period, that is, the average rate is the average of several measured rates in a statistical period. The peak rate may be the peak rate in a statistical period, that is, the maximum measured rate in a statistical period.
[0167] In this embodiment, a plurality of measured rates are divided by the mean rate to obtain a plurality of rate ratios; the plurality of rate ratios are compared with preset thresholds to determine a plurality of measurement moments at which the rate ratios are greater than the preset thresholds; based on the plurality of measurement moments, the collision time information of the I frame collision is obtained. In the above manner, a plurality of measured rates are compared with the mean rate to determine the time at which the I frame collision occurs, thereby improving the accuracy of the subsequent I frame timing adjustment, and further improving the accuracy of the I frame collision avoidance behavior.
[0168] The invention also provides a video transmission device.
[0169] In this embodiment, the video transmission device includes:
[0170] An acquisition module, used for acquiring rate information of a video stream sent by a single cell when it is detected that multiple cameras in a single cell transmit videos at the same time;
[0171] An analysis module, configured to perform a collision analysis based on the rate information to obtain camera identification information and collision time information of the camera where the I-frame collision occurs, if a key frame I-frame collision behavior is detected based on the rate information;
[0172] An adjustment module is used to adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0173] Further, the rate information includes an average rate and a plurality of measurement rates within a statistical period, the statistical period includes a plurality of measurement periods, the plurality of measurement periods correspond one to one with the plurality of measurement rates, and the video transmission device further includes:
[0174] A division operation module, used for performing division operations on the plurality of measurement rates and the average rate respectively to obtain a plurality of rate ratios;
[0175] A collision judgment module, configured to judge that an I frame collision behavior exists if at least one of the plurality of rate ratios is greater than a preset threshold;
[0176] The collision judgment module is further used to determine that there is no I frame collision behavior if the several rate ratios are all less than or equal to a preset threshold.
[0177] Further, the rate information includes a peak rate and an average rate within a statistical period, and the analysis module includes:
[0178] A rate acquisition unit, used to determine the generation time of the peak rate, and obtain multiple bandwidth rates of the multiple cameras at the generation time;
[0179] The rate comparison unit is used to compare the multiple bandwidth rates with the average rate respectively, determine several cameras whose bandwidth rates are greater than the average rate, and obtain camera identification information of the several cameras, wherein the several cameras are cameras where I frame collision occurs in video transmission.
[0180] Further, the rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, the several measurement periods correspond to the several measurement rates one by one, and the analysis module includes:
[0181] A division unit, configured to divide the plurality of measurement rates by the average rate respectively to obtain a plurality of rate ratios;
[0182] a time determination unit, configured to compare the plurality of rate ratios with preset thresholds respectively, and determine a plurality of measurement times at which the rate ratios are greater than the preset thresholds;
[0183] The time acquisition unit is used to obtain collision time information of the I frame collision based on the plurality of measurement moments.
[0184] Furthermore, the video transmission method is applied to an edge computing MEC platform, and the adjustment module includes:
[0185] An information sending unit is used to send the camera identification information and the collision time information to the video platform, so that the video platform can adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
[0186] Furthermore, the adjustment module includes:
[0187] An information acquisition unit, configured to acquire cell information of the single cell;
[0188] The information sending unit is also used to send the cell information to the video platform so that the video platform can determine the access locations of the multiple cameras based on the cell information.
[0189] Furthermore, the video transmission device further includes:
[0190] An information acquisition module, used to determine the video service of the same return address, and obtain the camera tag information and cell information of the video service;
[0191] The camera determination module is used to determine the corresponding single cell based on the cell information, and to determine whether there are multiple cameras transmitting videos simultaneously in the single cell based on the camera tag information.
[0192] Among them, the functional implementation of each module in the above-mentioned video transmission device corresponds to each step in the above-mentioned video transmission method embodiment, and its functions and implementation processes are no longer repeated here.
[0193] The present invention also provides a computer-readable storage medium, on which a video transmission program is stored. When the video transmission program is executed by a processor, the steps of the video transmission method described in any of the above embodiments are implemented.
[0194] The specific embodiments of the computer-readable storage medium of the present invention are substantially the same as the embodiments of the above-mentioned video transmission method, and are not described in detail herein.
[0195] The present invention also provides a computer program product, which includes a computer program. When the computer program product is executed by a processor, the steps of the video transmission method described in any one of the above embodiments are implemented.
[0196] The specific embodiments of the computer program product of the present invention are basically the same as the embodiments of the above-mentioned video transmission method, and will not be described in detail here.
[0197] The embodiment of the present invention deploys the edge computing platform MEC platform through the above scheme, and deploys the video I frame collision detection service, video platform and camera based on the MEC platform. The video I frame collision detection service is the core network of the MEC platform, which uses the traffic analysis provided by the edge computing platform to identify the I frame collision service, and provides a calling service to the video platform based on the API (Application Program Interface).
[0198] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0199] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0200] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially 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) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0201] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A video transmission method, characterized in that: The video transmission method comprises the following steps: When it is detected that multiple cameras in a single cell transmit videos at the same time, the rate information of the video stream sent by the single cell is obtained, where the rate information includes a peak rate, an average rate and several measurement rates, and the measurement rate is an instantaneous rate of a measurement cycle; If a key frame I frame collision behavior is detected based on the rate information, a collision analysis is performed based on the rate information to obtain camera identification information and collision time information of the I frame collision; The step of performing collision analysis based on the rate information to obtain camera identification information and collision time information where an I-frame collision occurs includes: Determining identification information of a camera where an I frame collision occurs based on the peak rate and the plurality of measurement rates; Determining collision time information of an I frame collision based on the plurality of measurement rates and the average rate; Based on the camera identification information and the collision time information, I frame timing adjustment is performed on the multiple cameras.
2. The video transmission method according to claim 1, characterized in that: The rate information includes an average rate and several measurement rates within a statistical period, the statistical period includes several measurement periods, the several measurement periods correspond to the several measurement rates one by one, and after the step of acquiring the rate information of the video stream sent by the single cell when it is detected that multiple cameras in a single cell transmit videos at the same time, it also includes: Dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios; If at least one of the several rate ratios is greater than a preset threshold, it is determined that an I frame collision behavior exists; If the plurality of rate ratios are all less than or equal to a preset threshold, it is determined that there is no I frame collision behavior.
3. The video transmission method according to claim 1, characterized in that: The rate information includes a peak rate and an average rate within a statistical period, and the step of performing collision analysis based on the rate information to obtain camera identification information where an I-frame collision occurs includes: Determine the time when the peak rate is generated, and obtain multiple bandwidth rates of the multiple cameras at the time when the peak rate is generated; The multiple bandwidth rates are compared with the average rate respectively, a number of cameras whose bandwidth rates are greater than the average rate are determined, and camera identification information of the several cameras is obtained, where the several cameras are cameras where I frame collision occurs in video transmission.
4. The video transmission method according to claim 1, characterized in that: The rate information includes an average rate and a plurality of measurement rates within a statistical period, the statistical period includes a plurality of measurement periods, the plurality of measurement periods correspond to the plurality of measurement rates one by one, and the step of performing collision analysis based on the rate information to obtain collision time information of an I frame collision includes: Dividing the plurality of measured rates by the average rate respectively to obtain a plurality of rate ratios; Comparing the plurality of rate ratios with preset thresholds respectively, and determining a plurality of measurement moments at which the rate ratios are greater than the preset thresholds; Based on the several measurement moments, collision time information of the occurrence of the I frame collision is obtained.
5. The video transmission method according to claim 1, characterized in that: The video transmission method is applied to the edge computing MEC platform, and the step of adjusting the I frame timing of the multiple cameras based on the camera identification information and the collision time information includes: The camera identification information and the collision time information are sent to the video platform, so that the video platform can adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
6. The video transmission method according to claim 5, characterized in that: The video transmission method further includes: Acquiring cell information of the single cell; The cell information is sent to the video platform so that the video platform can determine the access locations of the multiple cameras based on the cell information.
7. The video transmission method according to any one of claims 1 to 6, characterized in that: Before the step of acquiring the rate information of the video stream sent by the single cell when detecting that multiple cameras in a single cell transmit videos at the same time, the step further includes: Determine the video service of the same return address, and obtain the camera tag information and cell information of the video service; A corresponding single cell is determined based on the cell information, and whether multiple cameras simultaneously transmit videos in the single cell is determined based on the camera tag information.
8. A video transmission device, characterized in that: The video transmission device comprises: An acquisition module is used to acquire rate information of the video stream sent by the single cell when it is detected that multiple cameras in a single cell transmit videos at the same time, wherein the rate information includes a peak rate, an average rate and several measurement rates, and the measurement rate is an instantaneous rate of a measurement cycle; An analysis module, configured to perform a collision analysis based on the rate information to obtain camera identification information and collision time information of the camera where the I-frame collision occurs, if a key frame I-frame collision behavior is detected based on the rate information; Wherein, the analysis module is also used for: Determining identification information of a camera where an I frame collision occurs based on the peak rate and the plurality of measurement rates; Determining collision time information of an I frame collision based on the plurality of measurement rates and the average rate; An adjustment module is used to adjust the I frame timing of the multiple cameras based on the camera identification information and the collision time information.
9. A video transmission device, characterized in that: The video transmission device comprises: a memory, a processor, and a video transmission program stored in the memory and executable on the processor, wherein the video transmission program implements the steps of the video transmission method according to any one of claims 1 to 7 when executed by the processor.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the video transmission method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Video data transmission adjusting method and device
CN104125429A
Data transmission method based on multiple network cameras and related device
CN112261354A