Decoding method of concurrent video session IP frame image group

文档序号:938975 发布日期:2021-03-05 浏览:16次 中文

阅读说明:本技术 一种并发视频会话ip帧图像组的解码方法 (Decoding method of concurrent video session IP frame image group ) 是由 张玉晓 徐珠宝 赵志伟 刘长鑫 王继五 孙浩 贺志强 李静 刘立 于 2019-09-05 设计创作,主要内容包括:本申请公开了一种并发视频会话IP帧图像组的解码方法,该解码方法包括:步骤S1,对接收到的数据片段进行缓存,并依次对数据片段进行解码,当判定数据片段的最后一帧待解码视频帧不是完整帧时,判断最后一帧待解码视频帧是否为I帧,若是,保存I帧,记作拼接帧,并清除缓存的数据片段,若否,执行步骤S2;步骤S2,将缓存的解码尾帧进行I帧编码,记作拼接I帧,保存拼接I帧和最后一帧待解码视频帧,记作拼接帧,并清除缓存的数据片段;步骤S3,将拼接帧与下一个数据片段的首帧进行拼接,并对拼接后的下一个数据片段进行解码。通过本申请中的技术方案,解决了并发解码丢帧问题,降低数据缓存的存储空间,优化了并发解码的实时性。(The application discloses a method for decoding concurrent video session IP frame image groups, which comprises the following steps: step S1, caching the received data segments, decoding the data segments in sequence, judging whether the video frame to be decoded of the last frame is an I frame or not when judging that the video frame to be decoded of the last frame of the data segments is not a complete frame, if so, storing the I frame, recording the I frame as a spliced frame, clearing the cached data segments, and if not, executing step S2; step S2, I frame coding is carried out on the cached decoding tail frame, the I frame is recorded as a splicing I frame, the splicing I frame and the video frame to be decoded of the last frame are stored and recorded as splicing frames, and the cached data segment is removed; and step S3, splicing the spliced frame with the first frame of the next data segment, and decoding the spliced next data segment. By the technical scheme, the problem of frame loss in concurrent decoding is solved, the storage space of data cache is reduced, and the real-time performance of concurrent decoding is optimized.)

1. A decoding method of concurrent video session IP frame image group is suitable for decoding concurrent data segment of multi-channel video session, the data segment is composed of image group, the image group contains multi-frame video frame to be decoded, characterized in that the decoding method includes:

step S1, caching the received data segments, decoding the data segments in sequence, judging whether the last frame of video frame to be decoded of the data segments is an I frame when judging that the last frame of video frame to be decoded of the data segments is not a complete frame, if so, storing the I frame, recording the I frame as a spliced frame, clearing the cached data segments, and if not, executing step S2;

step S2, I frame coding is carried out on the cached decoding tail frame, the I frame is recorded as a splicing I frame, the splicing I frame and the video frame to be decoded of the last frame are stored and recorded as the splicing frame, and the cached data segment is eliminated;

and step S3, splicing the spliced frame with the first frame of the next data segment, and decoding the spliced next data segment.

2. The method for decoding a group of pictures in concurrent video session IP frames according to claim 1, wherein said decoding method further comprises:

when the video frame to be decoded of the last frame is judged to be a complete frame, the video frame to be decoded of the last frame is decoded, whether the video frame to be decoded of the last frame is an I frame or not is judged,

if yes, saving the I frame, recording as the spliced frame, clearing the cached data segment, executing step S3,

if not, I-frame encoding is carried out on the decoded video frame of the last frame of the video frame to be decoded, the I-frame encoded video frame is stored and recorded as the spliced frame, the cached data segment is cleared, and the step S3 is executed.

3. The method as claimed in claim 1, wherein the data segment is an IP frame, and the decoding end frame is a video frame to be decoded and a decoded video frame of a penultimate frame in the data segment.

4. The method for decoding a concurrent video session IP frame group of pictures according to claim 3, wherein said step S2 comprises:

step S201, judging whether the video frame to be decoded of the penultimate frame is an I frame, if so, executing step S202, and if not, executing step S203;

step S202, recording the I frame as the spliced I frame, storing the spliced I frame and the last frame to-be-decoded video frame, and recording the spliced I frame and the last frame as the spliced frame;

step S203, carrying out I frame coding on the decoding tail frame to generate the spliced I frame, storing the spliced I frame and the last frame video frame to be decoded, and recording as the spliced frame;

and step S204, clearing the cached data segments.

5. The method for decoding a concurrent video session IP frame group of pictures according to any one of claims 3 to 4, wherein decoding a data fragment specifically comprises:

step S101, reading a first to-be-decoded video frame in the cached data segment, and determining whether the first to-be-decoded video frame is a P frame, if not, performing step S102, and if so, performing step S103;

step S102, clearing a second video frame to be decoded which is cached before the first video frame to be decoded and a corresponding cached second video frame to be decoded, decoding the current first video frame to be decoded to generate a first video frame to be decoded, and caching the current first video frame to be decoded and the first video frame to be decoded;

step S103, decoding the current P frame according to the second decoded video frame cached before to generate the first decoded video frame, clearing the second to-be-decoded video frame cached before and the corresponding second decoded video frame, and caching the current P frame and the first decoded video frame;

and step S104, outputting the first decoding video frame.

Technical Field

The application relates to the technical field of video processing, in particular to a method for decoding concurrent video session IP frame image groups.

Background

The parallelism of video session decoding can be realized by multiple processes or multiple threads, but the number of processes/threads cannot be too large in consideration of system performance and resource problems, and when the number of video sessions to be decoded in parallel is far beyond the number of processes/threads, multiple video sessions need to be decoded in one process/thread simultaneously.

In the concurrent decoding process, the video content of each video session is extracted and spliced into data segments by the fragmented network data packet load, and then decoded, and the decoding process/thread alternately decodes the data segments of different video sessions. Due to the excessive number of video sessions, a corresponding decoding context is maintained for each session, which occupies a great deal of storage resources, and therefore, each data segment can only be decoded independently. Therefore, when the memory resource is limited and the decoding context resource cannot be maintained for each path of video, the problem of frame loss caused by segmented concurrent decoding occurs, and the decoding requirement that the whole amount of frames cannot be lost cannot be met.

The video session is a complete unit of decoding by taking a group of pictures as a starting unit, wherein the group of pictures starts with an I frame and is followed by a plurality of video frames to be decoded with frame types of P frames, wherein the I frame can be independently decoded, and the P frames need to be decoded depending on the decoding result of the previous I frame or P frame. For a group of pictures comprising I frames and P frames, where the type of the group of pictures is an IP frame type, the acquisition order, the encoding order, the storage order, the decoding order, and the storage order of the video frames to be decoded in the group of pictures are the same, i.e., in such a group of pictures, sequential decoding can be performed.

During concurrent decoding, the group of pictures in each video session is split into different data segments, and the decoding process/thread alternately decodes the different data segments. However, due to the uncertainty of the data fragment dividing manner, it cannot be guaranteed that the first frame of each divided data fragment is an I frame in the current image group, and therefore, there is a problem that data before the first I frame in the data fragment is lost due to the inability to decode.

In the prior art, in order to solve the problem of data frame loss, a data caching method is usually adopted to splice cached data into a current data segment, and the method specifically includes the following two methods:

1. and caching the last I frame in the previous data segment, splicing the cached I frame to the front end of the current data segment, decoding the spliced data segment, and caching the last I frame of the current data segment so as to decode the next data segment. In this method, not only the buffered I-frame is decoded repeatedly, but also, in the current data segment, for the video frame to be decoded from the buffered I-frame, there is a possibility that the decoding of the currently decoded video frame to be decoded is distorted due to the lack of the video content of the previous frame.

2. Buffering the last I frame in the previous data segment and all P frames behind the I frame, splicing the buffered I frame and P frames to the front end of the current data segment, decoding the spliced data segment, and buffering the last I frame of the current data segment and all P frames behind the I frame so as to decode the next data segment. In this method, repeated decoding exists in both buffered I-frames and P-frames, resulting in higher decoding delay. Under the multi-path concurrent scene, the occupied cache space is also larger.

Disclosure of Invention

The purpose of this application lies in: the problem of frame loss in concurrent decoding is solved, meanwhile, the storage space of data cache is reduced, and the real-time performance of concurrent decoding is optimized.

The technical scheme of the application is as follows: the method for decoding the IP frame image group of the concurrent video session is suitable for decoding the concurrent data segment of the multi-channel video session, the data segment consists of the image group, the image group contains a plurality of frames of video frames to be decoded, and the decoding method comprises the following steps: step S1, caching the received data segments, decoding the data segments in sequence, judging whether the video frame to be decoded of the last frame is an I frame or not when judging that the video frame to be decoded of the last frame of the data segments is not a complete frame, if so, storing the I frame, recording the I frame as a spliced frame, clearing the cached data segments, and if not, executing step S2; step S2, I frame coding is carried out on the cached decoding tail frame, the I frame is recorded as a splicing I frame, the splicing I frame and the video frame to be decoded of the last frame are stored and recorded as splicing frames, and the cached data segment is removed; and step S3, splicing the spliced frame with the first frame of the next data segment, and decoding the spliced next data segment.

In any of the above technical solutions, further, the decoding method further includes: and when the last frame of video frame to be decoded is judged to be a complete frame, decoding the last frame of video frame to be decoded, judging whether the last frame of video frame to be decoded is an I frame or not, if so, storing the I frame, recording the I frame as a spliced frame, clearing the cached data segment, executing the step S3, otherwise, performing I frame coding on the decoded video frame of the last frame of video frame to be decoded, storing the I frame, recording the I frame as the spliced frame, clearing the cached data segment, and executing the step S3.

In any of the above technical solutions, further, the data segment is an IP frame, and the decoding end frame is a video frame to be decoded and a decoded video frame of a penultimate frame in the data segment.

In any one of the above technical solutions, further, step S2 includes: step S201, judging whether the video frame to be decoded of the penultimate frame is an I frame, if so, executing step S202, and if not, executing step S203; step S202, recording the frame I as a spliced frame I, storing the spliced frame I and the last frame video frame to be decoded, and recording the frame I as a spliced frame; step S203, I-frame coding is carried out on the decoding tail frame to generate a splicing I frame, the splicing I frame and the last frame of video frame to be decoded are stored and recorded as splicing frames; and step S204, clearing the cached data segments.

In any of the above technical solutions, further decoding the data fragment specifically includes: step S101, reading a first to-be-decoded video frame in the cached data segment, determining whether the first to-be-decoded video frame is a P frame, if not, performing step S102, and if so, performing step S103; step S102, clearing a second video frame to be decoded which is cached before a first video frame to be decoded and a corresponding cached second video frame to be decoded, decoding the current first video frame to be decoded to generate a first video frame to be decoded, and caching the current first video frame to be decoded and the first video frame to be decoded; step S103, decoding the current P frame according to the previous second decoded video frame to generate the first decoded video frame, clearing the previous second video frame to be decoded and the corresponding second decoded video frame, and caching the current P frame and the first decoded video frame; step S104, outputting the first decoding video frame.

The beneficial effect of this application is:

the method has the advantages that the decoding tail frame and the last frame video frame are stored by judging the type of the received last frame video frame, so that the first frame of the next data segment can be spliced conveniently, the problem of concurrent decoding frame loss caused by lack of an I frame or an intermediate video frame of the next data segment is solved, meanwhile, different video frames are stored by judging the type of the video frame contained in the decoding tail frame, the storage space of the last data segment video frame stored for decoding the next data segment is reduced, and under the same coding and decoding method, the storage space of the method is at least one frame video frame (the video frame is the I frame) and at most two frames video frames (the last frame video frame is the incomplete P frame).

According to the method and the device, all video frames in any data segment are decoded, and I frame coding and storage are performed on the decoded video frames of the non-I frames at the tail part of the data segment, so that the memory occupation is reduced, repeated decoding of the video frames at the tail part of the data segment is avoided, the real-time performance of concurrent decoding in a video session is improved, the performance loss is reduced, and the 100% frame rate can be ensured.

Drawings

The advantages of the above and/or additional aspects of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:

fig. 1 is a schematic flow chart of a prior art decoding method of concurrent video session IP frame group of pictures;

FIG. 2 is a schematic flow diagram of a method of decoding a group of concurrent video session IP frame pictures according to one embodiment of the present application;

FIG. 3 is a schematic illustration of a last frame category in an IP frame data fragment according to an embodiment of the present application;

FIG. 4 is a schematic flow chart diagram of a method of IP frame decoding according to one embodiment of the present application;

fig. 5 is a schematic illustration of buffering of original frame information and decoded frame information according to an embodiment of the present application.

Detailed Description

In order that the above objects, features and advantages of the present application can be more clearly understood, the present application will be described in further detail with reference to the accompanying drawings and detailed description. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.

In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, however, the present application may be practiced in other ways than those described herein, and therefore the scope of the present application is not limited by the specific embodiments disclosed below.

In the process of processing multi-path concurrent network video session data, because independent decoding cannot be performed for each network video session, a concurrent video decoding technology needs to be adopted for concurrent decoding, and the concurrent video decoding process mainly comprises the following parts: 1. identifying and capturing a network message carrying video data; 2. stripping out video load data; 3. caching and splicing video data, and sending the spliced data meeting the conditions to a decoding module; 4. in a decoding module, concurrent video decoding is carried out; 5. the decoded data is used for content analysis.

However, in the existing decoding method for concurrent video session IP frame image group, taking IP frame type data fragment as an example, as shown in fig. 1, the last I frame and all the subsequent P frames in the current data fragment need to be stored for splicing the first frame of the next data fragment, and the storage content of each frame of video frame is large, so that the possibility of reducing decoding distortion and the lower decoding delay cannot be guaranteed on the premise of occupying a lower storage space of a system memory.

Embodiments of the present application will be described below with reference to fig. 2 to 5.

As shown in fig. 2, this embodiment provides a method for decoding a concurrent video session IP frame group, which is suitable for decoding concurrent data segments of multiple video sessions, where a data segment is composed of a group of pictures, the group of pictures contains multiple frames of video frames to be decoded, and if the group of pictures is composed of an I frame and a P frame, the type of the data segment can be regarded as an IP frame, and the method includes:

step S1, caching the received data segments, decoding the data segments in sequence, judging whether the video frame to be decoded of the last frame is an I frame or not when judging that the video frame to be decoded of the last frame of the data segments is not a complete frame, if so, storing the I frame, recording the I frame as a spliced frame, clearing the cached data segments, and if not, executing step S2;

specifically, for the existing video session encoding method, the first frame of video frame of a data segment of any one path of video session must be an I frame, and the I frame can be decoded independently, and for an IP frame data segment, the decoding result of the I frame can be used to decode a P frame of a second frame, and then the decoding result of the P frame is used to decode the next P frame, and the steps are sequentially circulated until all video frames in the data segment are decoded. Note that, in the present embodiment, the case where a plurality of consecutive I frames are included is not considered.

For a data segment, due to the uncertainty of the data segment dividing manner, the first frame may be: the complete I frame, the partial I frame, the complete P frame, and the partial P frame correspond to a last frame video frame (a last frame video frame to be decoded) of a previous data segment, and the types thereof are sequentially: a full P frame, a partial I frame, a full I frame or a full P frame, a partial P frame (in this case, the second last video frame may be a full I frame or a full P frame), as shown in fig. 3. Therefore, by determining whether the video frame to be decoded in the last frame is a complete frame and whether the video frame to be decoded in the last frame is an I frame, the decoding method of the next data segment and the stored video frame can be selected.

When the video frame to be decoded in the last frame is not a complete frame, the following cases are divided:

1) the last frame of video to be decoded is an incomplete P frame corresponding to C2 and C4, and then step S2 is performed;

2) and (3) the last frame of the video frame to be decoded is an incomplete I frame, corresponding to C6, the incomplete I frame is directly stored and recorded as a spliced frame, the spliced frame is spliced to the front frame of the next data segment, and step S3 is executed to decode the spliced front frame.

Further, the method further comprises:

when the video frame to be decoded of the last frame is judged to be a complete frame, the video frame to be decoded of the last frame is decoded, whether the video frame to be decoded of the last frame is an I frame or not is judged,

if yes, saving the I frame, recording as a spliced frame, clearing the cached data segment, executing step S3, if no, performing I frame coding on the decoded video frame of the last frame of video frame to be decoded, saving, recording as a spliced frame, clearing the cached data segment, and executing step S3.

Specifically, when the next frame of video frame cannot be successfully read, the content in the cached original frame information (a) is the last frame of the video frame to be decoded of the current data segment, that is, when the last frame of the video frame to be decoded is a complete frame, the following cases are divided:

1) if the last frame of video frame to be decoded is a complete P frame, the decoded video frame of the P frame is subjected to I frame encoding by using the existing I frame encoding method, and recorded as a spliced frame, and the spliced frame is stored, if the first frame of the next data segment is an I frame and corresponds to C1, the spliced frame is deleted, step S3 is executed, and decoding is performed only according to the first frame of the next data segment; if the first frame of the next data segment is a P frame and corresponds to C3, the spliced frame is spliced to the front frame of the next data segment, and step S3 is executed to decode the spliced first frame;

2) and if the last video frame to be decoded is a complete I frame, storing the I frame as a spliced frame, splicing the spliced frame to the front frame of the next data segment, corresponding to C5, executing the step S3, and decoding the spliced front frame.

In this embodiment, a method for determining the integrity of a video frame is shown, which specifically includes:

the video is encapsulated in a fixed data structure which comprises a fixed-length part and a variable-length part, wherein the byte number of the fixed-length part is determined, some basic information of the video frame is stored, and a certain specific field in the basic information is the byte number of the video frame. The byte number of the variable-length part is uncertain, the variable-length part is used for storing the actual data of the video frame, and the data length of the data is determined by the byte number of the video frame of the fixed-length part.

Reading data from the initial position of the variable length part, and when the length of the read data is greater than or equal to the byte number of the video frame, indicating that the read video frame is a complete frame; when the read data length is less than the byte number of the video frame, the video frame is read as an incomplete frame.

In this embodiment, a method for determining a video frame type is shown, which specifically includes:

the start position of a video frame also comprises a fixed-length data structure, wherein a certain field indicates the frame type, so that the frame type can be distinguished by a certain field.

Taking h.264 as an example, the lower 5 bits of the first byte following the header specific field indicate the frame type, 5 indicates an I frame, and 1 indicates a P frame. And distinguishing the P frame and the I frame, continuously analyzing a third byte, recording the number of continuous 0 of the byte from the high order as n, reading the value a of n bits after 1 following the continuous 0, and calculating 2^ n-1+ a. P frames if the values are 0, 3, 5, 8, and I frames if the values are 2, 4, 7, 9.

As shown in fig. 4, the present embodiment provides a method for decoding a concurrent video session IP frame image group, which specifically includes the following steps:

firstly, after receiving a video data segment, caching the received data segment, judging whether a subsequent data segment exists or not, if the subsequent data segment does not exist, indicating that the video session is processed, and clearing the cached data; if the subsequent data segment exists, judging whether the first frame of the current data segment is a complete I frame, if so, reading the first frame and decoding. After decoding the I-frame, for any video frame following the first frame: 1) when the reading is successful and the video frame is judged to be a complete frame, the video frame is decoded and cached, 2) if the reading is successful but the video frame is judged not to be a complete frame, the video frame is shown to be a last frame video frame (a last frame video frame to be decoded) of the current data segment, the type of the video frame is judged, the incomplete video frame is stored according to different types, 3) if the reading is not successful, the video frame in the current data segment is shown to be completely processed, and at the moment, the cached video frame is stored.

And if the first frame of the current data segment is not the complete I frame, splicing the cached video frame to the current first frame, and then reading the spliced first frame.

And then, after the first frame is successfully decoded, reading the next frame of video frame, judging whether the reading is successful again and judging whether the read video frame is a complete frame, and sequentially circulating until no subsequent data segment exists.

Further, this embodiment shows a method for decoding an IP frame data segment, where after it is determined that there are still subsequent data segments and the current data segment is buffered, video frames in the data segments are sequentially decoded, and the decoding includes:

step S101, reading a first to-be-decoded video frame in the cached data segment, determining whether the first to-be-decoded video frame is a P frame, if not, performing step S102, and if so, performing step S103;

step S102, clearing a second video frame to be decoded which is cached before a first video frame to be decoded and a corresponding cached second video frame to be decoded, decoding the current first video frame to be decoded to generate a first video frame to be decoded, and caching the current first video frame to be decoded and the first video frame to be decoded; the first video frame to be decoded is a currently read video frame to be decoded, and the second video frame to be decoded is a decoded video frame to be decoded of the previous frame, namely an original frame.

Specifically, as shown in fig. 5, the video frame to be decoded and the corresponding decoded video frame are cached in the original frame information (a) and the decoded frame information (a), the currently read video frame is set as the first video frame to be decoded, the previous video frame is set as the second video frame to be decoded, the content in the original frame information (a) at this time is the second video frame to be decoded, and the content in the decoded frame information (a) is the second decoded video frame.

After a complete video frame (i.e., a first video frame to be decoded) is successfully read, it is determined whether the first video frame to be decoded is an I frame or a P frame, if the first video frame to be decoded is an I frame, independent decoding can be performed according to the first video frame to be decoded, and the decoding process is the existing I frame decoding process, which is not repeated. Therefore, the content in the buffered original frame information (a) and decoded frame information (a) is removed to reduce the memory space occupation, the first to-be-decoded video frame is independently decoded, and the decoded first to-be-decoded video frame and the first to-be-decoded video frame are buffered in the decoded frame information (a) and the original frame information (a) so as to decode the subsequent P frame.

Step S103, decoding the current P frame according to the second decoded video frame cached before to generate the first decoded video frame, clearing the second to-be-decoded video frame cached before and the corresponding second decoded video frame, and caching the current P frame and the first decoded video frame;

specifically, when it is determined that the first to-be-decoded video frame is a P frame, since decoding of the P frame requires the decoded video frame after decoding of the previous video frame as a basis for decoding, that is, a second decoded video frame, which is buffered in the decoded frame information (a), the first to-be-decoded video frame is decoded by using the existing P frame decoding process according to the buffered decoded frame information (a), so as to obtain the first decoded video frame.

And then, removing the content in the original frame information (a) and the decoded frame information (A) which are cached, and sequentially caching the first video frame to be decoded and the first decoded video frame in the original frame information (a) and the decoded frame information (A) so as to decode the subsequent P frame.

And step S104, outputting the first decoded video frame and reading the next video frame.

Step S2, I frame coding is carried out on the cached decoding tail frame, the frame is recorded as a splicing I frame, the splicing I frame and the video frame to be decoded of the last frame are saved and recorded as splicing frames, and the cached data segment is cleared, wherein the decoding tail frame is the video frame to be decoded of the last frame in the data segment and the decoded video frame;

further, when the last frame of the video frame to be decoded is not a complete frame and is a P frame, step S2 specifically includes:

step S201, judging whether the video frame to be decoded of the penultimate frame is an I frame, if so, executing step S202, and if not, executing step S203;

step S202, recording the frame I as a spliced frame I, storing the spliced frame I and the last frame video frame to be decoded, and recording the frame I as a spliced frame;

specifically, at this time, the content in the original frame information (a) and the decoded frame information (a) is a penultimate frame to-be-decoded video frame and a decoded end frame (decoded video frame), when it is determined that the penultimate frame to-be-decoded video frame is an I frame, corresponding to C4, the original frame information (a) and the last frame to-be-decoded video frame are buffered, the buffered original frame information (a) and the buffered last frame to-be-decoded video frame are stored in the storage information (H) and recorded as a spliced frame, and the content in the buffered original frame information (a) and the buffered decoded frame information (a) is removed, so as to achieve the purpose of reducing the memory space.

Step S203, I-frame coding is carried out on the decoding tail frame to generate a splicing I frame, the splicing I frame and the last frame of video frame to be decoded are stored and recorded as splicing frames;

specifically, when it is determined that the video frame to be decoded of the penultimate frame is a P frame, corresponding to C2, the content in the decoded frame information (a) is subjected to I frame encoding by using the existing I frame encoding method, and recorded as a stitched I frame, the stitched I frame and the video frame to be decoded of the last frame are cached in the original frame information (a), and then the cached original frame information (a) and the video frame to be decoded of the last frame are stored in the storage information (H), and the content in the cached original frame information (a) and the cached decoded frame information (a) is removed, so as to achieve the purpose of reducing the memory space.

And step S204, clearing the cached data segments.

And step S3, splicing the spliced frame with the first frame of the next data segment, and decoding the spliced next data segment.

Specifically, for the case that the video frame to be decoded at the last frame in the current data segment is not a complete frame, the first frame of the next data segment is not necessarily a complete frame, that is, the first frame of the next data segment is not a complete I frame, and therefore, the spliced frame stored in the above step needs to be spliced with the first frame of the next data segment, and then, the spliced first frame of the next data segment is read and decoded.

The embodiment shows a splicing method, which specifically includes:

the number of bytes N1 and the corresponding data D1 may be obtained from the content in the holding information (H), whose number of bytes N2 and data D2 are known for the first frame of the next data segment. By allocating a memory space capable of accommodating N1+ N2 bytes, copying D1 to the start position of the memory space, and copying D2 to the end of D1, the data in the memory space can be used as the splice first frame of the next data segment.

It should be noted that the encoding method and the decoding method in this embodiment may be implemented by using an existing encoding and decoding method.

Through statistics of processing information of a large number of data fragments in a video session, the method for decoding concurrent video session IP frame image groups in this embodiment can ensure a 100% frame rate, and can be applied to scenes requiring 100% of the frame rate, such as a public security monitoring system, a network security detection system, a national security monitoring system, a military industry detection system, and the like, and has the following effects:

(1) the multi-channel concurrent video data fragments are decoded without frame loss and distortion;

(2) the decoding context does not need to be maintained, each data fragment caches at most one I frame and one incomplete P frame, and the storage space occupation is small;

(3) the maximum one-time encoding and two-time decoding operation are added in the processing of each data segment, the calculation amount is relatively small, and the performance loss is low.

The technical solution of the present application is described in detail above with reference to the accompanying drawings, and the present application provides a method for decoding concurrent video session IP frame image groups, where the method for decoding concurrent video session IP frame image groups includes: step S1, caching the received data segments, decoding the data segments in sequence, judging whether the video frame to be decoded of the last frame is an I frame or not when judging that the video frame to be decoded of the last frame of the data segments is not a complete frame, if so, storing the I frame, recording the I frame as a spliced frame, clearing the cached data segments, and if not, executing step S2; step S2, I frame coding is carried out on the cached decoding tail frame, the I frame is recorded as a splicing I frame, the splicing I frame and the video frame to be decoded of the last frame are stored and recorded as splicing frames, and the cached data segment is removed; and step S3, splicing the spliced frame with the first frame of the next data segment, and decoding the spliced next data segment. By the technical scheme, the problem of frame loss in concurrent decoding is solved, the storage space of data cache is reduced, and the real-time performance of concurrent decoding is optimized.

The steps in the present application may be sequentially adjusted, combined, and subtracted according to actual requirements.

The units in the device can be merged, divided and deleted according to actual requirements.

Although the present application has been disclosed in detail with reference to the accompanying drawings, it is to be understood that such description is merely illustrative and not restrictive of the application of the present application. The scope of the present application is defined by the appended claims and may include various modifications, adaptations, and equivalents of the invention without departing from the scope and spirit of the application.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:视频编解码的方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类