Video transmission method

Through H.264 and H.265 dual-channel encoding and ring buffer management, low-code rate real-time streams and high-code rate cache streams are generated, which solves the problems of low transmission efficiency and waste of resources in the existing technology, and realizes the smoothness of real-time monitoring and high-quality backtracking of key events.

CN120302052AInactive Publication Date: 2025-07-11XIAN INST OF OPTICS & PRECISION MECHANICS CHINESE ACAD OF SCI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510466634.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing video transmission methods, in embedded cameras, drone image transmission systems and security monitoring equipment with limited resources, it is difficult to dynamically adapt to scene changes, resulting in low transmission efficiency, poor flexibility, and insufficient bandwidth resources, resulting in waste of resources and loss of key event data.

Method used

The H.264 and H.265 dual independent encoding is used to generate low-code rate real-time streams and high-code rate cache streams. Through the dynamic cache management of ring buffers, high-code rate key segments are actively transmitted when scene changes, and bandwidth resources are reasonably allocated to ensure real-time monitoring fluency and high-quality backtracking of key events.

Benefits of technology

It improves the flexibility and efficiency of video transmission, and achieves the balance between real-time monitoring fluency and high-quality backtracking of key events in a bandwidth-constrained environment, and optimizes the utilization of storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120302052A_ABST
    Figure CN120302052A_ABST
Patent Text Reader

Abstract

The invention discloses a video transmission method, according to the scheme, a low-bit-rate real-time stream generated through double-channel independent coding can be continuously transmitted to ensure the smoothness of real-time monitoring, and a generated high-bit-rate cache stream is actively transmitted only under the condition that a current scene changes, so that the flexibility and the transmission efficiency of video transmission are improved, and the video transmission efficiency is improved. The balance between real-time monitoring fluency and high-quality backtracking of key events is realized in a bandwidth limited environment; besides, dynamic cache management is carried out on the high-code-rate cache flow by adopting the annular buffer area, so that the integrity and accessibility of key event segments can be ensured, and storage resources are optimized at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a video transmission method. Background Art

[0002] Currently, a video surveillance system generates a video stream and transmits it to a terminal in real time for monitoring and storage. Some advanced systems introduce key frame extraction technology to increase the local bit rate or resolution when an event is detected, thereby achieving video transmission and real-time monitoring.

[0003] Traditionally, in scenarios such as resource-constrained embedded cameras, UAV video transmission systems, and security monitoring devices, the prior art usually adopts a fixed data compression and transmission strategy, and it is difficult to dynamically adapt to the requirements of scene changes in the case of limited bandwidth.

[0004] Therefore, the above video transmission method has problems of poor flexibility and low transmission efficiency. Summary of the Invention

[0005] This application aims to at least solve the technical problems existing in the prior art. To this end, a first aspect of this application proposes a video transmission method, which includes:

[0006] Dual-channel independent encoding of the current video stream is performed using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low-bitrate real-time stream and a high-bitrate cached stream;

[0007] Allocate a first preset bandwidth to the low-bitrate real-time stream for real-time playback processing;

[0008] A circular buffer is used for dynamic cache management of the high-bitrate cached stream, and when it is detected that the current scene has changed, a high-bitrate key segment is obtained from the high-bitrate cached stream and a second preset bandwidth is allocated for transmission;

[0009] Store the low-bitrate real-time stream and the high-bitrate key segment.

[0010] In a possible implementation, the circular buffer includes a main buffer area, the main buffer area includes a first storage block and a second storage block that work alternately, the high-bitrate cached stream includes multiple high-bitrate video data, and using the circular buffer for dynamic cache management of the high-bitrate cached stream includes:

[0011] Use the first storage block to store the first high-bitrate video data within the first preset time period; wherein, the first high-bitrate video data includes first valid data and overlapping data;

[0012] Use a second storage block to store the second highest bitrate video data within a second preset time period; wherein, the second highest bitrate video data includes overlapping data and second valid data, and the second valid data is located after the overlapping data;

[0013] When the first storage block is full, repeatedly execute the steps of updating the second preset time period to generate a new second preset time period, storing the high bitrate video data within the new second preset time period as the new second highest bitrate video data in the second storage block, and using the new second highest bitrate video data as the new first highest bitrate video data to overwrite the first highest bitrate video data in the first storage block.

[0014] In a possible implementation manner, when it is detected that the current scene has changed, obtaining the high bitrate key segment from the high bitrate cache stream includes:

[0015] When it is detected that the current scene has changed, obtain the current marked timestamp;

[0016] Based on the current marked timestamp, extract the high bitrate key segment from the main buffer area of the circular buffer; wherein, the high bitrate key segment includes the high bitrate video data and metadata corresponding to the current event.

[0017] In a possible implementation manner, the circular buffer further includes a secondary cache pool, and the method further includes:

[0018] Copy the high bitrate key segment to the secondary cache pool;

[0019] Use the secondary cache pool to independently store the high bitrate key segment.

[0020] In a possible implementation manner, storing the low bitrate real-time stream and the high bitrate key segment includes:

[0021] When it is determined that the low bitrate real-time stream is received, store it according to the first preset storage strategy;

[0022] When it is determined that the high bitrate key segment is received, store it according to the second preset storage strategy.

[0023] In a possible implementation manner, when it is determined that the low bitrate real-time stream is received, storing it according to the first preset storage strategy includes:

[0024] When it is determined that the low bitrate real-time stream is received, segment the low bitrate real-time stream according to a preset duration to obtain multiple segmented files;

[0025] Store the multiple segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file.

[0026] In a possible implementation manner, when it is determined that a high-bitrate key segment is received, storage is performed according to a second preset storage policy, including:

[0027] When it is determined that a high-bitrate key segment is received, obtain a preset number of multiple data sub-packets;

[0028] When the reception of multiple data sub-packets is completed, perform integrity verification on the multiple data sub-packets to obtain a verification result;

[0029] When the verification result is a pass, store the multiple data sub-packets as an independent file, and use the trigger timestamp corresponding to the current event as the file name of the independent file.

[0030] A second aspect of the present application proposes a video transmission device, and the device includes:

[0031] A generation module, configured to perform dual-channel independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low-bitrate real-time stream and a high-bitrate cached stream;

[0032] A first processing module, configured to perform real-time playback processing on the low-bitrate real-time stream by allocating a first preset bandwidth;

[0033] A second processing module, configured to perform dynamic cache management on the high-bitrate cached stream using a circular buffer, and when it is detected that the current scene changes, obtain a high-bitrate key segment from the high-bitrate cached stream and allocate a second preset bandwidth for transmission;

[0034] A storage module, configured to store the low-bitrate real-time stream and the high-bitrate key segment.

[0035] In a possible implementation manner, the circular buffer includes a main buffer area, and the main buffer area includes a first storage block and a second storage block that work alternately. The second processing module is specifically configured to:

[0036] Use the first storage block to store first high-bitrate video data within a first preset time period; wherein, the first high-bitrate video data includes first valid data and overlapping data;

[0037] Use the second storage block to store second high-bitrate video data within a second preset time period; wherein, the second high-bitrate video data includes overlapping data and second valid data, and the second valid data is located after the overlapping data;

[0038] When the first storage block is full, repeat the steps of updating the second preset time period to generate a new second preset time period, storing the high-bitrate video data within the new second preset time period as new second high-bitrate video data in the second storage block, and using the new second high-bitrate video data as new first high-bitrate video data to overwrite the first high-bitrate video data in the first storage block.

[0039] In a possible implementation manner, the above-mentioned second processing module is further configured to:

[0040] When it is detected that the current scene has changed, obtain the current marked timestamp;

[0041] Based on the current marked timestamp, extract high-bitrate key segments from the main buffer area of the circular buffer; wherein, the high-bitrate key segments include high-bitrate video data and metadata corresponding to the current event.

[0042] In a possible implementation manner, the circular buffer further includes a secondary cache pool, and the above-mentioned video transmission device is further configured to:

[0043] Copy the high-bitrate key segments to the secondary cache pool;

[0044] Use the secondary cache pool to independently store the high-bitrate key segments.

[0045] In a possible implementation manner, the above-mentioned storage module is specifically configured to:

[0046] When it is determined that a low-bitrate real-time stream is received, store it according to the first preset storage policy;

[0047] When it is determined that a high-bitrate key segment is received, store it according to the second preset storage policy.

[0048] In a possible implementation manner, the above-mentioned storage module is further configured to:

[0049] When it is determined that a low-bitrate real-time stream is received, segment the low-bitrate real-time stream according to a preset duration to obtain a plurality of segmented files;

[0050] Store the plurality of segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file.

[0051] In a possible implementation manner, the above-mentioned storage module is further configured to:

[0052] When it is determined that a high-bitrate key segment is received, obtain a preset number of data sub-packets;

[0053] When multiple data sub - packets are received completely, perform integrity verification on the multiple data sub - packets to obtain a verification result;

[0054] When the verification result is that the verification passes, store the multiple data sub - packets as an independent file, and use the trigger timestamp corresponding to the current event as the file name of the independent file.

[0055] A third aspect of the present application proposes an electronic device, which includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the video transmission method as described in the first aspect.

[0056] A fourth aspect of the present application proposes a computer - readable storage medium. At least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the video transmission method as described in the first aspect.

[0057] The embodiments of the present application have the following beneficial effects:

[0058] The video transmission method provided by the embodiments of the present application includes: performing dual - path independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low - bitrate real - time stream and a high - bitrate cached stream, allocating a first preset bandwidth for real - time playback processing of the low - bitrate real - time stream, performing dynamic cache management on the high - bitrate cached stream using a circular buffer, and when it is detected that the current scene has changed, obtaining high - bitrate key segments from the high - bitrate cached stream and allocating a second preset bandwidth for transmission, and storing the low - bitrate real - time stream and the high - bitrate key segments. In this solution, the low - bitrate real - time stream generated by dual - path independent encoding can be continuously transmitted to ensure the smoothness of real - time monitoring. The generated high - bitrate cached stream starts to actively transmit only when the current scene changes, improving the flexibility and transmission efficiency of video transmission, and achieving a balance between the smoothness of real - time monitoring and the high - quality backtracking of key events in a bandwidth - limited environment; in addition, by using a circular buffer to perform dynamic cache management on the high - bitrate cached stream, the integrity and accessibility of key event segments can be ensured, while optimizing storage resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a block diagram of a computer device provided by an embodiment of the present application;

[0060] Figure 2 It is a flowchart of the steps of a video transmission method provided by an embodiment of the present application;

[0061] Figure 3 A flowchart of steps for obtaining high-bitrate key segments provided by an embodiment of the present application;

[0062] Figure 4 A flowchart of steps for storing high-bitrate key segments provided by an embodiment of the present application;

[0063] Figure 5 A flowchart of steps for processing a low-bitrate real-time stream and high-bitrate key segments provided by an embodiment of the present application;

[0064] Figure 6 Another flowchart of steps for storing a low-bitrate real-time stream provided by an embodiment of the present application;

[0065] Figure 7 Another flowchart of steps for storing high-bitrate key segments provided by an embodiment of the present application;

[0066] Figure 8 A structural block diagram of a video transmission device provided by an embodiment of the present application. Detailed implementation manners

[0067] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0068] Most current video surveillance systems adopt a single-channel encoding method, that is, a video stream with a fixed bitrate is generated by a single encoder and transmitted in real time to the terminal for monitoring and storage. Some advanced systems introduce key frame extraction technology to increase the local bitrate or resolution when an event is detected, but still mainly use a single-channel stream. The generation and transmission of high-bitrate segments rely on real-time bandwidth, and cache management usually adopts fixed-duration storage, which requires manual cleaning or overwriting.

[0069] In scenarios such as resource - constrained embedded cameras, UAV video transmission systems, and security monitoring devices, the existing technologies usually adopt fixed data compression and transmission strategies, combined with fixed bit - rate control and priority scheduling. However, in the case of limited bandwidth, the existing technologies are difficult to dynamically adapt to the requirements of scene changes. When critical events occur (such as scene mutations or abnormal behaviors), problems such as image quality degradation, loss of key details, or increased transmission delay often occur. In addition, the utilization of link bandwidth by the existing technologies is relatively static, and the remaining bandwidth of the link is not fully utilized, resulting in obvious resource waste. Traditional cameras use a fixed compression bit - rate (such as 500Kbps) and cannot dynamically adjust the bandwidth according to the scene, resulting in image quality degradation in high - dynamic scenes (such as fast movement and sudden light changes). Moreover, the actual bit - rate of the compression algorithm is usually lower than the theoretical maximum value (such as the user's actual measured average occupancy of 80% bandwidth), and the remaining 20% bandwidth is not utilized, causing resource waste. The existing methods lack a fast detection mechanism for scene mutations and cannot give priority to transmitting high - definition data during critical periods.

[0070] Based on this, the present application proposes a video transmission method. The low - bit - rate real - time stream generated by dual - path independent encoding in this solution can be continuously transmitted to ensure the smoothness of real - time monitoring. The generated high - bit - rate buffered stream starts to be actively transmitted only when the current scene changes, improving the flexibility and transmission efficiency of video transmission, and achieving a balance between the smoothness of real - time monitoring and the high - quality back - tracing of critical events in a bandwidth - constrained environment. In addition, by using a circular buffer for dynamic cache management of the high - bit - rate buffered stream, the integrity and accessibility of critical event segments can be ensured while optimizing storage resources.

[0071] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "a plurality" is two or more. In addition, the use of "based on" or "according to" means open and inclusive, because a process, step, calculation, or other action "based on" or "according to" one or more of the stated conditions or values may, in practice, be based on additional conditions or values beyond those stated.

[0072] The video transmission method provided by the present application can be applied to computer devices (electronic devices). The computer device can be a server or a terminal. Among them, the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not make specific limitations in this regard. The terminal can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices.

[0073] Taking the computer device as a server as an example, Figure 1 A block diagram of a server is shown, as Figure 1 shown. The server may include a processor and a memory connected by a system bus. Among them, the processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a video transmission method is implemented.

[0074] Those skilled in the art can understand that Figure 1 the structure shown in

[0075] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the server to which the solution of this application is applied. Optionally, the server may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0076] Figure 2 is a step flowchart of a video transmission method provided by an embodiment of this application. As Figure 2 shown, the method includes the following steps:

[0077] Step 202: Independently encode the current video stream using H.264 video encoding technology and H.265 video encoding technology in two paths to generate a low-bitrate real-time stream and a high-bitrate cached stream.

[0078] Among them, after obtaining the current video stream, two video streams can be generated through two-path independent encoding, namely a low-bitrate real-time stream and a high-bitrate cached stream. The low-bitrate real-time stream uses H.264 encoding, with a resolution of 1280×720@30fps and a bitrate of 400Kbps, and is continuously transmitted to ensure the smoothness of real-time monitoring. The high-bitrate cached stream uses H.265 encoding, with a resolution of 1920×1080@30fps and a bitrate of 1Mbps.

[0079] H.264 is the Advanced Video Coding, which is a widely used video compression standard. It reduces redundant data through inter-frame prediction and intra-frame prediction and is suitable for real-time transmission. H.265 is the High Efficiency Video Coding, which is an upgraded version of H.264 and can further improve the compression efficiency and is suitable for high-quality video storage.

[0080] Step 204: Allocate a first preset bandwidth to the low-bitrate real-time stream for real-time playback processing.

[0081] Among them, in terms of transmission, the system adopts a bandwidth hierarchical transmission strategy. Under the condition that the total bandwidth is 500 Kbps, resources are reasonably allocated to balance real-time monitoring and high-bitrate data transmission. 80% of the total bandwidth, that is, 400 Kbps, is fixedly allocated to the low-bitrate real-time stream as the first preset bandwidth to ensure that the real-time monitoring video has no lags and meets the user's requirements for smooth monitoring.

[0082] Step 206: Dynamically cache and manage the high-bitrate cached stream using a circular buffer, and when it is detected that the current scene has changed, obtain the high-bitrate key segment from the high-bitrate cached stream and allocate the second preset bandwidth for transmission.

[0083] Among them, when transmitting the high-bitrate cached stream, 20% of the remaining total bandwidth can be used as the second preset bandwidth, that is, 100 Kbps as a redundant channel for transmitting the high-bitrate data blocks in the secondary cache pool. The 20-second data packet is split into 200 sub-packets of 100 Kb, and these sub-packets are inserted during the gaps in the low-bitrate real-time stream transmission to avoid interfering with real-time monitoring.

[0084] In some optional embodiments, the second preset bandwidth can be calculated using a remaining bandwidth calculation model. The remaining bandwidth calculation model is used to determine the available bandwidth resources for asynchronous transmission of high-bitrate data, ensure the priority of the low-bitrate real-time stream, and efficiently utilize bandwidth redundancy. The following is the logic of the calculation model, including the definition of the system total bandwidth. Among them, the system total bandwidth is denoted as Btotal, with the unit of Kbps. For example, Btotal = 500 Kbps.

[0085] Next, the first preset bandwidth corresponding to the low-bitrate real-time stream is denoted as Breal, and Breal = 0.8 × Btotal. For example, when Btotal = 500 Kbps, Breal = 0.8 × 500 = 400 Kbps. The remaining bandwidth is denoted as Bremain, and Bremain = Btotal - Breal. For example, Bremain = 500 - 400 = 100 Kbps.

[0086] When the actual first preset bandwidth Breal,actual decreases, the remaining bandwidth Bremain = Btotal - Breal,actual. For example, if Breal,actual = 350 Kbps, then Bremain = 500 - 350 = 150 Kbps. At this time, the transmission time is denoted as Ttrans, and Ttrans = Dhigh / Bremain, where Dhigh represents the size of the high-bitrate key segment, in Kb. For example, 20 seconds × 1 Mbps = 20 Mb, and 1 Mb = 1024 Kb. Then when Bremain = 100 Kbps, Ttrans = 20 × 1024 / 100 = 204.8 seconds.

[0087] Optionally, the circular buffer includes a main buffer area, the main buffer area includes a first storage block and a second storage block that work alternately, and the high-bitrate cache stream includes multiple high-bitrate video data. In order to efficiently manage the high-bitrate cache stream, a dynamic dual-buffer management mechanism is designed. The dynamic dual-buffer structure is a mechanism for efficiently managing and storing high-bitrate video data, consisting of two parts: the main buffer area (circular buffer) and the secondary buffer pool (persistent storage). This structure aims to ensure the integrity and accessibility of key event segments while optimizing storage resources.

[0088] In some alternative embodiments, as Figure 3 shown, Figure 3 is a flowchart of the steps of a dynamic cache management provided by an embodiment of the present application, including:

[0089] Step 302: Use the first storage block to store the first high-bitrate video data within the first preset time period.

[0090] Step 304: Use the second storage block to store the second high-bitrate video data within the second preset time period.

[0091] Step 306: When the first storage block is full, repeatedly execute the steps of updating the second preset time period to generate a new second preset time period, storing the high-bitrate video data within the new second preset time period as the new second high-bitrate video data in the second storage block, and using the new second high-bitrate video data as the new first high-bitrate video data to overwrite the first high-bitrate video data in the first storage block with the new first high-bitrate video data.

[0092] Among them, the first high-bitrate video data includes first valid data and overlapping data. The second high-bitrate video data includes overlapping data and second valid data, and the second valid data is located after the overlapping data.

[0093] Exemplarily, the main buffer adopts a circular buffer design, which consists of two alternately working first storage blocks denoted as block A and a second storage block denoted as block B. Each block stores 12 seconds of high-bitrate video data, including 10 seconds of valid data and 2 seconds of overlapping data.

[0094] Among them, block A is used to store the first high-bitrate video data within the first preset time period. The first preset time period can be from T0 to T12 seconds, where T0 to T10 seconds correspond to the first valid data, and T10 to T12 seconds correspond to the overlapping data. While block A is storing data, block B starts to store the subsequent 12 seconds of data, that is, to store the second high-bitrate video data within the second preset time period. The second preset time period can be from T10 to T22 seconds, where T10 to T12 seconds overlap with block A, that is, they correspond to the overlapping data, and T13 to T22 seconds correspond to the second valid data.

[0095] When block A is full after storing for 12 seconds, that is, when the first storage block is full, the steps of updating the second preset time period to generate a new second preset time period, storing the high-bitrate video data within the new second preset time period as the new second high-bitrate video data in the second storage block, and using the new second high-bitrate video data as the new first high-bitrate video data to overwrite the first high-bitrate video data in the first storage block are repeatedly executed.

[0096] Exemplarily, when block A is full after storing for 12 seconds, the system switches to block B to store new 12 seconds of data, that is, updates the second preset time period to a new second preset time period. The new second preset time period is from T22 to T34 seconds, and the corresponding data is the new second high-bitrate video data. At the same time, the new second high-bitrate video data is used as the new first high-bitrate video data, and the first high-bitrate video data stored in block A is overwritten with the new first high-bitrate video data. Repeating this process, new data will continuously overwrite old data to ensure that the most recent video data is always included. Among them, the 2 seconds of overlap ensures that the data within any 10-second time window can be completely extracted from block A or block B, avoiding data loss due to switching.

[0097] In some optional embodiments, when it is detected that the current scene has changed, a high-bitrate key segment can be obtained from the high-bitrate cache stream, as Figure 3 shown, Figure 3 which is a flowchart of the steps for obtaining a high-bitrate key segment provided by the embodiment of the present application, including:

[0098] Step 302: When it is detected that the current scene has changed, obtain the current marked timestamp.

[0099] Step 304: Based on the current marked timestamp, extract the high-bitrate key segment from the main buffer of the circular buffer.

[0100] Among them, the high-bitrate key segments include high-bitrate video data and metadata corresponding to the current event. When it is detected that the current scene has changed, that is, it is determined that the current scene has changed, which will trigger a scene marker, that is, the current marker timestamp corresponding to the current event can be obtained.

[0101] In some alternative embodiments, when determining whether the current scene has changed, it can be determined by the condition that the scene exposure value mutates by a first preset percentage. Among them, the first preset percentage can be custom-set in advance according to experience. Exemplarily, the first preset percentage can be 20%.

[0102] In some other alternative embodiments, when determining whether the current scene has changed, it can also be determined by comparing the bitrate at the current moment with the bitrate of the previous second. If the bitrate at the current moment exceeds the second preset percentage compared with the bitrate of the previous second, it is considered that the current scene has changed. Among them, the second preset percentage can also be custom-set in advance according to experience. Exemplarily, the second preset percentage can be 20%.

[0103] Next, based on the current marker timestamp, data with a preset duration related to the current event can be extracted from the main buffer area of the circular buffer as high-bitrate key segments. Optionally, the preset duration can be 20 seconds, and the data with the preset duration can be the data 10 seconds before the occurrence of the current event and the data 10 seconds after the occurrence of the current event.

[0104] Step 208: Store the low-bitrate real-time stream and the high-bitrate key segments.

[0105] Among them, in some alternative embodiments, the circular buffer further includes a secondary cache pool, as Figure 4 shown, Figure 4 is a flowchart of steps for storing high-bitrate key segments provided by an embodiment of the present application, including:

[0106] Step 402: Copy the high-bitrate key segments to the secondary cache pool.

[0107] Step 404: Independently store the high-bitrate key segments using the secondary cache pool.

[0108] Among them, after the high-bitrate key segments are extracted, the high-bitrate key segments can be copied to the secondary cache pool, which is attached with metadata, including but not limited to data such as the current marker timestamp, scene type, check code, etc. Thus, the high-bitrate key segments can be independently stored using the secondary cache pool, and the data stored in the secondary cache pool is used for subsequent analysis and will not be overwritten.

[0109] In some optional embodiments, the terminal side adopts a differential storage strategy. The low-bitrate stream can be used for real-time playback and storage, and the high-bitrate key segments are independently stored for subsequent detailed analysis. The differential storage strategy on the terminal side is a data management method for video surveillance systems. By differentially processing the low-bitrate real-time stream and high-bitrate key segments, it achieves a balance between real-time monitoring and high-quality event backtracking. As Figure 5 shown, Figure 5 FIG. is a flowchart of steps for processing a low-bitrate real-time stream and high-bitrate key segments provided by an embodiment of the present application, including:

[0110] Step 502, when it is determined that a low-bitrate real-time stream is received, store it according to a first preset storage strategy.

[0111] Among them, as Figure 6 shown, Figure 6 FIG. is another flowchart of steps for storing a low-bitrate real-time stream provided by an embodiment of the present application, including:

[0112] Step 602, when it is determined that a low-bitrate real-time stream is received, segment and store the low-bitrate real-time stream according to a preset duration to obtain a plurality of segmented files.

[0113] Step 604, store the plurality of segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file.

[0114] Among them, when it is determined that a low-bitrate real-time stream is received, the low-bitrate real-time stream is segmented and stored according to a preset duration. Optionally, the preset duration can be an hour, that is, the low-bitrate real-time stream is segmented and stored hourly, generating a file per hour, with a size of approximately 225 MB, thereby obtaining a plurality of segmented files.

[0115] Store the plurality of segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file. For example, the file name of the segmented file can be low_20231010_14.mp4, and metadata such as start and end times, bitrate, and resolution can be recorded.

[0116] Step 504, when it is determined that a high-bitrate key segment is received, store it according to a second preset storage strategy.

[0117] Among them, as Figure 7 shown, Figure 7 FIG. is another flowchart of steps for storing a high-bitrate key segment provided by an embodiment of the present application, including:

[0118] Step 702, when it is determined that a high-bitrate key segment is received, obtain a plurality of data sub-packets with a preset quantity.

[0119] Step 704: When multiple data sub - packets are received completely, perform integrity verification on the multiple data sub - packets to obtain a verification result.

[0120] Step 706: When the verification result is that the verification passes, store the multiple data sub - packets as an independent file, and use the trigger timestamp corresponding to the current event as the file name of the independent file.

[0121] Among them, the preset quantity can be 200. When it is determined that a high - bitrate key segment is received, 200 data sub - packets of 100Kb can be obtained. When multiple data sub - packets are received completely, integrity verification can be performed on the multiple data sub - packets to obtain a verification result.

[0122] When the verification result is that the verification passes, store the multiple data sub - packets as an independent file. This independent file can be a 20 - second single file with a size of about 20MB. And use the trigger timestamp corresponding to the current event as the file name of the independent file. For example, the file name of the independent file can be high_20231010_141500.mp4, and metadata such as start and end times, trigger reasons, and timestamp information can be recorded. When the verification result is that the verification fails, discard the multiple data sub - packets.

[0123] Optionally, in order to achieve fast retrieval and backtracking, timestamps can be used to ensure the time synchronization of the low - bitrate real - time stream and the high - bitrate key segments, and an index database is established to record the time correspondence between the high - bitrate key segments and the low - bitrate real - time stream. The content includes the fragment file path, start and end times, and associated segmented files. After a user discovers an abnormal event in the low - bitrate real - time stream, the index database can be queried according to the timestamp to retrieve the corresponding high - bitrate key segment, and the high - bitrate key segment and the low - bitrate real - time stream can be loaded for synchronous playback or comparative analysis. By aligning the dual - bitrate data with timestamps, after the user locates an event in the low - bitrate stream, the corresponding high - bitrate segment can be quickly retrieved for detailed analysis. This system realizes efficient video monitoring in a bandwidth - limited environment, ensuring the smoothness of real - time monitoring and the high - quality backtracking of key events, and is suitable for monitoring scenarios that require both real - time performance and event analysis.

[0124] In this embodiment, the low - bitrate real - time stream and the high - bitrate key segments are stored respectively through the above - mentioned first preset storage strategy and second preset storage strategy. Through classified reception, independent storage, and timestamp alignment, the real - time monitoring of the low - bitrate real - time stream and the high - quality backtracking of the high - bitrate key segments are realized, providing an efficient solution for the video monitoring system in an environment with limited bandwidth and storage resources.

[0125] The present application provides a video transmission method, which includes: separately performing dual-channel independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology to generate a low-bitrate real-time stream and a high-bitrate cached stream; allocating a first preset bandwidth to the low-bitrate real-time stream for real-time playback processing; performing dynamic cache management on the high-bitrate cached stream using a circular buffer; and when it is detected that the current scene has changed, obtaining a high-bitrate key segment from the high-bitrate cached stream, allocating a second preset bandwidth for transmission, and storing the low-bitrate real-time stream and the high-bitrate key segment. The low-bitrate real-time stream generated by the dual-channel independent encoding in this solution can be continuously transmitted to ensure the smoothness of real-time monitoring. The generated high-bitrate cached stream starts to actively transmit only when the current scene has changed, improving the flexibility and transmission efficiency of video transmission, and achieving a balance between the smoothness of real-time monitoring and the high-quality backtracking of key events in a bandwidth-constrained environment. Additionally, by using a circular buffer to perform dynamic cache management on the high-bitrate cached stream, the integrity and accessibility of key event segments can be ensured while optimizing storage resources.

[0126] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0127] Figure 8 It is a structural block diagram of a video transmission device provided by an embodiment of the present application.

[0128] As Figure 8 shown, the video transmission device 800 includes:

[0129] A generation module 802, configured to separately perform dual-channel independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology to generate a low-bitrate real-time stream and a high-bitrate cached stream.

[0130] A first processing module 804, configured to allocate a first preset bandwidth to the low-bitrate real-time stream for real-time playback processing.

[0131] A second processing module 806 is configured to perform dynamic caching management on the high-bitrate cached stream using a circular buffer, and when it is detected that the current scene has changed, obtain high-bitrate key segments from the high-bitrate cached stream and allocate a second preset bandwidth for transmission.

[0132] A storage module 808 is configured to store the low-bitrate real-time stream and the high-bitrate key segments.

[0133] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein. Each module in the above video transmission device can be implemented in whole or in part by software, hardware, and their combinations. The above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so that the processor can call and execute the operations of the above modules.

[0134] In an embodiment of the present application, a computer device is provided. The computer device includes a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:

[0135] Perform dual-channel independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low-bitrate real-time stream and a high-bitrate cached stream;

[0136] Allocate a first preset bandwidth for real-time playback processing of the low-bitrate real-time stream;

[0137] Perform dynamic caching management on the high-bitrate cached stream using a circular buffer, and when it is detected that the current scene has changed, obtain high-bitrate key segments from the high-bitrate cached stream and allocate a second preset bandwidth for transmission;

[0138] Store the low-bitrate real-time stream and the high-bitrate key segments.

[0139] In an embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:

[0140] Use a first storage block to store first high-bitrate video data within a first preset time period; wherein, the first high-bitrate video data includes first valid data and overlapping data;

[0141] Use a second storage block to store second high-bitrate video data within a second preset time period; wherein, the second high-bitrate video data includes overlapping data and second valid data, and the second valid data is located after the overlapping data;

[0142] When the first storage block is full, repeat the steps of updating the second preset time period to generate a new second preset time period, storing the high-bitrate video data within the new second preset time period as new second high-bitrate video data in the second storage block, and using the new second high-bitrate video data as new first high-bitrate video data to overwrite the first high-bitrate video data in the first storage block.

[0143] In one embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:

[0144] When it is detected that the current scene has changed, obtain the current marked timestamp;

[0145] Based on the current marked timestamp, extract high-bitrate key segments from the main buffer area of the circular buffer; wherein, the high-bitrate key segments include high-bitrate video data and metadata corresponding to the current event.

[0146] In one embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:

[0147] Copy the high-bitrate key segments to the secondary cache pool;

[0148] Use the secondary cache pool to store the high-bitrate key segments independently.

[0149] In one embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:

[0150] When it is determined that a low-bitrate real-time stream is received, store it according to the first preset storage policy;

[0151] When it is determined that a high-bitrate key segment is received, store it according to the second preset storage policy.

[0152] In one embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:

[0153] When it is determined that a low-bitrate real-time stream is received, segment the low-bitrate real-time stream according to a preset duration to obtain a plurality of segmented files;

[0154] Store the plurality of segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file.

[0155] In one embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:

[0156] When it is determined that a high-bitrate key segment is received, obtain a preset number of data sub-packets;

[0157] When multiple data sub - packets are received, perform integrity verification on the multiple data sub - packets to obtain a verification result;

[0158] When the verification result is a pass, store the multiple data sub - packets as an independent file, and use the trigger timestamp corresponding to the current event as the file name of the independent file.

[0159] The computer device provided by the embodiments of the present application has the same implementation principle and technical effects as the above - mentioned method embodiments, and will not be elaborated here.

[0160] In an embodiment of the present application, a computer - readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0161] Perform dual - path independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low - bit - rate real - time stream and a high - bit - rate cached stream;

[0162] Allocate a first preset bandwidth to the low - bit - rate real - time stream for real - time playback processing;

[0163] Adopt a circular buffer to perform dynamic cache management on the high - bit - rate cached stream, and when it is detected that the current scene has changed, obtain high - bit - rate key segments from the high - bit - rate cached stream and allocate a second preset bandwidth for transmission;

[0164] Store the low - bit - rate real - time stream and the high - bit - rate key segments.

[0165] In an embodiment of the present application, when the computer program is executed by a processor, the following steps are also implemented:

[0166] Use a first storage block to store first high - bit - rate video data within a first preset time period; wherein, the first high - bit - rate video data includes first valid data and overlapping data;

[0167] Use a second storage block to store second high - bit - rate video data within a second preset time period; wherein, the second high - bit - rate video data includes overlapping data and second valid data, and the second valid data is located after the overlapping data;

[0168] When the first storage block is full, repeatedly execute the steps of updating the second preset time period to generate a new second preset time period, storing the high - bit - rate video data within the new second preset time period as new second high - bit - rate video data in the second storage block, and using the new second high - bit - rate video data as new first high - bit - rate video data to overwrite the first high - bit - rate video data in the first storage block.

[0169] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0170] When it is detected that the current scene has changed, obtain the current marked timestamp;

[0171] Based on the current marked timestamp, extract high-bitrate key segments from the main buffer area of the circular buffer; wherein, the high-bitrate key segments include high-bitrate video data and metadata corresponding to the current event.

[0172] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0173] Copy the high-bitrate key segments to the secondary cache pool;

[0174] Use the secondary cache pool to store the high-bitrate key segments independently.

[0175] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0176] When it is determined that a low-bitrate real-time stream is received, store it according to the first preset storage policy;

[0177] When it is determined that a high-bitrate key segment is received, store it according to the second preset storage policy.

[0178] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0179] When it is determined that a low-bitrate real-time stream is received, segment the low-bitrate real-time stream according to a preset duration to obtain a plurality of segmented files;

[0180] Store the plurality of segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file.

[0181] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0182] When it is determined that a high-bitrate key segment is received, obtain a preset number of data sub-packets;

[0183] When the reception of the plurality of data sub-packets is completed, perform integrity verification on the plurality of data sub-packets to obtain a verification result;

[0184] When the verification result is verified to pass, store the plurality of data sub-packets as an independent file, and use the trigger timestamp corresponding to the current event as the file name of the independent file.

[0185] The computer-readable storage medium provided in this embodiment has the same implementation principle and technical effects as the above method embodiment, and will not be elaborated here.

[0186] Those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing relevant hardware through a computer program. This computer program can be stored in a non-volatile computer-readable storage medium. When this computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in this application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0187] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0188] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A video transmission method, characterized in that, The method includes: Performing dual-channel independent encoding on the current video stream using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low-bitrate real-time stream and a high-bitrate cached stream; Allocating a first preset bandwidth to the low-bitrate real-time stream for real-time playback processing; Adopting a circular buffer to perform dynamic cache management on the high-bitrate cached stream, and when it is detected that the current scene has changed, obtaining a high-bitrate key segment from the high-bitrate cached stream and allocating a second preset bandwidth for transmission; Storing the low-bitrate real-time stream and the high-bitrate key segment.

2. The method according to claim 1, wherein The circular buffer includes a main buffer area, the main buffer area includes a first storage block and a second storage block that work alternately, the high-bitrate cached stream includes a plurality of high-bitrate video data, and adopting the circular buffer to perform dynamic cache management on the high-bitrate cached stream includes: Using the first storage block to store the first high-bitrate video data within a first preset time period; wherein, the first high-bitrate video data includes first valid data and overlapping data; Using the second storage block to store the second high-bitrate video data within a second preset time period; wherein, the second high-bitrate video data includes the overlapping data and second valid data, and the second valid data is located after the overlapping data; When the first storage block is full, repeatedly execute the step of updating the second preset time period to generate a new second preset time period when the first storage block is full, storing the high-bitrate video data within the new second preset time period as new second high-bitrate video data in the second storage block, and using the new second high-bitrate video data as new first high-bitrate video data to overwrite the first high-bitrate video data in the first storage block.

3. The method according to claim 1 or 2, characterized in that, The step of obtaining the high-bitrate key segment from the high-bitrate cached stream when it is detected that the current scene has changed includes: When it is detected that the current scene has changed, obtaining the current marked timestamp; Based on the current marked timestamp, extracting the high-bitrate key segment from the main buffer area of the circular buffer; wherein, the high-bitrate key segment includes high-bitrate video data and metadata corresponding to the current event.

4. The method according to claim 3, wherein The circular buffer further includes a secondary cache pool, and the method further includes: Copying the high-bitrate key segment to the secondary cache pool; Using the secondary cache pool to independently store the high-bitrate key segment.

5. The method according to claim 1 or 2, characterized in that, The step of storing the low-bitrate real-time stream and the high-bitrate key segment includes: When it is determined that the low-bitrate real-time stream is received, storing it according to a first preset storage strategy; When it is determined that the high-bitrate key segment is received, storing it according to a second preset storage strategy.

6. The method according to claim 5, wherein The step of storing the low-bitrate real-time stream according to the first preset storage strategy when it is determined that the low-bitrate real-time stream is received includes: When it is determined that the low-bitrate real-time stream is received, segmenting the low-bitrate real-time stream according to a preset duration to obtain a plurality of segmented files; Store the multiple segmented files, and use the timestamp corresponding to the segmented file as the file name of the segmented file.

7. The method according to claim 5, characterized in that, When it is determined that the high-bitrate key segment is received, storage is performed according to a second preset storage policy, including: When it is determined that the high-bitrate key segment is received, obtain a preset number of data sub-packets; When the reception of the multiple data sub-packets is completed, perform integrity verification on the multiple data sub-packets to obtain a verification result; When the verification result is verified to pass, store the multiple data sub-packets as an independent file, and use the trigger timestamp corresponding to the current event as the file name of the independent file.

8. A video transmission device, characterized in that, The device includes: A generation module for independently encoding the current video stream using H.264 video encoding technology and H.265 video encoding technology respectively to generate a low-bitrate real-time stream and a high-bitrate cached stream; A first processing module for performing real-time playback processing on the low-bitrate real-time stream by allocating a first preset bandwidth; A second processing module for dynamically caching and managing the high-bitrate cached stream using a circular buffer, and when it is detected that the current scene changes, obtaining a high-bitrate key segment from the high-bitrate cached stream and allocating a second preset bandwidth for transmission; A storage module for storing the low-bitrate real-time stream and the high-bitrate key segment.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the video transmission method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, At least one instruction, at least one program, a code set or an instruction set is stored in the storage medium. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the video transmission method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for enhancing monitoring video compression ratio

    CN101742294A

  • Method and equipment for storing variable-bit rate video

    CN102244785A

  • Method for distributing low-bit-rate video streaming composite high definition graphic data and bandwidth of low-bit-rate video streaming composite high definition graphic data

    CN103647980A

  • Video image accelerated scheduling method based on airport multi-level video networking architecture

    CN119182943A

  • TV program making system and method with double-bit rate video stream

    CN1404302A