Video Bitstream Packet Loss Recovery Method, Device, Equipment and Storage Medium
By adding a verification code to the video frame group and using different recovery strategies during the decoding process, the playback discontinuity caused by packet loss of video code streams is solved, and the continuity of video playback and network adaptive encoding are achieved.
Patent Information
- Application Number
- CN201910550578.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2039-06-24
AI Technical Summary
In the prior art, when processing packet loss of video code streams, packet loss recovery cannot be effectively carried out through redundant packets, resulting in discontinuous video playback and directly discarding data packets will lead to discontinuous screens.
During the encoding process, the video frame group is added. During the decoding process, the packet loss frame type is determined based on the verification code and different recovery strategies are used to recover packet loss, including the inter-frame skip mode and vector extrapolation method.
The continuity of video playback is realized, the packet loss frame type is determined through the verification code and targeted recovery is carried out to ensure the continuity of video playback, and feedback the network situation to adjust the encoding strategy to reduce the packet loss rate.
Smart Images

Figure CN112135138B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of monitoring technologies, and in particular, to a method, apparatus, device, and storage medium for video stream packet loss recovery. Background Art
[0002] With the rapid development of various technologies in the monitoring field, people pursue a higher-quality visual experience, which comprehensively improves the clarity of images, increasing the network burden and the packet loss rate. When the video stream is affected by network factors, packet loss will occur, especially the loss of some packets in the I frame (key frame), resulting in the inability to decode the I frame and further affecting the decoding and display of the entire frame group.
[0003] Currently, to address the problem of video stream packet loss, the following two methods are commonly used: (1) Add redundant packets to the encoded stream. When video frame packet loss occurs, the decoding device can perform packet loss recovery through the redundant packets. (2) When video frame packet loss is caused by network congestion, prohibit the image output of the packet loss encoded data frame, and quickly clear the associated encoded frames in the buffer queue that are likely to cause the spread of screen distortion, so as to quickly ensure the image output of normal encoded frames.
[0004] However, both of these methods have certain deficiencies. In method (1), adding redundant packets increases the stream, and the increased bit rate may cause packet loss in the redundant packets, resulting in the inability to recover the lost packet data based on the redundant packets. In method (2), directly discarding the lost data will cause the video to be discontinuous. Summary of the Invention
[0005] Embodiments of the present invention provide a method, apparatus, device, and storage medium for video stream packet loss recovery to solve the technical problems of being unable to perform packet loss recovery through redundant packets and discontinuous video playback when dealing with lost packet data using existing technologies.
[0006] In a first aspect, an embodiment of the present invention provides a method for video stream packet loss recovery, which is applied to a decoding device and includes:
[0007] Obtain a frame group video stream sent by an encoding device, where the frame group video stream carries a check code;
[0008] Verify the check code carried by the frame group video stream to determine the lost packet frames and the types of lost packet frames in the frame group video stream;
[0009] According to the type of lost packet, adopt different recovery strategies to perform packet loss recovery on the lost packet frames.
[0010] In a second aspect, an embodiment of the present invention provides a method for video stream packet loss recovery, which is applied to an encoding device and includes:
[0011] Obtain a group of video frames to be encoded and processed;
[0012] During the encoding process of the group of video frames, add a check code to each frame in the group of video frames, where the check code is used to determine whether a packet of the video frame is lost during video frame decoding;
[0013] Transmit the encoded group of video frames with check codes to a decoding device.
[0014] In a third aspect, an embodiment of the present invention provides a video bitstream packet loss recovery device configured in a decoding device, including:
[0015] A first acquisition module, configured to acquire a group of frame video bitstreams sent by an encoding device, where the group of frame video bitstreams carry check codes;
[0016] A verification module, configured to verify the check codes carried by the group of frame video bitstreams, and determine the lost packets and the types of the lost packets of the group of frame video bitstreams;
[0017] A recovery module, configured to perform packet loss recovery on the lost packets according to the lost packet types by using different recovery strategies.
[0018] In a fourth aspect, an embodiment of the present invention provides a video bitstream packet loss recovery device configured in an encoding device, including:
[0019] A second acquisition module, configured to acquire a group of video frames to be encoded and processed;
[0020] A check code adding module, which adds a check code to each frame in the group of video frames during the encoding process of the group of video frames, where the check code is used to determine whether a packet of the video frame is lost during video frame decoding;
[0021] A sending module, configured to transmit the encoded group of video frames with check codes to a decoding device.
[0022] In a fifth aspect, an embodiment of the present invention further provides a decoding device, where the decoding device includes:
[0023] One or more processors;
[0024] A memory, configured to store one or more programs,
[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the video bitstream packet loss recovery methods applied to the decoding device in the embodiments of the present invention.
[0026] In a sixth aspect, an embodiment of the present invention further provides an encoding device, where the encoding device includes:
[0027] One or more processors;
[0028] A memory for storing one or more programs,
[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the video bitstream packet loss recovery methods applied to an encoding device as in the embodiments of the present invention.
[0030] In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements any one of the video bitstream packet loss recovery methods executed by a decoding device as in the embodiments of the present invention.
[0031] In an eighth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements any one of the video bitstream packet loss recovery methods executed by an encoding device as in the embodiments of the present invention.
[0032] Embodiments of the present invention provide a video bitstream packet loss recovery method, apparatus, device, and storage medium. During the video group of pictures (GOP) encoding process, a check code is added to the video frames within the GOP, and during the decoding process, the lost video frames and the types of lost frames are determined according to the check code, and then different recovery strategies are adopted according to the types of lost frames to perform packet loss recovery. Thus, by adopting a packet loss strategy to recover the lost frames, the continuity of video playback is ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flowchart of a video bitstream packet loss recovery method for an encoding device provided in Embodiment 1 of the present invention;
[0034] Figure 2 is a flowchart of a video bitstream packet loss recovery method applied to a decoding device provided in Embodiment 2 of the present invention;
[0035] Figure 3 is a schematic structural diagram of a video bitstream packet loss recovery apparatus configured in an encoding device provided in Embodiment 3 of the present invention;
[0036] Figure 4 is a schematic structural diagram of a video bitstream packet loss recovery apparatus configured in an encoding device provided in Embodiment 4 of the present invention;
[0037] Figure 5 is a schematic structural diagram of a decoding device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the sake of description, only the parts related to the present invention rather than all the structures are shown in the drawings.
[0039] Embodiment 1
[0040] Figure 1 FIG. 7 is a flowchart of a video bitstream packet loss recovery method applied to an encoding device according to Embodiment 1 of the present invention. This embodiment is applicable to the case where packet loss occurs during the network transmission of a video bitstream. This method can be executed by a video bitstream packet loss recovery device, which can be configured on an encoding device, such as a camera or a monitor.
[0041] As Figure 1 shown, the video bitstream packet loss recovery method applied to an encoding device provided in the embodiment of the present invention may include:
[0042] S101. Obtain a video frame group to be encoded and processed.
[0043] For the video collected by the encoding device, it is usually continuously transmitted to the encoder of the encoding device in units of frame groups. For example, a frame group is transmitted to the encoder every 40 ms. Each video frame group includes multiple video frames.
[0044] Exemplarily, if the structure of the video frame group is an IPPP structure, then the video frame group includes one I frame and multiple P frames. Since the I frame is a key frame, if some data packets of the I frame are lost, resulting in the I frame being unable to be decoded, which in turn affects the decoding of the entire frame group. Therefore, hierarchical encoding is performed on the I frame. That is, before encoding the I frame, the I frame is divided. For example, the I frame is divided into slices, and then each slice is encoded separately. In the embodiment of the present invention, preferably, the I frame is sliced according to the features included in the I frame (such as a person or a vehicle) to obtain feature slices and non-feature slices. Specifically for the feature slices, the features included in the I frame (such as a person or a vehicle) can be recognized through a pre-trained feature recognition model. The feature is composed of multiple feature macroblocks. The slice including multiple feature macroblocks is used as the feature slice, and the slice not including feature macroblocks is used as the non-feature slice.
[0045] S102. During the encoding process of the video frame group, add a check code to each frame in the video frame group.
[0046] Among them, the check code is used to determine whether a video frame is lost during video frame decoding. Therefore, to ensure accurate determination of whether a video frame is lost during decoding, it is only necessary to add a check code to each frame in the video frame group during the encoding process of the video frame group.
[0047] Optionally, since the video frame group includes an I-frame and multiple P-frames, and the I-frame is divided into a feature slice and a non-feature slice, during the process of encoding the video frame group, add check codes to the feature slice, non-feature slice, and P-frame. Preferably, the check code is a CRC check code, that is, a binary check code is appended after the encoded binary video frame data, so that there is a specific relationship between the check code and its corresponding video frame data. Subsequently, it is only necessary to check whether this specific relationship exists to determine whether the video frame data is lost. It should be noted here that the check code can also be any other verification code that can implement lost packet data verification, and no specific limitation is made here.
[0048] Furthermore, during the encoding process of the video frame group, adding check codes to the feature slice, non-feature slice, and P-frame in the I-frame includes:
[0049] For the feature slice, encode the macroblocks included in the feature slice, and add a macroblock check code to each macroblock after encoding until all the macroblocks included in the feature slice are encoded, and then add an I-frame slice-level check code to the feature slice;
[0050] When the encoding of the non-feature slice ends, add an I-frame slice-level check code to the non-feature slice;
[0051] After the encoding of the P-frame ends, add a P-frame frame-level check code to the P-frame.
[0052] S103. Transmit the encoded video frame group with check codes to the decoding device.
[0053] When the encoding of the video frame group ends, transmit the video frame group with check codes to the decoding device, for example, transmit it to the server through the network so that the server can decode the video bitstream of the frame group for playback.
[0054] In the embodiments of the present invention, by hierarchically dividing the I-frame for hierarchical encoding, and during the encoding process, adding check codes to the feature slice, non-feature slice, and P-frame respectively to mark the lost packet situation. So that targeted lost packet recovery can be performed according to the check code during subsequent decoding.
[0055] Embodiment 2
[0056] Figure 2 The figure is a schematic flowchart of a video stream packet loss recovery method applied to a decoding device according to Embodiment 2 of the present invention. This embodiment is applicable to the situation where video stream packets are lost during network transmission. This method can be executed by a video stream packet loss recovery device, which can be configured on a decoding device, such as a server.
[0057] S201. Obtain the group-of-pictures (GOP) video stream sent by the encoding device.
[0058] Among them, the GOP video stream carries a check code, and the check code includes a P-frame level check code, an I-frame slice level check code, and a macroblock level check code. Preferably, the check code is a CRC check code.
[0059] S202. Verify the check code carried by the GOP video stream to determine the lost packets and the types of lost packets in the GOP video stream.
[0060] Exemplarily, when decoding the GOP video stream, detect whether a specific relationship exists between a certain video frame data in the GOP video stream and its corresponding check code. If not, determine that the video frame data is lost, that is, a lost packet, and determine the lost packet type according to the check code corresponding to the lost packet. Among them, the types of lost packets include P-frame loss and I-frame loss.
[0061] S203. According to the lost packet type, adopt different recovery strategies to recover the lost packets of the lost packets.
[0062] Usually, due to network reasons, video data packets are lost. The existing strategy at the decoding end is to discard the lost packets. Therefore, if an I-frame is lost, the entire GOP needs to be discarded. Therefore, the importance of the I-frame in the GOP is greater than that of the P-frame. Therefore, the I-frame and the P-frame are processed in different levels as follows.
[0063] S1. If the type of the current lost packet is P-frame loss, recover the current lost packet through the full-frame inter-frame skip mode.
[0064] Among them, the full-frame inter-frame skip mode is to use the previous frame as a reference frame and copy the corresponding pixel points of the reference frame to the lost packet frame to achieve the purpose of recovering the lost packet frame.
[0065] S2. If the type of the current lost packet is I-frame loss, determine the lost slice according to the I-frame slice level check code in the current lost packet.
[0066] Among them, the current lost packet frame includes a feature slice and a non-feature slice;
[0067] S3. Determine whether the lost slice is a feature slice;
[0068] S4. If not, when decoding the lost packet slice, the lost packet slice is recovered by an inter-frame-like skip mode.
[0069] If the lost packet slice is a non-feature slice, it indicates that the lost packet slice does not contain key information. When decoding the lost packet slice, the lost packet slice is recovered by an inter-frame-like skip mode. Since there is no skip mode for I-frames, the inter-frame-like skip mode is the reference P-frame skip mode, using the previous frame as the reference frame to perform skip mode recovery, that is, copying the corresponding pixel points of the reference frame to the lost packet frame to recover the lost packet data.
[0070] S5. If so, according to the macroblock-level check code, determine the lost packet macroblocks in the feature slice, and when decoding the lost packet macroblocks, recover the lost packet macroblocks by vector extrapolation.
[0071] If the lost packet slice is a feature slice, it indicates that the lost packet slice contains key information, so it is necessary to further determine which macroblock has lost packets. Specifically, the correct macroblocks can be decoded sequentially according to the macroblock-level check code to determine the lost packet macroblocks in the feature slice, and when decoding the lost packet macroblocks, recover the lost packet macroblocks by vector extrapolation. The vector extrapolation method is to use the motion vector of the previous frame (reference frame) to predict the current lost packet frame, and extrapolate the macroblocks in the previous frame to the position of the current lost packet frame in the opposite direction of their motion vectors, and the motion vector is obtained by extrapolation after motion estimation.
[0072] Furthermore, after completing the lost packet recovery, the lost packet information can be fed back to the encoding device so that the encoding device can adjust the encoding strategy. Exemplarily, if the decoding device has a private protocol, the lost packet information can be fed back to the encoding device through the private protocol, and the encoding device can adjust the encoding strategy according to the lost packet information; if the decoding device has no corresponding protocol, the encoding device can obtain the sending status and cache information by itself to estimate the network situation, and then adjust the encoding strategy. Among them, the preferred way to adjust the encoding strategy is: reduce the code rate corresponding to the overall P-frame, and for I-frames, reduce the code rate of non-feature slices to adapt to the network situation. This can reduce the lost packet situation and ensure video continuity.
[0073] In the embodiment of the present invention, during the decoding process, according to the check code, determine the lost video frame and the type of the lost packet frame, and then adopt different recovery strategies according to the type of the lost packet frame to perform lost packet recovery. Thus, by recovering the lost packet frame using the lost packet strategy, the continuity of video playback is ensured. Moreover, by feeding back the lost packet situation to the encoding device so that the encoding device can adjust the encoding strategy, the encoding device can adapt to the network to achieve the purpose of reducing video packet loss.
[0074] Embodiment 3
[0075] Figure 3 is a schematic structural diagram of a video bitstream packet loss recovery device provided in Embodiment 3 of the present invention. This device is configured in an encoding device, such as Figure 3 shown, and this device includes:
[0076] A second acquisition module 301, configured to acquire a video frame group to be encoded and processed;
[0077] A check code adding module 302, during the encoding process of the video frame group, adding a check code to each frame in the video frame group, where the check code is used to determine whether a video frame is lost during video frame decoding;
[0078] A sending module 303, configured to transmit the encoded video frame group with the check code to a decoding device.
[0079] Based on the above embodiment, the video frame group includes one I-frame and multiple P-frames;
[0080] Based on a feature recognition model, perform slice division on the I-frame to obtain a feature slice and a non-feature slice;
[0081] Correspondingly, the check code adding module is specifically configured to:
[0082] During the encoding process of the video frame group, add check codes to the feature slice, non-feature slice, and P-frames.
[0083] Based on the above embodiment, the check code adding module includes:
[0084] A first check code adding unit, for the feature slice, encoding the macroblocks included in the feature slice, and adding a macroblock check code to each macroblock after encoding until all the macroblocks included in the feature slice are encoded, and adding an I-frame slice-level check code to the feature slice;
[0085] A second check code adding unit, for adding an I-frame slice-level check code to the non-feature slice when the encoding of the non-feature slice ends;
[0086] A third check code adding unit, for adding a P-frame frame-level check code to the P-frame after the encoding of the P-frame ends.
[0087] Based on the above embodiment, the device further includes:
[0088] The encoding strategy adjustment module is configured to receive the packet loss information fed back by the decoding device or obtain the packet loss information by itself, and adjust the encoding strategy according to the packet loss information.
[0089] The video bitstream packet loss recovery device provided by the embodiments of the present invention can execute the video bitstream packet loss recovery method applicable to the encoding device provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0090] Embodiment 4
[0091] Figure 4 FIG. 10 is a schematic structural diagram of a video bitstream packet loss recovery device provided by Embodiment 4 of the present invention. The device is configured in a decoding device, such as Figure 4 As shown, the device includes:
[0092] The first acquisition module 401 is configured to acquire the group-of-pictures video bitstream sent by the encoding device, where the group-of-pictures video bitstream carries a check code;
[0093] The verification module 402 is configured to verify the check code carried by the group-of-pictures video bitstream, and determine the lost packet frames and the types of the lost packet frames of the group-of-pictures video bitstream;
[0094] The recovery module 403 is configured to perform packet loss recovery on the lost packet frames by using different recovery strategies according to the lost packet types.
[0095] Based on the above embodiments, the check code includes a P-frame level check code, an I-frame slice level check code, and a macroblock level check code;
[0096] Correspondingly, the types of the lost packet frames include P-frame packet loss and I-frame packet loss.
[0097] Based on the above embodiments, the recovery module includes:
[0098] The first recovery unit is configured to, if the type of the current lost packet frame is P-frame packet loss, recover the current lost packet frame through the full-frame inter-frame skip mode.
[0099] Based on the above embodiments, the recovery module further includes:
[0100] The lost packet slice determination unit is configured to, if the type of the current lost packet frame is I-frame packet loss, determine the lost packet slice according to the I-frame slice level check code in the current lost packet frame, where the current lost packet frame includes a feature slice and a non-feature slice;
[0101] The judgment unit is configured to judge whether the lost packet slice is a feature slice;
[0102] A second recovery unit, configured to, when the determination result of the determination unit is negative, recover the lost packet slice by means of an inter-frame skip-like mode when decoding the lost packet slice;
[0103] A third recovery unit, configured to, when the determination result of the determination unit is positive, determine the lost packet macroblocks in the feature slice according to the macroblock-level check codes, and recover the lost packet macroblocks by means of vector extrapolation when decoding the lost packet macroblocks.
[0104] The video bitstream packet loss recovery device provided by the embodiments of the present invention can execute the video bitstream packet loss recovery method applicable to a decoding device provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0105] Embodiment 5
[0106] Figure 5 It is a schematic structural diagram of a decoding device provided for Embodiment 5 of the present invention. Figure 5 It shows a block diagram of an exemplary decoding device 12 suitable for implementing the embodiments of the present invention. Figure 5 The shown decoding device 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
[0107] As Figure 5 shown, the decoding device 12 is presented in the form of a general-purpose computing device. The components of the decoding device 12 may include, but are not limited to: one or more processors or a processor 16, a memory 28, and a bus 18 connecting different system components (including the memory 28 and the processor 16).
[0108] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus structures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0109] The decoding device 12 typically includes a variety of computer system-readable media. These media can be any available media accessible by the decoding device 12, including volatile and non-volatile media, removable and non-removable media.
[0110] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The decoding device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 5 not shown, commonly referred to as a "hard disk drive"). Although Figure 5 not shown in the figure, a disk drive for reading and writing on removable non-volatile disks (such as "floppy disks") and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 through one or more data media interfaces. The memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0111] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.
[0112] The decoding device 12 may also communicate with one or more external devices 14, and may also communicate with one or more devices that enable a user to interact with the decoding device 12, and / or communicate with any device that enables the decoding device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through the input / output (I / O) interface 22. Moreover, the decoding device 12 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the decoding device 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the decoding device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0113] The processor 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the video stream packet loss recovery method applied to the decoding device provided by the embodiments of the present invention. The method includes:
[0114] Obtain the frame group video bitstream sent by the encoding device, where the frame group video bitstream carries a check code;
[0115] Verify the check code carried in the frame group video bitstream to determine the lost packets and the types of the lost packets in the frame group video bitstream;
[0116] According to the lost packet type, adopt different recovery strategies to perform lost packet recovery on the lost packets.
[0117] An embodiment of the present invention further provides an encoding device, which includes: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the video bitstream lost packet recovery method applied to the encoding device provided by the embodiment of the present invention, including:
[0118] Obtain the video frame group to be encoded and processed;
[0119] During the encoding process of the video frame group, add a check code to each frame in the video frame group, where the check code is used to determine whether the video frame is lost during video frame decoding;
[0120] Transmit the encoded video frame group with the check code to the decoding device.
[0121] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the video bitstream lost packet recovery method applied to the encoding device provided by any embodiment of the present invention. The hardware structure and functions of this encoding device can be referred to the content in Embodiment 5 for explanation.
[0122] Embodiment 6
[0123] An embodiment of the present invention provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute a video bitstream lost packet recovery method applied to a decoding device when executed by a computer processor. The method includes:
[0124] Obtain the frame group video bitstream sent by the encoding device, where the frame group video bitstream carries a check code;
[0125] Verify the check code carried in the frame group video bitstream to determine the lost packets and the types of the lost packets in the frame group video bitstream;
[0126] According to the lost packet type, adopt different recovery strategies to perform lost packet recovery on the lost packets.
[0127] Certainly, the storage medium containing computer-executable instructions provided in the embodiments of the present invention is not limited to the method operations as described above, and can also execute the relevant operations in the video stream packet loss recovery method provided in any embodiment of the present invention.
[0128] The computer storage medium of the embodiments of the present invention can adopt any combination of one or more computer-readable media. The computer-readable media can be computer-readable signal media or computer-readable storage media. The computer-readable storage media can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage media can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0129] The computer-readable signal media can include data signals propagated in a baseband or as part of a carrier wave, which carry computer-readable program codes. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal media can also be any computer-readable media other than the computer-readable storage media, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0130] The program codes contained on the computer-readable media can be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0131] Computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., connected through the Internet using an Internet service provider).
[0132] An embodiment of the present invention further provides another computer-readable storage medium. The computer-executable instructions are used to perform a method for recovering lost packets in a video bitstream of an encoding device when executed by a computer processor. The method includes:
[0133] Obtain a group of video frames to be encoded and processed;
[0134] During the encoding process of the group of video frames, add a check code to each frame in the group of video frames, where the check code is used to determine whether a video frame is lost during video frame decoding;
[0135] Transmit the encoded group of video frames with check codes to a decoding device.
[0136] Of course, the computer-executable instructions of a storage medium provided by an embodiment of the present invention are not limited to the method operations described above, and may also perform related operations in the method for recovering lost packets in a video bitstream of an encoding device provided by any embodiment of the present invention. For the introduction of the storage medium, refer to the content explanation in Embodiment 6.
[0137] Note that the above is only a preferred embodiment of the present invention and the applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here, and various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments may be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for recovering lost packets in a video bitstream, which is applied to a decoding device, characterized in that, The method includes: Obtain the group-of-frames video bitstream sent by an encoding device, where the group-of-frames video bitstream carries a check code; Verify the check code carried by the group-of-frames video bitstream to determine the lost packets and the types of the lost packets in the group-of-frames video bitstream; According to the lost packet types, adopt different recovery strategies to perform lost packet recovery on the lost packets; Wherein, the check code includes a P-frame level check code, an I-frame slice level check code, and a macroblock level check code.
2. The method according to claim 1, wherein The types of the lost packets include P-frame loss and I-frame loss.
3. The method according to claim 2, wherein According to the lost packet types, adopting different recovery strategies to perform lost packet recovery on the lost packets includes: If the type of the current lost packet is P-frame loss, recover the current lost packet through the full-frame inter-frame skip mode.
4. The method according to claim 2, wherein According to the lost packet types, adopting different recovery strategies to perform lost packet recovery on the lost packets includes: If the type of the current lost packet is I-frame loss, determine the lost slice according to the I-frame slice level check code in the current lost packet, where the current lost packet includes a feature slice and a non-feature slice; Judge whether the lost slice is a feature slice; If not, when decoding the lost slice, recover the lost slice through an inter-frame-like skip mode; If so, determine the lost macroblocks in the feature slice according to the macroblock level check code, and when decoding the lost macroblocks, recover the lost macroblocks through vector extrapolation.
5. A method for video bitstream packet loss recovery, applied to an encoding device, characterized in that, The method includes: Obtain a group of video frames to be encoded; During the encoding process of the group of video frames, add a check code to each frame in the group of video frames, where the check code is used to determine whether the video frame is lost during video frame decoding; Transmit the encoded group of video frames with the check code to a decoding device; Wherein, during the encoding process of the group of video frames, adding a check code to each frame in the group of video frames includes: During the encoding process of the group of video frames, add check codes to the feature slice, the non-feature slice, and the P-frame.
6. The method according to claim 5, characterized in that, The group of video frames includes one I-frame and multiple P-frames; Based on a feature recognition model, perform slice division on the I-frame to obtain a feature slice and a non-feature slice.
7. The method according to claim 6, wherein During the encoding process of the group of video frames, adding check codes to the feature slice, the non-feature slice, and the P-frame in the I-frame includes: For the feature slice, encode the macroblocks included in the feature slice, and add a macroblock check code to each macroblock after encoding until all the macroblocks included in the feature slice are encoded, and then add an I-frame slice level check code to the feature slice; When the encoding of the non-feature slice ends, add an I-frame slice level check code to the non-feature slice; After the encoding of the P-frame ends, add a P-frame level check code to the P-frame.
8. The method according to claim 5, wherein The method further includes: Receive the packet loss information fed back by the decoding device or obtain the packet loss information by itself, and adjust the encoding strategy according to the packet loss information.
9. A video bitstream packet loss recovery device, configured in a decoding device, characterized in that The device includes: A first acquisition module, configured to acquire a group-of-pictures (GOP) video bitstream sent by an encoding device, where the GOP video bitstream carries a check code; A verification module, configured to verify the check code carried by the GOP video bitstream, and determine the lost packets and the types of the lost packets in the GOP video bitstream; A recovery module, configured to perform packet loss recovery on the lost packets by using different recovery strategies according to the types of the lost packets; Wherein, the check code includes a P-frame level check code, an I-frame slice level check code, and a macroblock level check code.
10. A video bitstream packet loss recovery device, configured in an encoding device, characterized in that, The device includes: A second acquisition module, configured to acquire a group of video frames to be encoded; A check code addition module, configured to add a check code to each frame in the group of video frames during the encoding process of the group of video frames, where the check code is used to determine whether a video frame is lost during video frame decoding; A sending module, configured to transmit the encoded group of video frames with the check code to a decoding device; Wherein, the check code addition module is specifically configured to: Add check codes to feature slices, non-feature slices, and P-frames during the encoding process of the group of video frames.
11. A decoding device, characterized in that, Includes: One or more processors; A memory, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the video bitstream packet loss recovery method according to any one of claims 1-4.
12. An encoding device, characterized in that, Includes: One or more processors; A memory, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the video bitstream packet loss recovery method according to any one of claims 5-8.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the video bitstream packet loss recovery method according to any one of claims 1-4.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the video bitstream packet loss recovery method according to any one of claims 5-8.