Video stream management method and computing device

By using circular buffer and frame skipping mechanisms in video stream management, the problem of buffer overflow in traditional buffer management methods in high-bit rate video stream processing is solved, real-time and continuity of video streams are realized, and the system is improved Robustness and user experience.

CN119071528APending Publication Date: 2024-12-03SHENZHEN CORERAIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410951843.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Traditional buffer management methods can easily cause buffer overflow when processing high bit rate video streams, and cannot effectively deal with sudden changes in network or system load, affecting the real-time and stability of video streams.

Method used

Use a circular buffer and set the write operation, read operation and status monitoring mechanism to calculate the effective data length, trigger the frame skipping mechanism to discard the currently written video image group, record the header address of the video image group by maintaining the data structure, and flexibly adjust the Read and write pointers to avoid buffer overflow.

Benefits of technology

It effectively avoids buffer overflow, ensures the real-time and continuity of video streams, improves the smoothness and user experience of video playback, and enhances the robustness and adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071528A_ABST
    Figure CN119071528A_ABST
Patent Text Reader

Abstract

The invention provides a video stream management method and computing equipment. The method comprises the following steps: setting a circular buffer area; performing write operation on the circular buffer area, writing a video bit stream into the circular buffer area, updating a write pointer and monitoring the state of the circular buffer area; maintaining a data structure, wherein the data structure is used for storing the address of the head of each video image group; the effective data length is calculated, if the effective data length exceeds a preset capacity threshold value of the circular buffer area, a frame skipping mechanism is triggered, the effective data length represents the length of data which is not read in the circular buffer area, and the frame skipping mechanism abandons the currently read video image group. According to the method provided by the invention, the buffer overflow can be effectively avoided, and the real-time performance and continuity of the video stream are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video stream processing, and in particular to a method and computing device for video stream management. Background Art

[0002] During video stream processing, the write speed of the buffer sometimes exceeds the read speed, resulting in buffer overflow. Traditional buffer management methods mainly focus on fixed-size buffer allocation, data read and write control, and synchronization mechanisms. Traditional buffers often pre-allocate fixed-size space, which limits their flexibility. In addition, for data packets of different sizes or changing data traffic, fixed buffers may cause low space utilization, either wasting space or failing to process certain data due to insufficient space. Traditional buffer management can easily lead to full buffers when the network is congested or data bursts occur, which in turn affects the stability and response speed of the entire system.

[0003] In order to solve the problem that traditional buffer management methods lack an effective mechanism to cope with sudden changes in network or system load, especially when processing high-bitrate video streams, a technical solution is needed to avoid buffer overflow and ensure the real-time processing capability of video streams. Summary of the invention

[0004] The present invention aims to provide a method for video stream management, which can effectively avoid buffer overflow and ensure the real-time and continuity of the video stream.

[0005] According to one aspect of the present invention, there is provided a method for video stream management, comprising:

[0006] Set up a circular buffer;

[0007] Performing a write operation on the circular buffer, writing a video bitstream into the circular buffer, updating a write pointer and monitoring a state of the circular buffer;

[0008] Maintaining a data structure for storing the address of each video group of pictures header;

[0009] The effective data length is calculated. If the effective data length exceeds a preset threshold of the capacity of the circular buffer, a frame skipping mechanism is triggered. The effective data length represents the length of data that has not been read in the circular buffer. The frame skipping mechanism discards the currently written video image group.

[0010] According to some embodiments, calculating the effective data length comprises:

[0011] When the read pointer is smaller than the write pointer, the effective data length is the difference between the write pointer and the read pointer;

[0012] When the read pointer is greater than the write pointer, the effective data length is the total size of the circular buffer minus the difference between the read pointer and the write pointer.

[0013] According to some embodiments, maintaining the data structure comprises:

[0014] Each time a write operation is performed on the circular buffer, it is checked whether the written data is a video group of pictures header. If it is a video group of pictures header, the corresponding video group of pictures header address is recorded and saved in the data structure.

[0015] According to some embodiments, the video group of pictures header is a key frame of the video bitstream.

[0016] According to some embodiments, the aforementioned method further comprises:

[0017] The fixed size of the circular buffer is preset.

[0018] According to some embodiments, the data structure comprises an array or a linked list.

[0019] According to some embodiments, the triggering frame skipping mechanism includes:

[0020] Find the next video picture group header address closest to the current read pointer from the data structure;

[0021] The read pointer is moved forward to the next video picture group head address.

[0022] According to some embodiments, the aforementioned method further comprises: the video decoder reading the bit stream from the circular buffer and updating the read pointer.

[0023] According to another aspect of the present invention, a computing device is provided, comprising a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes any of the above methods.

[0024] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, and when the computer program is executed by a processor, the processor is enabled to execute any one of the above methods.

[0025] This example embodiment can flexibly adjust according to the actual occupancy situation by monitoring the buffer status and setting the frame skipping mechanism, selectively skip non-key frame data, effectively control the data growth rate of the buffer, and effectively avoid buffer overflow.

[0026] This example embodiment comprehensively considers the writing of video data and the reading of the video decoder to accurately record the head position of each video image group. When frame skipping is required, it can directly jump to the starting position of the next complete video image group, maintain the continuity of the video content, ensure the continuity and correctness of the video playback, and maintain the smoothness of the video playback and a good user experience.

[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.

[0029] Figure 1 A flow chart of a method for video stream management according to an example embodiment is shown.

[0030] Figure 2 A method flow chart of a decoder read operation according to an example embodiment is shown.

[0031] Figure 3 A schematic diagram illustrating valid data length according to an example embodiment.

[0032] Figure 4 A block diagram of a computing device according to an example embodiment of the invention is shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0034] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0037] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the present inventive concept. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0038] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0039] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present invention, and therefore cannot be used to limit the protection scope of the present invention.

[0040] In real-time video streaming or video editing, the location of the GOP header is very important for smooth video playback and editing. If the GOP header is lost during transmission, the content of the entire GOP may not be displayed correctly because subsequent P frames and B frames rely on I frames for decoding. Therefore, when designing video encoding and transmission solutions, the structure and size of the GOP are usually taken into account to ensure reliable transmission and efficient encoding of video content.

[0041] Therefore, in order to ensure the real-time processing capability of video streams, a method for video stream management is needed.

[0042] Before describing the embodiments of the present invention, some terms or concepts involved in the embodiments of the present invention are explained.

[0043] GOP (Group of Pictures) is a term in the field of video coding, especially when using the MPEG series of standards (such as MPEG-2, H.264, H.265, etc.) for video compression. A GOP is a group of consecutive video frames that work together to achieve efficient video data compression.

[0044] I frame (Intra-coded frame / Key frame), a key frame is a complete independent frame, which can be understood as a complete picture and does not need to rely on other frames for decoding. I frame is the beginning of GOP and does not need to refer to other frames when decoding.

[0045] P frame (Predictive frame), the forward prediction frame refers to one or more previous frames (usually the most recent I frame or P frame) and only stores the changes compared to the previous frame.

[0046] B frame (Bi-directional predicted frame), a bidirectional predicted frame can refer to the previous and next (future) frames, and further improve the compression efficiency through bidirectional prediction.

[0047] Exemplary embodiments of the present invention are described below with reference to the accompanying drawings.

[0048] In a video stream, the GOP header marks the beginning of a new GOP, and subsequent P frames and B frames rely on the I frame for decoding and display. The GOP header usually contains an I frame, also known as a key frame. The I frame is a fully encoded frame that contains enough information to display a frame of image independently without relying on previous frames, but the compression efficiency of the I frame is relatively low because it contains all the information of the scene. The compression efficiency of P frames is higher than that of I frames because P frames utilize temporal redundant information. B frames provide the highest compression rate, but they need to be decoded in a specific order and cannot be used as random access points. In video coding, I frames are often used as reference frames for subsequent P frames and B frames.

[0049] Circular buffers are a commonly used data structure that is particularly useful in scenarios where data needs to be continuously added and removed while maintaining efficient memory usage, such as processing bitstream data during video encoding, decoding, and transmission.

[0050] According to some embodiments, the management of the circular buffer includes buffer initialization, setting of write pointer and read pointer, and effective data length calculation.

[0051] According to some embodiments, a circular buffer is set, and the circular buffer is initialized by setting a fixed-size buffer, such as 10MB. This buffer is a continuous block in the memory and is used to store bitstream data in the video encoding or decoding process. The write pointer indicates the location where new data is written. Whenever new bitstream data arrives, it is written to the location pointed to by the write pointer, and then the write pointer is incremented. When the write pointer reaches the end of the buffer, it will "wrap around" back to the starting position of the buffer, forming a loop. The read pointer indicates where the data should be read from. After the video decoder or other processing unit takes out the data from the read pointer, the read pointer moves forward. Similarly, when the read pointer reaches the end of the buffer, it will also loop back to the beginning.

[0052] According to an example embodiment, the effective data length is calculated, and the schematic diagram of the effective data length is shown in FIG. Figure 3 , when the read pointer lags behind the write pointer (i.e. the written data has not been completely read), the effective data length is equal to the direct difference between the two, i.e.:

[0053] Valid data length = write pointer - read pointer.

[0054] When the read pointer is ahead of the write pointer (indicating that a portion of the data in the circular buffer has been processed, but new data is later written to cover the beginning of the old data), the effective data length needs to be adjusted considering the size of the circular buffer, that is:

[0055] Valid data length = total size of circular buffer - (read pointer - write pointer);

[0056] Or equivalently:

[0057] Valid data length = total size of circular buffer - read pointer + write pointer.

[0058] According to some embodiments, when incrementing the read and write pointers, it is necessary to correctly handle the situation where the pointer wraps around to the starting position of the circular buffer, and to handle the overflow of the circular buffer. When the circular buffer is close to full, it is necessary to pause writing until the reading releases the space, and vice versa, to prevent data loss. The circular buffer can effectively manage the storage and processing of the video bit stream, ensuring data continuity and efficient use of memory resources.

[0059] In real-time video streaming or video editing, the location of the GOP header is very important for smooth video playback and editing. If the GOP header is lost during transmission, the content of the entire GOP may not be displayed correctly because subsequent P frames and B frames rely on I frames for decoding. Therefore, when designing video encoding and transmission solutions, the structure and size of the GOP are usually taken into account to ensure reliable transmission and efficient encoding of video content.

[0060] This example embodiment can ensure that the write operation will not overwrite the unread data by accurately calculating the effective data length. In the circular buffer, the calculation of the effective data length helps the system decide when and how to move the read and write pointers, thereby avoiding data conflicts and losses; at the same time, knowing clearly how much effective data is in the circular buffer can allow the system to use memory more efficiently.

[0061] According to some embodiments, the effective data length is also critical for verifying data integrity. When the receiving end needs to confirm whether the received data is complete, it can compare the expected effective data length with the actual received data length to determine whether there is data omission or error. As a core indicator of the circular buffer status, the effective data length simplifies the synchronization and status monitoring logic of the read and write pointers, making it easier for the system to determine when to stop writing new data and when the circular buffer space can be safely reused, etc., reducing programming complexity and potential error risks.

[0062] The present invention can effectively manage buffer resources and avoid overflow risks while ensuring the continuity and real-time performance of video streams through a refined buffer management strategy. It can not only improve the flexibility and robustness of video stream processing, but also provide users with a smoother and more controllable viewing experience.

[0063] Figure 1 A flow chart of a method for video stream management according to an example embodiment is shown.

[0064] As mentioned above, for the set circular buffer, the user program is responsible for writing the video bit stream into the preset circular buffer according to a predetermined format, and each time new data is written, the write pointer is updated to reflect the latest write position.

[0065] In S101, a write operation is performed on a circular buffer, a video bit stream is written into the circular buffer, a write pointer is updated, and a state of the circular buffer is monitored.

[0066] According to some embodiments, the circular buffer is written to sequentially write the data of the video bitstream to the current write pointer position of the buffer. After the writing is completed, the write pointer is incremented according to the size of the written data. When the write pointer reaches the end of the circular buffer, it needs to be wrapped back to the starting position of the circular buffer to continue writing. After each write operation, the state of the circular buffer is monitored, the write pointer is updated and the state of the circular buffer is monitored. Considering the cyclic characteristics of the buffer, the filling degree of the buffer is evaluated according to the distance between the current write pointer and the read pointer to ensure that the occupied space of the circular buffer is accurately reflected.

[0067] At S103, a data structure is maintained for storing the address of the header of each video picture group.

[0068] According to some embodiments, a data structure, such as an array or a linked list, is maintained. The array is suitable for scenarios where the maximum number of GOPs is known in advance and has a fast access speed; the linked list is more suitable for dynamic expansion and has more flexible insertion and deletion operations. The array or linked list is used to store the GOP header address, initialize an empty array or create an empty linked list to prepare for storing the address of the I frame (GOP header).

[0069] Each time data is written, check whether it is the head of the GOP. If the data currently being written is confirmed to be an I frame, obtain the starting address of the data in the circular buffer and add this address to the previously prepared data structure (array or linked list). If an array is used, the next available index position needs to be tracked; if it is a linked list, a new node is created and linked to the end of the linked list. Record the position and save the address to the data structure. By maintaining this I frame address list, the nearest I frame position can be quickly located when needed. This is critical for achieving fast random access, such as video fast forward and drag-and-drop playback, as well as error recovery, such as resynchronization after a network interruption.

[0070] The data structure is maintained to enhance the management of key data in the video stream, especially the I frame at the start of each GOP, so as to facilitate fast random access, error recovery and adaptive playback control.

[0071] In S105, the effective data length is calculated. If the effective data length exceeds a preset threshold of the capacity of the circular buffer, a frame skipping mechanism is triggered.

[0072] According to some embodiments, a threshold check is performed, and a threshold of the circular buffer capacity is pre-set, such as 80% of the circular buffer, and each time the valid data length is checked to see if it exceeds the threshold. If it exceeds, it means that the circular buffer is about to or has faced the risk of overflow, and the frame skipping mechanism is triggered.

[0073] After detecting that the circular buffer is nearly full, locate the nearest GOP header and skip the current GOP. From the recorded GOP header address list, find the I frame address closest to the current read pointer position. After determining the target I frame address, directly update the read pointer to the starting position of the I frame, skipping all data between the current read pointer and the target I frame, including the current incomplete GOP and all frames within it (P frames, B frames, etc.).

[0074] After the jump, update the status and record, recalculate the effective data length, and ensure the consistency of the system status. At the same time, if there is any log or error recovery mechanism related to the skipped frame, it should also be updated accordingly at this time.

[0075] Figure 2 Flow diagram of triggering a frame skipping mechanism according to an example embodiment.

[0076] In S201, the next video picture group header address closest to the current read pointer is found from the data structure.

[0077] According to some embodiments, based on the previously recorded GOP header address data structure, which may be an array or a linked list, the GOP header address closest to the current read pointer position but before the read pointer is found. It is ensured that one or more complete GOPs are skipped, rather than jumping to the middle of a GOP, to avoid decoding errors. In other words, the oldest GOP group is found, so that the oldest GOP group can be skipped, i.e., discarded.

[0078] In S203, the read pointer is moved forward to the head address of the next video picture group.

[0079] According to some embodiments, the read pointer is directly updated to the found previous GOP header address, that is, all data from the current read pointer position to the GOP header will be skipped, thereby releasing buffer space and preventing overflow.

[0080] According to some embodiments, the data is moved to the starting position of a key frame in a video bitstream for reading. Starting from this new write pointer position, the reading of the video bitstream will start directly from the next key frame (I frame). The system needs to parse the video stream, confirm the exact position of the key frame, and continue the data reading operation from this position.

[0081] By triggering the frame skipping mechanism, this example embodiment enables the system to effectively manage buffer resources and prevent data overflow while ensuring the continuity of video streams and playback experience, which is particularly important when processing high-bit rate video streams.

[0082] During the video decoding process, the video decoder reads the bitstream from the circular buffer and updates the read pointer. The reading operation not only involves simply reading the bitstream data from the circular buffer, but also includes ensuring the integrity of the data, especially when it comes to the incomplete GOP processing that may be generated after the frame skipping mechanism.

[0083] According to some embodiments, the video decoder reads the video bitstream data from the circular buffer according to the current read pointer. After each read, the read pointer is updated to point to the next position to be read.

[0084] First, the integrity of the video image group is detected. According to some embodiments, the decoder needs to parse the read data, identify the frame type, and determine whether it is an I frame, a P frame, or a B frame. If it is found that the currently read data does not belong to a complete GOP, for example, the reading starts from a certain P frame or B frame and lacks the preceding I frame, the decoder needs to determine whether this situation is caused by the frame skipping mechanism.

[0085] According to some embodiments, when encountering an incomplete GOP, the decoder should not attempt to decode the data, but directly look for the starting position of the next I frame. This can be achieved by looking up the previously recorded I frame address list and jumping directly to the starting point of the next valid GOP. Then the read pointer is updated to point to the starting position of the first I frame of the next complete GOP. After successfully locating the I frame of the next complete GOP, the decoder starts the normal decoding process to ensure the continuity and correctness of the video playback.

[0086] The dynamic frame skipping mechanism of this example embodiment is flexibly adjusted according to the actual occupancy of the circular buffer, and takes immediate action once it is detected that the circular buffer is close to full. By selectively skipping non-key frame data, the data growth rate of the circular buffer is effectively controlled, and the problem of circular buffer overflow is avoided. This not only protects the stability of the system, but also reduces the phenomenon of playback interruption caused by data loss or processing errors.

[0087] According to some embodiments, high-bitrate video streams are often more likely to cause buffer management problems due to their data density and high requirements for network bandwidth and processing power. Dynamic frame skipping combined with GOP-level intelligent skipping strategy provides an effective solution for processing such video streams. It can not only effectively alleviate the playback pressure when the network is unstable or the device resources are limited, but also enable the system to better adapt to the video transmission and playback requirements under different conditions.

[0088] By accurately recording the head position of each GOP, when a frame skip is needed, it can jump directly to the beginning of the next complete GOP instead of arbitrarily stopping at a certain frame. This method ensures that even when the frame skip strategy is implemented, the basic continuity of the video content can be maintained, avoiding picture jumps or logical confusion caused by erroneous frame skipping. In addition, combined with smooth playback technology and timely frame interpolation, the user experience can be further improved.

[0089] The present invention comprehensively considers the writing of video data, buffer management and dynamic frame skipping strategy to ensure the efficiency and continuity of video stream processing. Based on the above steps, buffer overflow can be effectively avoided, while maintaining the smoothness of video playback and user experience as much as possible under resource constraints.

[0090] In summary, the present invention combines dynamic frame skipping and GOP management buffer strategies, and through intelligent and forward-looking data processing methods, significantly improves the robustness and adaptability of the video stream processing system, ensuring high-quality transmission and playback of video content in various complex environments and high-demand scenarios.

[0091] Figure 4 A block diagram of a computing device according to an example embodiment of the invention is shown.

[0092] like Figure 4 As shown, computing device 30 includes processor 12 and memory 14. Computing device 30 may also include bus 22, network interface 16, and I / O interface 18. Processor 12, memory 14, network interface 16, and I / O interface 18 may communicate with each other via bus 22.

[0093] The processor 12 may include one or more general-purpose CPUs (Central Processing Units, processors), microprocessors, or application-specific integrated circuits, etc., for executing relevant program instructions. According to some embodiments, the computing device 30 may also include a high-performance graphics card (GPU) 20 for accelerating the processor 12.

[0094] The memory 14 may include a machine system readable medium in the form of a volatile memory, such as a random access memory (RAM), a read-only memory (ROM) and / or a cache memory. The memory 14 is used to store one or more programs including instructions and data. The processor 12 can read the instructions stored in the memory 14 to execute the above-mentioned method according to the embodiment of the present invention.

[0095] The computing device 30 may also communicate with one or more networks via the network interface 16. The network interface 16 may be a wireless network interface.

[0096] The bus 22 may include an address bus, a data bus, a control bus, etc. The bus 22 provides a path for exchanging information between components.

[0097] It should be noted that, in the specific implementation process, the computing device 30 may also include other components necessary for normal operation. In addition, those skilled in the art may understand that the above device may only include components necessary for implementing the embodiments of this specification, and need not include all components shown in the figure.

[0098] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), a network storage device, a cloud storage device, or any type of medium or device suitable for storing instructions and / or data.

[0099] An embodiment of the present invention also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method recorded in the above method embodiments.

[0100] Those skilled in the art can clearly understand that the technical solution of the present invention can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array, an integrated circuit, etc.

[0101] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0102] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0103] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0105] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.

[0107] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0108] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended clauses.

Claims

1. A method for video stream management, characterized in that: include: Set up a circular buffer; Performing a write operation on the circular buffer, writing a video bitstream into the circular buffer, updating a write pointer and monitoring a state of the circular buffer; Maintaining a data structure for storing the address of each video group of pictures header; The effective data length is calculated. If the effective data length exceeds a preset threshold of the capacity of the circular buffer, a frame skipping mechanism is triggered. The effective data length represents the length of data that has not been read in the circular buffer. The frame skipping mechanism discards the video image group currently being read.

2. The method according to claim 1, characterized in that Calculating the effective data length includes: When the read pointer is smaller than the write pointer, the effective data length is the difference between the write pointer and the read pointer; When the read pointer is greater than the write pointer, the effective data length is the total size of the circular buffer minus the difference between the read pointer and the write pointer.

3. The method according to claim 1, characterized in that The maintenance data structure includes: Each time a write operation is performed on the circular buffer, it is checked whether the written data is a video picture group header. If it is a video picture group header, the corresponding video picture group header address is recorded and saved in the data structure.

4. The method according to claim 3, characterized in that The video group of pictures header is a key frame of the video bit stream.

5. The method according to claim 1, characterized in that Also includes: The fixed size of the circular buffer is preset.

6. The method according to claim 1, characterized in that The data structure includes an array or a linked list.

7. The method according to claim 1, characterized in that The trigger frame skipping mechanism includes: Find the next video picture group header address closest to the current read pointer from the data structure; The read pointer is moved forward to the head address of the next video picture group.

8. The method according to claim 1, characterized in that Also includes: The video decoder reads the bitstream from the circular buffer and updates the read pointer.

9. A computing device, characterized in that include: Case Number: processor; as well as A memory storing a computer program, which, when executed by the processor, enables the processor to perform the method according to claims 1 to 8.

10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.