Video encoding, decoding, transmission methods, electronic devices, and storage media

By calculating redundancy according to video characteristics and network status in the video communication system, and adopting adaptive forward error correction technology, the video lag caused by network packet loss is solved, and the stability of video transmission and user experience are improved.

CN116095362BActive Publication Date: 2025-08-01ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211743994.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-08-01
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In video communication systems based on IP networks, network packet loss leads to poor video quality, especially in the case of poor network environment, the redundancy rate setting of the prior art can easily lead to video lag.

Method used

By obtaining the video characteristics and network status information of the video to be transmitted, the redundancy is calculated, and the encoding redundancy is adjusted according to the packet loss rate, and the video encoding and decoding is used to encode and decode videos to ensure that the redundancy is suitable for network conditions.

Benefits of technology

It improves the stability of video transmission, reduces the problem of video lag caused by network fluctuations, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095362B_ABST
    Figure CN116095362B_ABST
Patent Text Reader

Abstract

This application proposes a video encoding method, a video decoding method, a video transmission method, an electronic device, and a computer storage medium. The electronic device obtains the video to be transmitted, as well as its video characteristics and network status information; calculates the redundancy of the video to be transmitted according to the video characteristics and network status information; obtains the packet loss rate and determines whether the redundancy is less than or equal to the packet loss rate; if not, encodes the video to be transmitted according to the redundancy to obtain the encoded video bitstream. Through the above method, forward error correction with a suitable redundancy is used for video transmission of video data by combining video characteristics and network conditions, improving the stability of video transmission and overcoming the problem that video transmission in the prior art is prone to video stuttering in scenarios with large network fluctuations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video network transmission, and in particular to a video encoding method, a transmission method, an electronic device, and a computer storage medium. Background Art

[0002] In IP-based video communication systems, packet loss can severely impact the quality of real-time video communication. This can cause issues like pixelation, freezes, and skipped seconds, resulting in a poor user experience. Packet loss is particularly common in poor network conditions. Common methods to address this issue include packet retransmission and forward error correction.

[0003] The problem with the existing technology of setting the redundancy rate is that when video transmission is in a scenario with large network fluctuations, if the data redundancy rate is equal to the network packet loss rate, it is easy to cause video freezes. Summary of the Invention

[0004] To solve the above technical problems, the present application proposes a video encoding method, a video decoding method, a video transmission method, an electronic device and a computer storage medium.

[0005] To solve the above technical problems, the present application proposes a video encoding method, comprising:

[0006] Obtain the video to be transmitted, its video characteristics and network status information;

[0007] Calculating the redundancy of the video to be transmitted according to the video characteristics and the network status information;

[0008] Obtaining a packet loss rate, and determining whether the redundancy is less than or equal to the packet loss rate;

[0009] If not, the video to be transmitted is encoded according to the redundancy to obtain an encoded video stream.

[0010] The video encoding method further includes:

[0011] When the redundancy is less than or equal to the packet loss rate, the video to be transmitted is encoded according to the packet loss rate as a new redundancy, and the encoded video stream is transmitted.

[0012] The step of encoding the video to be transmitted according to the redundancy includes:

[0013] Determining whether the redundancy is less than or equal to 1 / 2;

[0014] If yes, encoding the video to be transmitted according to the redundancy;

[0015] If not, then encode the video to be transmitted with a new redundancy of 1 / 2.

[0016] Wherein, the video characteristics include video frame rate and video bit rate, and the network status information includes available bandwidth;

[0017] Calculating the redundancy of the video to be transmitted according to the video characteristics and the network status information includes:

[0018] Calculate the frame size of the video to be transmitted according to the video frame rate and video bit rate;

[0019] Obtain the single-frame video transmission time by using the frame size of the video to be transmitted and the available bandwidth, and obtain the single-frame redundant transmission time by using the frame rate and the single-frame video transmission time;

[0020] Calculate the redundancy size according to the single-frame redundant transmission time and the available bandwidth;

[0021] Calculate the redundancy of the video to be transmitted based on the redundancy size and the frame size.

[0022] To solve the above technical problems, the present application proposes a video decoding method, including:

[0023] Obtain a video bitstream, and obtain video packets and redundant packets based on the video bitstream, wherein the video bitstream is encoded by the above video encoding method;

[0024] When the video data is missing in the video packet, extract the redundant video data missing in the video packet from the redundant packet;

[0025] Decode the video packet and the redundant video data to obtain the transmitted video.

[0026] Wherein, after obtaining the video packets and redundant packets based on the video bitstream, the video decoding method includes:

[0027] When there is a packet loss in the video packet, obtain the packet loss information;

[0028] Transmit the packet loss information to the front-end video device so that the front-end video device can obtain the packet loss rate in the packet loss information, and the packet loss rate is used to calculate the redundancy. [[ID=@]]

[0029] Wherein, the video decoding method further includes:

[0030] Obtain the video packet based on the video bitstream and store the video packet in the video packet cache queue;

[0031] Obtain the redundant packet based on the video bitstream and store the redundant packet in the redundant packet cache queue;

[0032] Determine whether the video packet is missing based on the video packets in the video packet cache queue;

[0033] If so, extract the redundant video data missing from the video packet from the redundant packet cache queue, and decode the video packets in the video packet cache queue and the redundant video data to obtain the transmitted video;

[0034] If not, decode the video packets in the video packet cache queue to obtain the transmitted video.

[0035] To solve the above technical problems, the present application also proposes a video transmission method, which is applied to a video transmission system. Among them, the video transmission system includes a front-end video device and a back-end video pulling device; the video transmission method includes:

[0036] The front-end video device acquires the video to be transmitted and its video characteristics;

[0037] The back-end video pulling device transmits network status information to the front-end video device;

[0038] The front-end video device calculates the redundancy of the video to be transmitted according to the video characteristics and the network status information;

[0039] The front-end video device obtains the packet loss rate from the network status information and determines whether the redundancy is less than or equal to the packet loss rate;

[0040] If not, the front-end video device encodes the video to be transmitted according to the redundancy, obtains the encoded video bitstream, and transmits the video bitstream to the back-end video pulling device.

[0041] Among them, after transmitting the video bitstream to the back-end video pulling device, the video transmission method further includes:

[0042] The back-end video pulling device acquires the video bitstream and obtains video packets and redundant packets based on the video bitstream;

[0043] When the video packet is missing video data, the back-end video pulling device extracts the redundant video data missing from the video packet from the redundant packets;

[0044] The back-end video pulling device decodes the video packets and the redundant video data to obtain the transmitted video. [[ID=4))

[0045] To solve the above technical problems, the present application also proposes an electronic device, which includes a memory and a processor coupled to the memory;

[0046] Among them, the memory is used to store program data, and the processor is used to execute the program data to implement the above video encoding method, the above video decoding method, and / or the above video transmission method.

[0047] To solve the above technical problems, the present application also proposes a computer storage medium. The computer storage medium is used to store program data. When the program data is executed by a computer, it is used to implement the above video encoding method, the above video decoding method, and / or the above video transmission method.

[0048] Compared with the prior art, the beneficial effects of the present application are as follows: The electronic device obtains the video to be transmitted, as well as its video characteristics and network status information; calculates the redundancy of the video to be transmitted according to the video characteristics and network status information; obtains the packet loss rate and determines whether the redundancy is less than or equal to the packet loss rate; if not, encodes the video to be transmitted according to the redundancy to obtain the encoded video stream. Through the above method, forward error correction with a suitable redundancy is used for video transmission of video data in combination with video characteristics and network conditions, improving the stability of video transmission and overcoming the problem that video transmission in the prior art is prone to video stuttering in scenarios with large network fluctuations. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0050] Among them:

[0051] Figure 1 is a schematic flowchart of an embodiment of the video encoding method provided by the present application;

[0052] Figure 2 is a schematic diagram of setting redundancy transmission according to video characteristics in combination with network conditions in the video encoding method provided by the present application;

[0053] Figure 3 is a schematic flowchart of the sub-steps of step S12 in an embodiment of the video encoding method provided by the present application;

[0054] Figure 4 is a schematic flowchart of the adaptive forward error correction of the video encoding method provided by the present application;

[0055] Figure 5 is a schematic flowchart of an embodiment of the video decoding method provided by the present application;

[0056] Figure 6It is a schematic flowchart of another embodiment of the video decoding method provided by this application;

[0057] Figure 7 It is a schematic flowchart of the back-end processing of the video decoding method provided by this application;

[0058] Figure 8 It is a schematic structural diagram of the video transmission system provided by this application;

[0059] Figure 9 It is a schematic flowchart of an embodiment of the video transmission method provided by this application;

[0060] Figure 10 It is a schematic structural diagram of an embodiment of the electronic device provided by this application;

[0061] Figure 11 It is a schematic structural diagram of an embodiment of the computer storage medium provided by this application. Detailed implementation manners

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

[0063] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and above-mentioned drawings of this application are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0064] The video encoding method, video decoding method, and video transmission method of this application are applied to an electronic device. Among them, the electronic device of this application can be a server, a local terminal, or a system in which the server and the local terminal cooperate with each other. Correspondingly, each part included in the electronic device, such as each unit, sub-unit, module, and sub-module, can be all set in the server, all set in the local terminal, or separately set in the server and the local terminal.

[0065] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers or as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules for providing a distributed server, or as a single software or software module, which is not specifically limited herein.

[0066] For details, please refer to Figure 1 and Figure 2 , Figure 1 which is a schematic flowchart of an embodiment of the video encoding method provided by this application; Figure 2 which is a schematic diagram of setting redundancy transmission according to video characteristics and network conditions for the video encoding method provided by this application.

[0067] As Figure 1 shown, the specific steps are as follows:

[0068] Step S11: Obtain the video to be transmitted, as well as its video characteristics and network status information.

[0069] Among them, the electronic device includes a front-end video device, which is used to generate the video to be transmitted. The front-end video device can be any device that can obtain video, such as a video monitoring or video storage device.

[0070] Specifically, the electronic device obtains the video to be transmitted through the front-end video device, parses the video to be transmitted, and obtains the video characteristics of the video to be transmitted.

[0071] Furthermore, the electronic device also includes a communication module. The electronic device can obtain the network status information of the video to be transmitted through the feedback of the network status information by the communication module.

[0072] Among them, the video characteristics include but are not limited to the frame rate F and bit rate M of the video to be transmitted, and the network status information includes but is not limited to the available bandwidth W and packet loss rate P.

[0073] The video frame rate F (Frame rate) is a measure for measuring the number of displayed frames. The so-called measurement unit is the number of frames displayed per second of the video.

[0074] The video bit rate M is the number of data bits transmitted per unit time during data transmission. It refers to the data traffic used by the video file per unit time, and is also called the bit rate. The larger the bit rate, the larger the sampling rate per unit time and the higher the data stream accuracy.

[0075] The available bandwidth W refers to the maximum amount of data bits that can pass through in a fixed time (1 second).

[0076] The packet loss rate P refers to the ratio of the number of lost data packets in the test to the number of data groups sent.

[0077] Step S12: Calculate the redundancy of the video to be transmitted according to the video characteristics and network status information.

[0078] Specifically, the electronic device calculates the redundancy of the video to be transmitted according to the video characteristics and network status information according to a preset rule. For details, please refer to steps S121 - S124.

[0079] As Figure 2 shown, assuming that the available network bandwidth is 8 Mbps, the bitstream size is 4 Mbps, and the frame rate is 25 fps, then the average transmission time required for each frame is 20 ms. In order not to increase the delay, the remaining available transmission time is 20 ms; the available transmission time of 20 ms can be used to calculate the redundant data that can be sent. That is, without increasing the delay, a maximum redundancy of 1 times can be achieved. It can reduce the problem of video stuttering caused by the failure of FEC decoding and recovery due to network fluctuations.

[0080] Furthermore, the present application proposes steps S121 - S124 as sub - steps of step S12 to calculate the redundancy of the video to be transmitted according to a preset rule. For details, please refer to Figure 3 and Figure 4 , Figure 3 is a schematic diagram of the sub - step process of step S12 in an embodiment of the video encoding method provided by the present application; Figure 4 is a schematic diagram of the process of adaptive forward error correction of the video encoding method provided by the present application.

[0081] In this embodiment, the video characteristics include the video frame rate M and the video bit rate F, and the network status information includes the available bandwidth W and the packet loss rate P.

[0082] As Figure 3 shown, the specific steps are as follows:

[0083] Step S121: Calculate the frame size of the video to be transmitted according to the video frame rate and the video bit rate.

[0084] Specifically, the electronic device calculates the average size of each frame of the video to be transmitted according to the video bit rate F and the video frame rate M of the video to be transmitted. The specific formula is as follows: M / F

[0085] Step S122: Obtain the single - frame video transmission time by using the frame size of the video to be transmitted and the available bandwidth, and obtain the single - frame redundant transmission time by using the frame rate and the single - frame video transmission time.

[0086] Specifically, the electronic device divides the average size of each frame of the video to be transmitted by the available bandwidth to obtain the single-frame video transmission time, that is, the time required for the electronic device to transmit 1 frame of video. The specific formula is as follows: M / F / W.

[0087] Further, the electronic device obtains the frame interval using the frame rate, and the electronic device subtracts the frame interval from the time required to transmit 1 frame of video to obtain the time for transmitting redundant data. The specific formula is as follows: 1 / F - M / F / W.

[0088] Step S123: Calculate the redundancy size according to the single-frame redundant transmission time and the available bandwidth.

[0089] Specifically, the electronic device multiplies the single-frame redundant transmission time by the bandwidth to calculate the size of the redundant data that can be transmitted. The specific formula is as follows: (1 / F - M / F / W) * W.

[0090] Step S124: Calculate the redundancy of the video to be transmitted based on the redundancy size and the frame size.

[0091] Specifically, calculate the redundancy of the video to be transmitted. The specific formula is as follows: K = [(1 / F - M / F / W) * W] / [(1 / F - M / F / W) * W + M / F].

[0092] Through steps S121 - S124, the redundancy is calculated according to the video characteristics and network status information, providing an accurate redundancy for video error correction.

[0093] Step S13: Obtain the packet loss rate and determine whether the redundancy is less than or equal to the packet loss rate.

[0094] Specifically, the electronic device obtains the packet loss rate through the built-in communication module, analyzes the value of the packet loss rate, and determines the numerical relationship between the redundancy calculated in steps S121 - S124 and the packet loss rate. If the redundancy is greater than the packet loss rate, step S14 is continued.

[0095] When the redundancy is less than or equal to the packet loss rate, the packet loss rate is used as the new redundancy to encode the video to be transmitted, and the encoded video stream is transmitted.

[0096] Step S14: Encode the video to be transmitted according to the redundancy to obtain the encoded video stream.

[0097] Specifically, when the electronic device determines that the redundancy of the video to be transmitted is greater than the packet loss rate, in an embodiment of the present application, the electronic device continues to determine whether the redundancy is greater than 1 / 2 of the redundancy, as Figure 4 shown, the electronic device, according to the method of steps S121 - S124, when the initially calculated redundancy is greater than the packet loss rate, continues to determine whether the redundancy is less than or equal to 1 / 2 according to the video characteristics and network information.

[0098] If the redundancy is less than or equal to 1 / 2, the electronic device encodes the video to be transmitted according to the value of the redundancy. If the redundancy is greater than 1 / 2, the electronic device encodes the video to be transmitted with 1 / 2 as the new redundancy.

[0099] Through the above method, it is possible to reduce the problem of video freezing caused by the failure of FEC decoding recovery due to network fluctuations.

[0100] This application also proposes a video decoding method for obtaining the final transmitted video. For details, please refer to Figure 5 , Figure 5 which is a schematic flowchart of an embodiment of the video decoding method provided by this application.

[0101] As Figure 5 shown, the specific steps are as follows:

[0102] Step S21: Obtain a video bitstream, and obtain video packets and redundant packets based on the video bitstream.

[0103] Specifically, the electronic device obtains a video bitstream through a monitoring device or a video storage device, analyzes the video bitstream to obtain video characteristics, and obtains video packets and redundant packets of the video bitstream according to the video characteristics.

[0104] Among them, the video bitstream is encoded by the video encoding method in steps S11 - S14.

[0105] In an embodiment of this application, after step S21, the following steps may further be included:

[0106] When there is a packet loss in the video packets, obtain packet loss information. Transmit the packet loss information to the front-end video device so that the front-end video device can obtain the packet loss rate in the packet loss information, and the packet loss rate is used to calculate the redundancy.

[0107] Specifically, when the electronic device detects that there is a packet loss in the video packets, such as phenomena like video discontinuity, missing frames, snowflakes, freezing, etc., obtain the packet loss information. Among them, the packet loss information can be the video data of the missing frames or the missing video packets.

[0108] Furthermore, the electronic device transmits the packet loss information to the front-end device through a communication device or any server capable of transmitting data. The front-end device includes an FEC decoding module, and by analyzing the packet loss information, the packet loss rate in the packet loss information can be obtained. This packet loss rate is used to calculate the redundancy, and the specific calculation method is the same as that in steps S121 - S124, and will not be elaborated here.

[0109] Step S22: When the video packets are missing video data, extract the redundant video data missing from the video packets from the redundant packets.

[0110] Specifically, the electronic device parses the video packets. When the video packets are discontinuous or there are blanks, it extracts the missing redundant video data from the redundant packets, encodes the redundant video data into redundant packets according to the positions of the missing video packets and the video sequence of the original video, and performs re-encoding.

[0111] Step S23: Decode the video packets and the redundant video data to obtain the transmitted video.

[0112] Specifically, the electronic device decodes the video packets and the redundant video data proposed in step S22 in the order of addition to obtain a complete and continuous transmitted video.

[0113] Through steps S21 - S23, by combining the video characteristics and network conditions, forward error correction with a suitable redundancy is used to perform video transmission on the video data, improving the stability of video transmission and overcoming the problem of video stuttering easily occurring in the prior art when video transmission is in a scenario with large network fluctuations.

[0114] To further obtain the transmitted video, the present application also proposes an embodiment for implementing video decoding. For details, please refer to Figure 6 and Figure 7 , Figure 6 is a schematic flowchart of another embodiment of the video decoding method provided by the present application; Figure 7 is a schematic flowchart of the backend processing process of the video decoding method provided by the present application.

[0115] As Figure 6 shown, the specific steps are as follows:

[0116] Step S31: Obtain video packets based on the video bitstream and store the video packets in the video packet cache queue.

[0117] Specifically, the video transmission system includes a front-end video device and a backend video pulling device. The video transmission system obtains the video bitstream through the front-end video device. First, it determines whether to feedback packet loss information. If necessary, it performs packet loss information feedback, and further determines whether there is a packet loss phenomenon in the video stream. If not, it continues to determine whether the video stream is a video packet. If it is a video packet, it is placed in the video packet cache queue. If it is not a video packet, step S32 is executed.

[0118] Furthermore, in an embodiment of the present application, the electronic device can determine whether the video stream is a video packet or a redundant packet by calculating the data information or coding information in the video stream.

[0119] In other embodiments of the present application, it is also possible to determine whether the video stream is a video packet or a redundant packet by comparing with preset template information data.

[0120] Step S32: Obtain redundant packets based on the video bitstream, and store the redundant packets in the redundant packet cache queue.

[0121] Specifically, the electronic device transmits the video bitstream to the redundancy calculation module, obtains redundant data in the calculation manner of steps S121 - S124, obtains redundant packets through the FEC encoding module, and stores the redundant packets in the redundant packet cache queue.

[0122] Step S33: Determine whether there are missing video packets based on the video packets in the video packet cache queue.

[0123] Specifically, in an embodiment of the present application, the electronic device parses the video packets in the video cache queue, and further determines whether there are missing video packets in the video packets by judging the integrity and continuity of the video packets.

[0124] In other embodiments of the present application, the electronic device can directly display and play the video packets in the video packet cache queue. If situations such as stuttering, snowflakes, and extremely low clarity occur, it can be determined that there are missing video packets in the video packets.

[0125] When the electronic device detects that there are missing video packets in the video packet cache queue by any method, it executes step S34. If there are no missing video packets in the video packet cache queue, it continues to execute step S35.

[0126] Step S34: Extract the redundant video data missing from the video packets from the redundant packet cache queue, and decode the video packets in the video packet cache queue and the redundant video data to obtain the transmitted video.

[0127] Specifically, when the electronic device detects that there are missing video packets in the video cache queue, the redundant data in the redundant packet cache queue is added to the video packets, and the video packets added with the redundant data are decoded to obtain a complete and continuous transmitted video.

[0128] Step S35: Decode the video packets in the video packet cache queue to obtain the transmitted video.

[0129] Specifically, when there are no missing video packets, the electronic device directly decodes the video packets to obtain a complete and continuous transmitted video.

[0130] Through steps S31 - S35, redundant packets are set according to the video characteristics and network transmission information, and decoding is performed according to the redundant packet cache queue and the video packet cache queue to obtain the transmitted video, improving the video transmission quality.

[0131] The present application also proposes a video transmission method, which is applied to a video transmission system. Specifically, please refer to Figure 8 See Figure 9 ,Figure 9 It is a schematic flowchart of an embodiment of the video transmission method provided by this application. Figure 8 It is a schematic structural diagram of the video transmission system provided by this application.

[0132] As Figure 8 shown, the video transmission system includes a front-end video device and a back-end video pulling device.

[0133] As Figure 9 shown, the specific steps are as follows:

[0134] Step S41: The front-end video device acquires the video to be transmitted and its video characteristics.

[0135] Specifically, the front-end video device acquires the video to be transmitted and its video characteristics by real-time monitoring or retrieving stored records.

[0136] Among them, the front-end video device can be any monitoring device or video recording device.

[0137] Among them, the video characteristics of the video to be transmitted include but are not limited to the frame rate and bit rate of the video to be transmitted.

[0138] Furthermore, the front-end video device further includes an FEC redundancy calculation module and an FEC encoding module.

[0139] Step S42: The back-end video pulling device transmits the network status information to the front-end video device.

[0140] Specifically, the back-end video pulling device transmits the network status information of the network where the video to be transmitted is located to the front-end video device in real time through the communication module.

[0141] Among them, the network status information includes but is not limited to the packet loss rate and the size of the detected bandwidth.

[0142] Step S43: The front-end video device calculates the redundancy of the video to be transmitted according to the video characteristics and the network status information.

[0143] Specifically, the front-end video device is provided with a communication module and an FEC redundancy calculation module. The front-end video device acquires the network status information fed back by the back-end video pulling device through the communication module, and transmits the network status information and the video characteristics to the FEC redundancy calculation module at the same time. Through the FEC redundancy calculation module, the redundancy of the video to be transmitted is calculated. For the specific calculation method, please refer to Step S21 - Step S24.

[0144] Step S44: The front-end video device obtains the packet loss rate from the network status information, and determines whether the redundancy is less than or equal to the packet loss rate.

[0145] Specifically, the front-end video device analyzes the network status information, further obtains the packet loss rate, calculates the size relationship between the redundancy and the packet loss rate through a numerical comparator or a numerical algorithm module. If the redundancy is less than or equal to the packet loss rate, the redundancy is set by the method of steps S121 - S124. If the redundancy is greater than the packet loss rate, step S45 is continued to be executed.

[0146] Step S45: The front-end video device encodes the video to be transmitted according to the redundancy, obtains the encoded video stream, and transmits the video stream to the back-end video stream pulling device.

[0147] Specifically, when the redundancy is greater than the packet loss rate, the value of the packet loss rate is set to the value of the redundancy. The front-end video device encodes the video to be transmitted according to this value, that is, encodes by combining video data and redundant data, and further transmits the video stream to the back-end video stream pulling device.

[0148] Step S46: The back-end video stream pulling device obtains the video stream and obtains video packets and redundant packets based on the video stream.

[0149] Specifically, the back-end video stream pulling device obtains the video stream and obtains the video packets and redundant packets in the video stream. Among them, the video packets include several pieces of video data, and the redundant packets include several pieces of redundant data.

[0150] Furthermore, the back-end video stream pulling device also includes an FEC decoding module.

[0151] Step S47: When the video data in the video packet is missing, the back-end video stream pulling device extracts the redundant video data missing from the video packet from the redundant packet.

[0152] Specifically, when the back-end video stream pulling device has phenomena such as freezing or snowflakes, that is, when the video data in the video packet is missing, the back-end video stream pulling device parses the redundant packet through the FEC decoding module and obtains the missing data in the video packet from the redundant packet.

[0153] Step S48: The back-end video stream pulling device decodes the video packet and the redundant video data to obtain the transmitted video.

[0154] Specifically, the back-end video stream pulling device further decodes the redundant video data obtained in step S47 and the video data in the original video packet in a specific arrangement order to obtain the transmitted video.

[0155] Through steps S41 - S47, the forward error correction method with an adaptive redundancy rate is used to redundantly process the video data according to the video characteristics and the network conditions, solving the problem of the redundancy rate setting in the prior art. When the video is transmitted in a scenario with large network fluctuations, if the redundancy rate of the data is equal to the network packet loss rate, it is easy to cause video freezing.

[0156] To implement the above video encoding method, video decoding method, and video transmission method, the present application also proposes an electronic device. For details, please refer to Figure 10 , Figure 10 which is a schematic structural diagram of an embodiment of the electronic device provided by the present application.

[0157] The electronic device 400 in this embodiment includes a processor 41, a memory 42, an input / output device 43, and a bus 44.

[0158] The processor 41, the memory 42, and the input / output device 43 are respectively connected to the bus 44. Program data is stored in the memory 42, and the processor 41 is configured to execute the program data to implement the video encoding method, video decoding method, and video transmission method described in the above embodiments.

[0159] In the embodiments of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip with signal processing capabilities. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP, Digital Signal Process), an application-specific integrated circuit (ASIC, Application Specific Integrated Circuit), a field-programmable gate array (FPGA, Field Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor, or the processor 41 may also be any conventional processor, etc.

[0160] The present application also provides a computer storage medium. Please continue to refer to Figure 11 , Figure 11 which is a schematic structural diagram of an embodiment of the computer storage medium provided by the present application. A computer program 51 is stored in the computer storage medium 500. When the computer program 51 is executed by a processor, it is used to implement the video encoding method, video decoding method, and video transmission method described in the above embodiments.

[0161] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0162] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A video encoding method, characterized in that, The video encoding method includes: Obtain the video to be transmitted, as well as its video characteristics and network status information; Calculate the redundancy of the video to be transmitted according to the video characteristics and the network status information; Obtain the packet loss rate and determine whether the redundancy is less than or equal to the packet loss rate; If not, encode the video to be transmitted according to the redundancy to obtain the encoded video bitstream; The video encoding method further includes: When the redundancy is less than or equal to the packet loss rate, encode the video to be transmitted with the packet loss rate as the new redundancy and transmit the encoded video bitstream.

2. The video encoding method according to claim 1, wherein: The encoding the video to be transmitted according to the redundancy includes: Determine whether the redundancy is less than or equal to 1 / 2; If so, encode the video to be transmitted according to the redundancy; If not, encode the video to be transmitted with 1 / 2 as the new redundancy.

3. The video encoding method according to claim 1, wherein: The video characteristics include video frame rate and video bit rate, and the network status information includes available bandwidth; The calculating the redundancy of the video to be transmitted according to the video characteristics and the network status information includes: Calculate the frame size of the video to be transmitted according to the video frame rate and video bit rate; Obtain the single-frame video transmission time by using the frame size of the video to be transmitted and the available bandwidth, and obtain the single-frame redundant transmission time by using the frame rate and the single-frame video transmission time; Calculate the redundancy size according to the single-frame redundant transmission time and the available bandwidth; Calculate the redundancy of the video to be transmitted based on the redundancy size and the frame size.

4. A video decoding method, characterized in that, The video decoding method further includes: Obtain the video bitstream, and obtain video packets and redundant packets based on the video bitstream, wherein the video bitstream is encoded by the video encoding method according to any one of claims 1 to 3; When the video data is missing in the video packet, extract the redundant video data missing in the video packet from the redundant packets; Decode the video packet and the redundant video data to obtain the transmitted video.

5. The video decoding method according to claim 4, wherein: After obtaining the video packets and redundant packets based on the video bitstream, the video decoding method includes: When there is a packet loss in the video packet, obtain the packet loss information; Transmit the packet loss information to the front-end video device so that the front-end video device obtains the packet loss rate in the packet loss information, and the packet loss rate is used to calculate the redundancy.

6. The video decoding method according to claim 4, wherein: The video decoding method further includes: Obtain the video packets based on the video bitstream and store the video packets in the video packet cache queue; Obtain the redundant packets based on the video bitstream and store the redundant packets in the redundant packet cache queue; Judge whether the video packets are missing based on the video packets in the video packet cache queue; If so, extract the redundant video data missing from the video packet from the redundant packet cache queue, and decode the video packets in the video packet cache queue and the redundant video data to obtain the transmitted video; If not, decode the video packets in the video packet cache queue to obtain the transmitted video.

7. A video transmission method, characterized in that, The video transmission method is applied to a video transmission system, wherein the video transmission system includes a front-end video device and a back-end video streaming device; the video transmission method includes: The front-end video device acquires the video to be transmitted and its video characteristics; The back-end video streaming device transmits network status information to the front-end video device; The front-end video device calculates the redundancy of the video to be transmitted according to the video characteristics and the network status information; The front-end video device obtains the packet loss rate from the network status information and determines whether the redundancy is less than or equal to the packet loss rate; If not, the front-end video device encodes the video to be transmitted according to the redundancy, obtains the encoded video bitstream, and transmits the video bitstream to the back-end video streaming device; When the redundancy is less than or equal to the packet loss rate, encode the video to be transmitted with the packet loss rate as the new redundancy and transmit the encoded video bitstream.

8. The video transmission method according to claim 7, wherein After transmitting the video bitstream to the back-end video streaming device, the video transmission method further includes: The back-end video streaming device acquires the video bitstream and obtains video packets and redundant packets based on the video bitstream; When the video packet is missing video data, the back-end video streaming device extracts the redundant video data missing from the video packet from the redundant packets; The back-end video streaming device decodes the video packets and the redundant video data to obtain the transmitted video.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor coupled to the memory; Wherein, the memory is used to store program data, and the processor is used to execute the program data to implement the video encoding method according to any one of claims 1 to 3, the video decoding method according to any one of claims 4 to 6, and / or the video transmission method according to any one of claims 7 to 8.

10. A computer storage medium, characterized in that, The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the video encoding method according to any one of claims 1 to 3, the video decoding method according to any one of claims 4 to 6, and / or the video transmission method according to any one of claims 7 to 8.

Citation Information

Patent Citations

  • Audio and video transmission forward error correction method and device, computer equipment and storage medium

    CN109862440A

  • Data transmission method and device, electronic equipment and storage medium

    CN112821992A