CN113542871A - Decoding method and device, electronic equipment and computer readable storage medium - Google Patents

Decoding method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113542871A
CN113542871A CN202110764441.9A CN202110764441A CN113542871A CN 113542871 A CN113542871 A CN 113542871A CN 202110764441 A CN202110764441 A CN 202110764441A CN 113542871 A CN113542871 A CN 113542871A
Authority
CN
China
Prior art keywords
data packets
video segment
decoding
video
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110764441.9A
Other languages
Chinese (zh)
Other versions
CN113542871B (en
Inventor
陈共龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110764441.9A priority Critical patent/CN113542871B/en
Publication of CN113542871A publication Critical patent/CN113542871A/en
Application granted granted Critical
Publication of CN113542871B publication Critical patent/CN113542871B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Abstract

The embodiment of the application discloses a decoding method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: the method comprises the steps that a video to be decoded comprises at least one video segment, each video segment comprises a plurality of data packets, the number of the minimum number of data packets required by the video segment for decoding is determined by receiving the data packets of the video segment sent by a sending end according to the preset definition level of the video and the total number of the data packets of the video segment carried in the received data packets, and therefore in the process of receiving the data packets of the video segment, only the data packets matched with the minimum number of the data packets need to be received, and then the corresponding video segment can be obtained by decoding according to the received data packets matched with the minimum number of the data packets. The technical scheme of the embodiment of the application greatly optimizes the video clip decoding scheme.

Description

Decoding method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of data decoding technologies, and in particular, to a decoding method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Data interaction is often faced between the terminal and the server, wherein the data may be video stream data, and therefore, the codec of the video stream is also involved accordingly. At present, both a terminal and a server decode all data packets corresponding to a video stream of a certain video segment, thereby reducing decoding efficiency to a great extent.
Disclosure of Invention
In order to solve the foregoing technical problem, embodiments of the present application provide a decoding method and apparatus, an electronic device, and a computer-readable storage medium.
According to an aspect of the embodiments of the present application, a decoding method is provided, where a video to be decoded includes at least one video segment, each video segment includes a plurality of data packets, and the data packets corresponding to the at least one video segment are sent to a receiving end via a sending end for decoding processing, the method includes: receiving a data packet of a first video segment sent by the sending end; wherein the first video segment is one of the at least one video segment; determining a first minimum data packet quantity required by decoding the first video segment according to the preset definition level of the video and the total quantity of data packets of the first video segment carried in the received data packets; decoding the data packets corresponding to the first minimum number of data packets to obtain a video picture adaptive to the preset definition level; in the process of receiving the data packets of the first video segment, if the first accumulated total amount of the received data packets reaches the first minimum data packet amount, terminating receiving the data packets of the first video segment; decoding the received data packets of the first minimum number of data packets.
According to an aspect of the embodiments of the present application, there is provided a decoding apparatus, where a video to be decoded includes at least one video segment, each video segment includes a plurality of data packets, and the data packets corresponding to the at least one video segment are sent to a receiving end via a sending end to be decoded, the apparatus includes: the receiving module is configured to receive a data packet of a first video segment sent by the sending end; wherein the first video segment is one of the at least one video segment; the determining module is configured to determine a first minimum number of data packets required for decoding the first video segment according to a preset definition level of the video and a total number of data packets of the first video segment carried in the received data packets; decoding the data packets corresponding to the first minimum number of data packets to obtain a video picture adaptive to the preset definition level; the receiving module is further configured to terminate receiving the data packets of the first video segment if a first cumulative total of the received data packets reaches the first minimum number of data packets in the process of receiving the data packets of the first video segment; a decoding module configured to decode the received data packets of the first minimum number of data packets.
According to an aspect of the embodiments of the present application, there is provided an electronic device including a processor and a memory, the memory having stored thereon computer-readable instructions, which when executed by the processor, implement the decoding method as described above.
According to an aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon computer-readable instructions, which, when executed by a processor of a computer, cause the computer to perform the decoding method as described above.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the decoding method provided in the various alternative embodiments described above.
In the technical scheme provided by the embodiment of the application, a video to be decoded comprises at least one video segment, each video segment comprises a plurality of data packets, and the minimum number of data packets required by decoding the video segment is determined by receiving the data packets of the video segment sent by a sending end according to the preset definition level of the video and the total number of the data packets of the video segment carried in the received data packets, so that in the process of receiving the data packets of the video segment, only the data packets matched with the minimum number of data packets need to be received, and then the decoding is performed according to the received data packets matched with the minimum number of data packets, and all the data packets of the video segment do not need to be received and the decoding is not performed after all the data packets are received, thereby improving the decoding efficiency of the video segment; and because the video segment is a video segment in at least one video segment included in the video, the video decoding efficiency is improved while the video segment decoding efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
fig. 1 is a schematic diagram of a decoding cloud architecture shown in an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating a decoding method according to an exemplary embodiment of the present application;
fig. 3 is a schematic diagram of a decoding cloud architecture multiple transmission link shown in an exemplary embodiment of the present application;
FIG. 4 is a flow chart of step S130 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 5 is a flow chart of step S170 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 6 is a schematic diagram illustrating transmission of multiple data packets in accordance with an exemplary embodiment of the present application;
FIG. 7 is a schematic diagram illustrating transmission of multiple data packets in accordance with an exemplary embodiment of the present application;
FIG. 8 is a flow chart of step S170 in the embodiment shown in FIG. 2 in an exemplary embodiment;
fig. 9 is a flowchart illustrating a process of receiving and decoding a packet of a second video segment transmitted by a transmitting end after terminating a process of receiving a packet of a first video segment according to an exemplary embodiment of the present application;
fig. 10 is a flowchart illustrating a process of decreasing a preset sharpness level if all data packets of a first video segment sent by a sending end are received and a first cumulative total of the received data packets does not reach a first minimum number of data packets according to an exemplary embodiment of the present application;
fig. 11 is a block diagram of a decoding apparatus shown in an exemplary embodiment of the present application;
FIG. 12 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments identical to the present application. Rather, they are merely examples of the same apparatus and methods as some aspects of the present application, as detailed in the appended claims.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It should be noted that: reference to "a plurality" in this application means two or more. "and/or" describe the association relationship of the associated objects, meaning that there may be three relationships, e.g., A and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Cloud computing (cloud computing) refers to a delivery and use mode of an IT infrastructure, and refers to obtaining required resources in an on-demand and easily-extensible manner through a network; the generalized cloud computing refers to a delivery and use mode of a service, and refers to obtaining a required service in an on-demand and easily-extensible manner through a network. Such services may be IT and software, internet related, or other services. Cloud computing is a product of development and fusion of traditional computer and network technologies, such as grid computing, distributed computing, parallel computing, utility computing, network storage, virtualization, load balancing and the like.
With the development of diversification of internet, real-time data stream and connecting equipment and the promotion of demands of search service, social network, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Different from the prior parallel distributed computing, the generation of cloud computing can promote the revolutionary change of the whole internet mode and the enterprise management mode in concept.
The cloud server is a server based on cloud computing technology. In a video decoding scene, the cloud server interacts with the terminal; specifically, the terminal transmits the collected video stream data to the cloud server through the network, and the cloud server receives the video stream data and then correspondingly decodes the video stream data to obtain decoded video stream data, and/or the cloud server transmits the collected video stream data to the terminal through the network, and the terminal receives the video stream data and then correspondingly decodes the video stream data to obtain decoded video stream data.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a decoding cloud architecture according to an exemplary embodiment of the present application. As can be seen from the decoding cloud architecture shown in fig. 1, the cloud server 20 has logic computation and coding and decoding logic, and the cloud server 20 receives and decodes the video stream transmitted by the terminal 10 through the network, and/or the terminal 10 has logic computation and coding and decoding logic, and the terminal 10 receives and decodes the video stream transmitted by the cloud server 20 through the network. The terminal 10 may support accessing the input device 30 to generate the device instructions.
It should be noted that the terminal 10 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like, but is not limited thereto. The cloud server 20 is a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, web services, cloud communication, middleware services, domain name services, security services, a CDN (Content Delivery Network), and a big data and artificial intelligence platform. The input device 30 may be a keyboard, mouse, joystick, or the like, although this is not intended to be limiting.
In some examples, the cloud server 20 shown in fig. 1 may also be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and the like, which is not limited herein.
It should be noted that, in this embodiment, video decoding is performed, where the video is sent from a sending end to a receiving end, where the video to be decoded includes at least one video segment, that is, the video to be decoded may include one or more consecutive video segments, and each video segment includes a plurality of data packets.
Referring to fig. 2, fig. 2 is a flowchart illustrating a decoding method according to an exemplary embodiment of the present application. The method may be performed by the cloud server 20 in the decoding cloud architecture shown in fig. 1. As shown in fig. 2, the decoding method at least includes steps S110 to S170, which are described in detail as follows:
step S110, receiving a data packet of a first video segment sent by a sending end; wherein the first video segment is one of the at least one video segment.
The first video segment in this embodiment refers to one of at least one video segment included in the video to be decoded; wherein the video may include one or more continuous video segments, when the video includes one video segment, for example, the video includes video segment 1, the first video segment is video segment 1; when the video includes a plurality of consecutive video segments, for example, the video includes video segments 1-2, the first video segment is any one of the video segments 1-2, that is, the first video segment may be video segment 1 or video segment 2.
In some examples, the video to be decoded may be live video; the core idea of live video refers to that a user can watch live audio and video scenes, such as events, meetings, teaching, operations and the like, which are carried out at a far end through a network.
In some examples, the video to be decoded may be a recorded video; the recording and playing of the video refers to integrating video, audio and image signals of electronic equipment which are shot and recorded on site, generating a standardized streaming media file, and uploading the standardized streaming media file to a corresponding website for a user to watch.
It can be understood that the video segments are transmitted in the form of video streams during transmission, and the video streams are transmitted in the form of data packets divided into one data packet; for example, the data size K corresponding to the entire video stream is allocated to n packets for transmission, and the size of each of the n packets is [ K1K 2K 3 … … kn ], so that theoretically K ═ K1 × 1+ K2 × 2+ K3 + 3+ … … + kn, and actually K < K1 × 1+ K2 × 2+ K3 × 3+ … … + kn, because each packet contains some other data, such as the total size K of the video stream, the total number n of packets divided into packets, and the sequence number, size, etc. of each packet.
Step S130, determining a first minimum data packet quantity required by decoding a first video segment according to a preset definition level of a video and the total quantity of data packets of the first video segment carried in a received data packet; and decoding the data packets corresponding to the first minimum data packet quantity to obtain a video picture adaptive to the preset definition level.
The preset definition level of the video in the embodiment refers to the definition of a video picture after the video is decoded; the definition can be divided into standard definition, high definition, super definition or blue light and the like, and the definition grade value is usually preset to be better as clear as possible, namely the definition grade value sequence can be preset to be blue light, super definition, high definition or standard definition.
In this embodiment, the total amount of the data packets of the first video segment refers to the number of all the data packets corresponding to the first video segment itself; for example, in the above example, the total number of packets of the first video segment is n, and the cumulative size of n packets (K1 × 1+ K2 × 2+ K3 × 3+ … … + kn × n) is theoretically equal to the size K of the first video segment itself.
In this embodiment, the first minimum number of data packets refers to the minimum number of data packets required for decoding the first video segment, and for the same first video segment, the corresponding first minimum number of data packets is less than the total number of data packets corresponding to the first minimum number of data packets; for example, the preset definition level is set to be high definition, the total amount of data packets of the first video segment carried in the received data packets is set to be n, and according to the high definition and the total amount of the data packets n, the first minimum number of data packets required by the decoding of the first video segment is determined to be q, wherein q is less than n. It can be understood that decoding the minimum number of packets may obtain the decoded first video segment, and a video picture corresponding to the decoded first video segment is adapted to the preset definition level; for example, if it is determined that the first minimum number of data packets of the first video segment is q according to the preset definition level of high definition and the total number n of data packets of the first video segment, the q data packets are decoded to obtain the decoded first video segment, where a video picture corresponding to the decoded first video segment is also high-definition.
Step S150, in the process of receiving the data packets of the first video segment, if the first cumulative total of the received data packets reaches the first minimum number of data packets, terminating receiving the data packets of the first video segment.
In this embodiment, the first cumulative total of the received data packets refers to a first cumulative total of the currently received data packets obtained by accumulating the number of the received data packets during the receiving process of the data packets of the first video segment.
In this embodiment, in the process of receiving the data packets of the first video segment, the first cumulative total of the received data packets is monitored, and if it is monitored that the first cumulative total of the received data packets reaches the first minimum number of data packets, it is characterized that the received data packets can already implement decoding of the first video segment, and therefore it is necessary to terminate receiving the data packets of the first video segment, so as to save the receiving time of other data packets of the first video segment and implement fast decoding of the first video segment.
Referring to fig. 3, fig. 3 is a schematic diagram of a decoding cloud architecture according to another exemplary embodiment of the present application. As can be seen from the decoding cloud architecture shown in fig. 3, the data packets of the first video segment are transmitted between the terminal 10 and the cloud server 20 through at least two transmission links. In some examples, the at least two transmission links may be links formed by a cellular network, such as 5G base stations, 4G base stations, and so on. In some examples, the at least two transmission links may be links formed by a wireless network, such as WiFi APs or the like. In some examples, the at least two transmission links may be links formed by a cellular network and a wireless network, such as a 5G base station, a 4G base station, a WiFi AP, and so on.
In some examples, the first video segment is transmitted through at least two transmission links, specifically, the number of data packets received through each transmission link is respectively obtained, and the sum operation is performed on the numbers received through the at least two transmission links to obtain the first cumulative total. The number of the data packets received by each transmission link is obtained, specifically, the number of the data packets received by each transmission link is initialized first, and if it is monitored that each transmission link receives one data packet, the number of the data packets received by the corresponding transmission link is controlled to be accumulated by 1.
For example, assuming that data packets of the first video segment are transmitted between the terminal 10 and the cloud server 20 through 3 transmission links, where the transmission links are L1, L2, and L3, respectively, first, the number S2 of the data packets received by each transmission link is initialized, that is, S2(L1) is 0, S2(L2) is 0, and S2(L3) is 0, if it is monitored that each transmission link receives one data packet, the number of the data packets received by the corresponding transmission link is controlled to be accumulated by 1, which is set in a time period t1, S2(L1) is 50, S2(L2) 25, and S2(L3) is 25, so that in the time period t1, the first accumulated total amount S1 is S2(L1) + S2(L2) + S2(L3) is 100.
It should be noted that, in this embodiment, the data packets of the first video segment are transmitted through at least two transmission links, compared with the case that the data packets of the first video segment are transmitted through only one transmission link in the prior art, the transmission rate of the data packets of the first video segment can be greatly increased, and a phenomenon that the transmission rate of the data packets of the first video segment is slow due to the fact that the data packets of the first video segment are transmitted through only one transmission link is avoided.
Step S170, decoding the received data packets with the first minimum number of data packets.
In this embodiment, when the first cumulative total of the received data packets reaches the first minimum data packet number, the data packets matching the first minimum data packet number may be decoded, so as to obtain a decoded first video segment; for example, the first cumulative total of received data packets reaches the first minimum number q of data packets, then the q data packets are decoded at this time to obtain the decoded first video segment.
It should be noted that, in the process of receiving the data packets of the video segment, the embodiment only needs to receive the data packets matched with the minimum number of data packets, and then performs decoding according to the received data packets matched with the minimum number of data packets, without waiting for receiving all the data packets of the video segment and without performing decoding after all the data packets are received, thereby improving the decoding efficiency of the video segment; and because the video segment is a video segment in at least one video segment included in the video, the video decoding efficiency is improved while the video segment decoding efficiency is improved.
Fig. 4 is a flow chart of step S130 in the embodiment shown in fig. 2 in an exemplary embodiment. As shown in fig. 4, the process of determining the first minimum number of packets required for decoding the first video segment according to the preset video definition level and the total number of packets of the first video segment carried in the received packets may include steps S131 to S133, which are described in detail as follows:
step S131, obtaining the total amount of error code bytes corresponding to the preset definition level.
The total number of error bytes in this embodiment refers to the maximum number of error bytes that can be discarded during the transmission of the video. It is understood that the byte is a measurement unit used by computer information technology to measure the storage capacity, one byte stores 8-bit unsigned numbers, and the stored value ranges from 0 to 255, so that the maximum number of error bytes that can be discarded can be calculated in the measurement unit of byte in this embodiment. The total amount of error code bytes corresponding to different preset definition levels is different, and generally speaking, the higher the preset definition level is, the less the total amount of error code bytes can be discarded; for example, see table 1 below, which is an exemplary table of predetermined levels of resolution versus total number of bytes in error.
Preset sharpness level Total number of error bytes
Blue light B1
Super clean B2
High definition B3
Standard definition B4
TABLE 1
As can be seen from Table 1, the total amount of error bytes corresponding to different preset resolution levels is different, wherein B1 < B2 < B3 < B4.
Step S132, determining the number of data packets which can be discarded according to the total number of error code bytes and the byte length of the preset data packets.
In this embodiment, after obtaining the total amount of error code bytes corresponding to the preset definition level, the number of data packets that can be discarded is determined according to the total amount of error code bytes and the preset data packet byte length.
In this embodiment, the preset data packet byte length refers to a byte length corresponding to a data packet. It can be understood that the byte lengths of the data packets are generally different under different protocols or different application scenarios, wherein the byte length corresponding to the data packet can be obtained from the first preset field of the data packet.
In some examples, byte lengths corresponding to the plurality of data packets may be respectively obtained from the plurality of received data packets of the first video segment, and if the byte lengths corresponding to the plurality of data packets are not the same, a corresponding preset data packet length is generated according to an input operation of a user. That is, if the byte lengths corresponding to the plurality of data packets of the first video segment are different, the preset data packet byte length may be generated according to the user input operation, that is, one preset data packet byte length is specified, thereby facilitating the subsequent calculation of the number of data packets that can be discarded.
In some examples, byte lengths corresponding to the plurality of data packets may be respectively obtained from the plurality of received data packets of the first video segment, and if the byte lengths corresponding to the plurality of data packets are the same, the byte length is taken as a preset data packet length. That is, if the byte lengths corresponding to the plurality of packets of the first video segment are the same, the byte length corresponding to any one packet may be used as the preset packet length, thereby facilitating the subsequent calculation of the number of packets that can be discarded.
Step S133, performing a difference operation on the total amount of the data packets of the first video segment and the number of the data packets that can be discarded, to obtain a first minimum number of data packets required for decoding the first video segment.
In this embodiment, after the total amount of the data packets of the first video segment and the number of the data packets that can be discarded are obtained, a difference operation needs to be performed on the total amount of the data packets and the number of the data packets that can be discarded, so that a first minimum number of data packets required for decoding the first video segment is obtained; for example, if the total amount of packets acquired into the first video segment is n and the number of packets that can be discarded is b, the first minimum number of packets q is n-b.
It should be noted that, in this embodiment, the number of data packets that can be discarded is determined by the total number of error code bytes corresponding to the preset definition level and the preset data packet byte length, and the first minimum number of data packets required for decoding the first video segment can be obtained according to the total number of data packets of the first video segment and the number of data packets that can be discarded, which is small in calculated data amount and simple in calculation process.
Fig. 5 is a flow chart of step S170 in the embodiment shown in fig. 2 in an exemplary embodiment. As shown in fig. 5, the process of decoding the received data packet with the first minimum number of data packets may include steps S171 to S172, which are described in detail as follows:
step S171, sorting the data packets with the first least number of data packets according to the sequence numbers of the data packets with the first least number of data packets to obtain a sorting result; wherein, the sequencing result is a non-continuous sequence number sequence.
In this embodiment, if the data packet with the first minimum number of data packets is a plurality of data packets, sequence numbers corresponding to the plurality of data packets may be respectively obtained from second preset fields of the plurality of data packets, where the sequence numbers are sequence number identifiers used for representing that a video stream of a first video segment is divided into the plurality of data packets and the sequence numbers are in a sequence number sequence formed; for example, if the sequence number of the data packet is 1, it indicates that the data packet is the 1 st data packet that needs to be decoded in the first video segment, and so on.
In some examples, referring to fig. 6, the video stream of the first video segment is divided into n packets for transmission, where each packet corresponds to a sequence number, and the sequence number sequence formed by each packet is continuous, such as sequence number sequence 1, 2, 3, 4 … … n.
In some examples, please refer to fig. 7, the video stream of the first video segment is divided into n packets for transmission, where each packet corresponds to a sequence number, and the sequence number sequence formed by each packet is non-consecutive, such as sequence number sequences 1, 3, 5, 7 … … n; in practical applications, the non-consecutive sequence numbers only satisfy the predetermined ordering rule, such as the difference between the sequence numbers of the adjacent data packets is 2 as illustrated in fig. 7.
It can be understood that due to network congestion and other reasons, the arrival time of different data packets is different, and packet loss occurs during transmission. For example, as shown in fig. 6, the transmission sequence of the data packet is sequence number 1, sequence number 2, sequence number 3, sequence number 4 … …, sequence number n-1, sequence number n, while the reception sequence of the data packet is sequence number 1, sequence number 4, sequence number 3 … …, sequence number n-1; that is, during the transmission of the data packet, the data packet with sequence number 2 is discarded (only sequence numbers 1-4 are used for explanation here), and the receiving sequence of the data packet that is not discarded is also changed, for example, under the condition of not being influenced by other factors such as the network, the receiving sequence of sequence number 3 should be earlier than sequence number 4, and the receiving sequence of sequence number n-1 should be earlier than sequence number n. Similarly, as shown in FIG. 7, the transmission sequence of the data packet is sequence number 1, sequence number 3, sequence number 5, sequence number 7 … …, sequence number n-2, sequence number n, while the reception sequence of the data packet is sequence number 1, sequence number 7, sequence number 3 … …, sequence number n-2, sequence number n; that is, during the transmission of the data packet, the data packet with sequence number 5 is discarded (only sequence numbers 1-7 are used for explanation here), and the receiving sequence of the data packet without discarding is also changed, for example, under the condition of not being influenced by other factors such as the network, the receiving sequence of sequence number 3 should be earlier than sequence number 7.
Therefore, in this embodiment, the data packets with the first minimum number of data packets need to be reordered according to the sequence numbers of the data packets with the first minimum number of data packets, so that the receiving order is a receiving order that is not affected by other factors such as a network, and a ranking result is obtained. For example, referring to fig. 6 again, after the sequence is performed, the sequence numbers are sequence number 1, sequence number 3, sequence number 4 … …, sequence number n-1, and sequence number n, wherein after the data packet with sequence number 2 is discarded, the obtained sequence result is a non-continuous sequence number. Similarly, referring to fig. 7 again, after the sequence is performed, the sequence numbers are sequence number 1, sequence number 3, sequence number 7 … …, sequence number n-2, and sequence number n, wherein after the data packet with sequence number 5 is discarded, the obtained sequence result is also a non-continuous sequence number.
Step S172, decoding the data packets with the first least number of data packets according to the sorting result.
In this embodiment, the data packets with the first minimum number of data packets are sequenced according to the sequence numbers of the data packets with the first minimum number of data packets, and after the sequencing result is obtained, the data packets with the first minimum number of data packets need to be decoded according to the sequencing result.
In this embodiment, the data packets with the first minimum number of data packets are sequenced according to the sequence numbers of the obtained data packets with the first minimum number of data packets, so as to obtain a sequencing result, specifically, the data packet with the first sequence number in the sequence number sequence is determined as an initial data packet, where the sequence number of the data packet with the first sequence number is the smallest, and then decoding is performed from the initial data packet until decoding of the data packet with the last sequence number in the sequence number sequence is completed, where the sequence number of the data packet with the last sequence number is the largest. For example, referring to fig. 6 and fig. 7 again, the data packet with sequence number 1 is determined as the initial data packet, and the decoding is performed from the initial data packet until the data packet with sequence number n is decoded, at which time the decoding of the first video segment is completed.
In some examples, after the data packets with the first minimum number of data packets are sorted according to the obtained sequence numbers of the data packets with the first minimum number of data packets and a sorting result is obtained, the sequence numbers of the data packets with the first minimum number of data packets may be further updated so that the sequence number sequence is a continuous sequence number sequence.
For example, after the sequence shown in fig. 6, the sequence numbers 1, 3, 4 … … n-1 and n can be updated to sequence numbers 1, 2, 3 … … n-1 and n to obtain a continuous sequence. Similarly, as shown in fig. 7, when the sequence numbers are sequence number 1, sequence number 3, sequence number 7 … …, sequence number n-2, and sequence number n, the sequence numbers can be updated to sequence number 1, sequence number 2, sequence number 3 … …, sequence number n-1, and sequence number n to obtain a continuous sequence number.
It should be noted that, in this embodiment, the received multiple data packets that are matched with the first minimum number of data packets are sequenced according to the sequence numbers of the data packets with the first minimum number of data packets, so that decoding is performed according to the sequencing result, accuracy of decoding the first video segment is ensured, and a phenomenon that decoding is scrambled due to direct decoding of the first video segment caused by a corresponding change in the receiving sequence of the data packets is avoided.
Fig. 8 is a flowchart of step S170 in the embodiment shown in fig. 2 in an exemplary embodiment. As shown in fig. 8, the process of decoding the received data packet with the first minimum number of data packets may include steps S173 to S174, which are described in detail as follows:
step S173, if there are data packets with different byte lengths from the preset data packet byte length in the data packets with the first minimum number of data packets, performing byte addition on the data packets with the byte lengths smaller than the preset data packet byte length, and performing byte segmentation on the data packets with the byte lengths larger than the preset data packet byte length, so that the byte lengths of the data packets with the first minimum number of data packets are the same as the preset data packet byte length.
In this embodiment, the byte lengths corresponding to the plurality of data packets may be respectively obtained from the plurality of received data packets that are matched with the first minimum number of data packets, and if the byte length of the data packet is different from the byte length of the preset data packet, the byte length of the corresponding data packet is adjusted to the preset data packet length. That is, if the byte length corresponding to a certain/some of the received data packets is different from the preset data packet byte length, the byte length can be adjusted to the byte length same as the preset data packet byte length, so that the byte lengths corresponding to the data packets are all the same, and the decoding efficiency of the first video segment can be further improved.
It can be understood that, when the byte length of a data packet is adjusted, for a data packet smaller than the preset data packet byte length, byte addition is required, that is, the byte content originally belonging to another data packet may be correspondingly divided into the data packet; for a data packet with a length larger than the byte length of a preset data packet, byte segmentation is required, namely, the byte content originally belonging to the data packet may be correspondingly segmented into another data packet; in practical application, flexible adjustment is required according to specific application scenarios.
It is understood that, in the embodiment, there may be data packets with the same byte length as the preset data packet in the data packets with the first minimum number of data packets, and then the byte length of a certain/some data packets with the same byte length as the preset data packet does not need to be adjusted. However, in some scenarios, even if the byte length of a certain/some data packets is the same as the preset data packet byte length, the corresponding byte content may be changed correspondingly; for example, the above-mentioned byte content originally belonging to another data packet may be divided into the data packets, and the byte content originally belonging to the data packet may be divided into another data packet, and the byte length occupied by the data content divided into another data packet may be exactly equal to the byte length occupied by the data content divided into another data packet.
In step S174, the data packets with the first minimum number of data packets are decoded.
It should be noted that, in this embodiment, the byte lengths of the plurality of data packets matching the first minimum number of data packets are all unified into the same byte length, that is, unified into the preset data packet byte length, so that the byte length of each data packet can be known during decoding, thereby further improving the decoding efficiency of the first video segment.
Referring to fig. 9, fig. 9 is a flowchart illustrating a decoding method according to another exemplary embodiment of the present application. As shown in fig. 9, after terminating the process of receiving the data packets of the first video segment, the method may further include steps S190 to S250, which are described in detail as follows:
step S190, receiving a data packet of a second video segment sent by a sending end; the second video segment is a video segment which is positioned after the first video segment in the plurality of continuous video segments.
It can be understood that, in most application scenarios, when the video includes a plurality of consecutive video segments, in order to further improve the decoding efficiency of the video, the plurality of consecutive video segments in the video may be decoded by using the above-mentioned decoding manner of the first video segment. For example, a video to be decoded is divided into 2 video segments 1-2 according to a playing sequence, where a first video segment is a video segment 1, and a second video segment is a video segment 2, and after the video segment 1 is decoded by using the decoding method described in the above embodiment, the video segment 2 may also be decoded by using the decoding method described in the above embodiment.
Step S210, determining a second minimum number of data packets required for decoding the second video segment according to the preset definition level of the video and the total number of data packets of the second video segment carried in the received data packets.
In step S230, in the process of receiving the data packets of the second video segment, if the second cumulative total of the received data packets reaches the second minimum number of data packets, the receiving of the data packets of the second video segment is terminated.
Step S250, decoding the second video segment based on the data packets with the second minimum number of data packets.
It can be understood that, in this embodiment, decoding of the second video segment is described, where the receiving and decoding processes of the data packets of the second video segment are similar to the receiving and decoding processes of the data packets of the first video segment described in the above embodiment, and repeated description is omitted here; for the purpose of distinction, the minimum number of packets required for decoding the second video segment is referred to as a second minimum number of packets, and the cumulative total of the packets of the second video segment received during the process of receiving the packets of the second video segment is referred to as a second cumulative total.
It should be noted that, in this embodiment, the packets with the minimum number of packets corresponding to each of the multiple consecutive video segments included in the video are all decoded, so that the decoding efficiency of the multiple video segments can be improved, and accordingly, the decoding efficiency of the video is further improved.
Referring to fig. 10, fig. 10 is a flowchart illustrating a decoding method according to another exemplary embodiment of the present application. As shown in fig. 10, the method may further include step S180, which is described in detail as follows:
step S180, if all the data packets of the first video segment sent by the sending end are received and the first accumulated total amount of the received data packets does not reach the first minimum data packet amount, reducing the preset definition level, so that in the process of receiving the data packets of the second video segment, the second minimum data packet amount required by the decoding of the second video segment is determined according to the reduced preset definition level and the total amount of the data packets carried in the received data packets.
In this embodiment, if all the data packets of the first video segment sent by the sending end are received and the first cumulative total amount of the received data packets does not reach the first minimum data packet amount, it represents that the network is not good at this time, and there are situations such as network congestion, so that the preset definition level can be reduced, so as to facilitate transmission and decoding of the second video segment.
In some examples, whether to decrease the preset definition level of the first video segment may be further determined according to a preset data packet receiving duration, and specifically, if all data packets of the first video segment sent by the sending end are received within the preset data packet receiving duration and the first cumulative total amount of the received data packets does not reach the first minimum data packet amount, the preset definition level may be decreased. The method includes the steps that a timer is set, a preset data packet receiving time length is set for the timer, the timer counts time from the beginning of receiving data packets of a first video segment, if all data packets of the first video segment sent by a sending end are received when the preset data packet receiving time length set by the timer is up, and the first accumulated total amount of the received data packets does not reach the first minimum data packet amount, the preset definition level can be reduced at the moment so that transmission and decoding of a second video segment are facilitated.
It can be understood that, in the process of receiving the data packet of the second video segment, the second minimum number of data packets required for decoding the second video segment may be determined according to the reduced preset definition level and the total number of data packets carried in the received data packet, and if the second cumulative total number of received data packets reaches the second minimum number of data packets, the receiving of the data packet of the second video segment is terminated at this time, and the data packet of the received second minimum number of data packets is decoded to obtain the decoded second video segment, where the definition level of the decoded second video segment is lower than the preset definition level.
For example, let the video include a first video segment 1 and a second video segment 2, and the preset definition level of the video be super-definition; in the process of receiving the data packets of the first video segment 1, if all the data packets of the first video segment 1 sent by the sending end are received and the first cumulative total 85 of the received data packets does not reach the first minimum data packet quantity 90, decoding is performed according to the received 85 data packets to obtain the decoded first video segment 1, and meanwhile, the 'super-definition' level is reduced to 'high-definition'. Wherein, in the process of receiving the data packets of the second video segment 2, the second minimum data packet quantity required for decoding the second video segment 2 is determined according to the preset definition level high definition and the data packet quantity of the second video segment 2, the data packet quantity of the first video segment 1 and the data packet quantity of the second video segment 2 are set to be the same (or different in practical application), at this time, the second minimum data packet quantity is determined to be 80, then, during reception of the packets of the second video segment 2, if the second cumulative total of the received packets reaches the second minimum packet number 80, the reception of the data packets of the second video segment 2 is terminated, and the decoding is performed according to the 80 data packets matched with the received second minimum data packet number to obtain the decoded second video segment 2, so that the decoding of the whole video is completed.
It is understood that in practical applications, the video further includes a plurality of consecutive video segments, for example, the video includes a first video segment 1, a second video segment 2, a third video segment 3, a fourth video segment 4, and so on, as in the above example.
It should be noted that, in this embodiment, by receiving all the data packets of the first video segment sent by the sending end, and when the first cumulative total of the received data packets does not reach the first minimum number of data packets, the preset definition level is reduced to match the current network condition, so that it is ensured that the subsequent video segment sent by the sending end can be decoded quickly.
Fig. 11 is a block diagram of a decoding apparatus shown in an exemplary embodiment of the present application. As shown in fig. 11, a video to be decoded includes at least one video segment, each video segment includes a plurality of data packets, and the data packets corresponding to the at least one video segment are sent to a receiving end via a sending end for decoding processing, and the apparatus includes:
a receiving module 410 configured to receive a data packet of a first video segment sent by a sending end; the first video clip is one of at least one video clip;
a determining module 430, configured to determine, according to a preset definition level of a video and a total amount of data packets of a first video segment carried in a received data packet, a first minimum number of data packets required for decoding the first video segment; decoding the data packets corresponding to the first minimum data packet quantity to obtain a video picture adaptive to a preset definition level;
the receiving module 410 is further configured to, during the process of receiving the data packets of the first video segment, terminate receiving the data packets of the first video segment if the first cumulative total of the received data packets reaches the first minimum number of data packets;
the decoding module 450 is configured to decode the received data packets with the first minimum number of data packets.
In this embodiment, a video to be decoded includes at least one video segment, and each video segment includes a plurality of data packets, and the minimum number of data packets required for decoding the video segment is determined by receiving a data packet of the video segment sent by a sending end according to a preset definition level of the video and the total number of data packets of the video segment carried in the received data packet, so that in the process of receiving the data packet of the video segment, only the data packet matched with the minimum number of data packets needs to be received, and then decoding is performed according to the received data packet matched with the minimum number of data packets, and it is not necessary to wait for receiving all data packets of the video segment and decode after all data packets are received, thereby improving the decoding efficiency of the video segment; and because the video segment is a video segment in at least one video segment included in the video, the video decoding efficiency is improved while the video segment decoding efficiency is improved.
In another exemplary embodiment, the determining module 430 includes:
a first obtaining unit configured to obtain a total number of error code bytes corresponding to a preset definition level; the first determining unit is configured to determine the number of data packets which can be discarded according to the total number of error code bytes and the byte length of a preset data packet; and the difference calculating unit is configured to perform difference calculating operation on the total amount of the data packets of the first video segment and the number of the data packets which can be discarded, so as to obtain a first minimum number of data packets required for decoding the first video segment.
In another exemplary embodiment, the determining module 430 further comprises:
the second obtaining unit is configured to obtain byte lengths corresponding to the plurality of data packets respectively before determining the number of the data packets which can be discarded according to the total number of the error code bytes and the byte length of the preset data packet; the generating unit is configured to generate a corresponding preset data packet length according to the input operation of a user if the byte lengths corresponding to the plurality of data packets are different; the second determining unit is further configured to take the byte length as the preset data packet length if the byte lengths corresponding to the plurality of data packets are the same.
In another exemplary embodiment, the decoding module 450 includes:
the adjusting unit is configured to perform byte addition on the data packets smaller than the byte length of the preset data packets and perform byte segmentation on the data packets larger than the byte length of the preset data packets if the data packets with the byte length different from the byte length of the preset data packets exist in the data packets with the first minimum data packet number, so that the byte length of the data packets with the first minimum data packet number is the same as the byte length of the preset data packets; a decoding unit configured to decode the data packets of the first minimum number of data packets.
In another exemplary embodiment, a video includes a plurality of continuous video segments, and data packets corresponding to the plurality of continuous video segments are sequentially sent to a receiving end via a sending end for decoding processing;
a receiving module 410, further configured to receive a data packet of a second video segment sent by a sending end after terminating receiving the data packet of the first video segment; the second video clip is a video clip positioned after the first video clip in the plurality of continuous video clips; the determining module 430 is further configured to determine a second minimum number of data packets required for decoding the second video segment according to the preset definition level of the video and a total number of data packets of the second video segment carried in the received data packets; the receiving module 410 is further configured to, in the process of receiving the data packets of the second video segment, terminate receiving the data packets of the second video segment if the second cumulative total of the received data packets reaches the second minimum number of data packets; the decoding module 450 is further configured to decode the second video segment based on the second least number of packets.
In another exemplary embodiment, the apparatus further comprises:
and the reducing module is configured to reduce the preset definition level if all the data packets of the first video segment sent by the sending end are received and the first accumulated total amount of the received data packets does not reach the first minimum data packet amount, so that in the process of receiving the data packets of the second video segment, the second minimum data packet amount required by decoding the second video segment is determined according to the reduced preset definition level and the total amount of the data packets carried in the received data packets.
In another exemplary embodiment, the decoding unit includes:
and the decoding subunit is configured to, after the preset definition level is reduced, decode the received data packets with the second minimum number of data packets to obtain a decoded second video segment, where the definition level of the decoded second video segment is lower than the preset definition level.
In another exemplary embodiment, the data packets of the first video segment are transmitted over at least two transmission links, and the determining module 430 further comprises:
a third obtaining unit configured to obtain the number of data packets received through each transmission link after receiving the data packets of the first video segment; and the first summation unit is configured to perform summation operation on the quantities received by the at least two transmission links to obtain a first accumulated total quantity.
In another exemplary embodiment, the third acquisition unit includes:
the initialization unit is configured to initialize the number of the data packets received by each transmission link; and the second summing unit is configured to control the number of the data packets received by the corresponding transmission link to be added by 1 if the transmission link is monitored to receive one data packet every time.
In another exemplary embodiment, the decoding module 450 further includes:
the sequencing unit is configured to sequence the data packets with the first least number of data packets according to the sequence numbers of the data packets with the first least number of data packets to obtain a sequencing result; wherein, the sequencing result is a discontinuous sequence number sequence; and the decoding unit is also configured to decode the plurality of data packets according to the sequencing result so as to obtain a decoded video.
In another exemplary embodiment, the decoding unit further includes:
a third determining unit configured to determine a data packet with a first sequence number in the sequence number sequence as an initial data packet; wherein, the sequence number of the data packet with the sequence number arranged at the head is the minimum; the decoding subunit is also configured to start decoding from the initial data packet until the decoding of the data packet with the last sequence number in the sequence of sequence numbers is completed; wherein, the data packet with the sequence number arranged at the last bit has the largest sequence number.
In another exemplary embodiment, the decoding module 450 further includes:
and the updating unit is configured to sequence the data packets with the first least number of data packets according to the sequence numbers of the acquired data packets with the first least number of data packets, and update the sequence numbers of the data packets with the first least number of data packets after a sequencing result is obtained, so that the sequence number sequence is a continuous sequence number sequence.
It should be noted that the apparatus provided in the foregoing embodiment and the method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit execute operations has been described in detail in the method embodiment, and is not described again here.
Embodiments of the present application also provide an electronic device comprising a processor and a memory, wherein the memory has stored thereon computer-readable instructions, which when executed by the processor, implement the foregoing decoding method.
FIG. 12 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system 1600 of the electronic device shown in fig. 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 application.
As shown in fig. 12, the computer system 1600 includes a Central Processing Unit (CPU)1601, which can perform various appropriate actions and processes, such as executing the method in the above-described embodiment, according to a program stored in a Read-Only Memory (ROM) 1602 or a program loaded from a storage portion 1608 into a Random Access Memory (RAM) 1603. In the RAM 1603, various programs and data necessary for system operation are also stored. The CPU1601, ROM 1602, and RAM 1603 are connected to each other via a bus 1604. An Input/Output (I/O) interface 1605 is also connected to the bus 1604.
The following components are connected to the I/O interface 1605: an input portion 1606 including a keyboard, a mouse, and the like; an output section 1607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 1608 including a hard disk and the like; and a communication section 1609 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1609 performs communication processing via a network such as the internet. The driver 1610 is also connected to the I/O interface 1605 as needed. A removable medium 1611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1610 as necessary, so that a computer program read out therefrom is mounted in the storage portion 1608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1609, and/or installed from the removable media 1611. When the computer program is executed by a Central Processing Unit (CPU)1601, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the decoding method as before. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the decoding method provided in the above embodiments.
The above description is only a preferred exemplary embodiment of the present application, and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A decoding method is characterized in that a video to be decoded comprises at least one video segment, each video segment comprises a plurality of data packets, and the data packets corresponding to the at least one video segment are sent to a receiving end through a sending end for decoding processing, and the method comprises the following steps:
receiving a data packet of a first video segment sent by the sending end; wherein the first video segment is one of the at least one video segment;
determining a first minimum data packet quantity required by decoding the first video segment according to the preset definition level of the video and the total quantity of data packets of the first video segment carried in the received data packets; decoding the data packets corresponding to the first minimum number of data packets to obtain a video picture adaptive to the preset definition level;
in the process of receiving the data packets of the first video segment, if the first accumulated total amount of the received data packets reaches the first minimum data packet amount, terminating receiving the data packets of the first video segment;
decoding the received data packets of the first minimum number of data packets.
2. The method of claim 1, wherein determining a first minimum number of packets required for decoding the first video segment according to the preset video definition level and a total number of packets of the first video segment carried in the received packets comprises:
acquiring the total amount of error code bytes corresponding to the preset definition level;
determining the number of data packets which can be discarded according to the total number of the error code bytes and the byte length of a preset data packet;
and performing difference operation on the total amount of the data packets of the first video segment and the number of the data packets which can be discarded to obtain a first minimum number of data packets required by decoding the first video segment.
3. The method of claim 2, wherein before said determining the number of packets that can be discarded based on the total number of error bytes and a predetermined packet byte length, the method further comprises:
acquiring byte lengths corresponding to a plurality of data packets respectively;
if the byte lengths corresponding to the data packets are different, generating corresponding preset data packet lengths according to input operation of a user;
and if the byte lengths corresponding to the plurality of data packets are the same, taking the byte length as a preset data packet length.
4. The method of claim 1, wherein said decoding the received data packets of the first minimum number of data packets comprises:
if the data packets with the byte length different from the preset data packet byte length exist in the data packets with the first minimum data packet quantity, performing byte addition on the data packets with the byte length smaller than the preset data packet byte length, and performing byte segmentation on the data packets with the byte length larger than the preset data packet byte length so as to enable the byte length of the data packets with the first minimum data packet quantity to be the same as the preset data packet byte length;
and decoding the data packet with the first minimum data packet quantity.
5. The method according to claim 1, wherein the video includes a plurality of consecutive video segments, and data packets corresponding to the plurality of consecutive video segments are sequentially sent to the receiving end via the sending end for decoding processing; after terminating receiving the data packets of the first video segment, the method further comprises:
receiving a data packet of a second video segment sent by the sending end; wherein the second video segment is a video segment of the plurality of consecutive video segments that follows the first video segment;
determining a second minimum data packet quantity required by decoding the second video segment according to the preset definition level of the video and the total quantity of data packets of the second video segment carried in the received data packets;
in the process of receiving the data packets of the second video segment, if the second accumulated total amount of the received data packets reaches the second minimum data packet amount, terminating receiving the data packets of the second video segment;
decoding the second video segment based on the second minimum number of packets.
6. The method of claim 5, wherein the method further comprises:
and if all the data packets of the first video segment sent by the sending end are received and the first accumulated total amount of the received data packets does not reach the first minimum data packet amount, reducing the preset definition level, so that in the process of receiving the data packets of the second video segment, the second minimum data packet amount required by decoding the second video segment is determined according to the reduced preset definition level and the total amount of the data packets carried in the received data packets.
7. The method of claim 6, wherein after reducing the preset level of sharpness, the method further comprises:
decoding the received data packets with the second minimum number of data packets to obtain a decoded second video segment; wherein the sharpness level of the decoded second video segment is lower than the preset sharpness level.
8. The method of claim 1, wherein the data packets of the first video segment transmitted by the transmitting end are transmitted through at least two transmission links; after the receiving the data packet of the first video segment sent by the sending end, the method further includes:
respectively acquiring the number of data packets received through each transmission link;
and carrying out summation operation on the quantity received by the at least two transmission links to obtain the first accumulated total quantity.
9. The method of claim 8, wherein separately obtaining the number of data packets received over each transmission link comprises:
initializing the number of data packets received by each transmission link;
and if the transmission link receives one data packet every time, controlling the number of the data packets received by the corresponding transmission link to be accumulated by 1.
10. The method of claim 1, wherein said decoding the received data packets of the first minimum number of data packets comprises:
according to the sequence number of the acquired data packet with the first least data packet quantity, sequencing the data packet with the first least data packet quantity to obtain a sequencing result; wherein the sorting result is a non-continuous sequence number sequence;
and decoding the data packets with the first minimum number of data packets according to the sequencing result.
11. The method of claim 10, wherein said decoding the data packets of the first minimum number of data packets according to the ordering result comprises:
determining a data packet with a first sequence number in the sequence number sequence as an initial data packet; the sequence number of the data packet with the sequence number arranged at the head is the minimum;
decoding is carried out from the initial data packet until the decoding of the data packet with the sequence number arranged at the last bit in the sequence number sequence is completed; and the data packet with the sequence number arranged at the last bit has the largest sequence number.
12. The method according to claim 10, wherein after the sorting the data packets with the first minimum number of data packets according to the obtained sequence numbers of the data packets with the first minimum number of data packets and obtaining a sorting result, the method further comprises:
updating the sequence numbers of the data packets of the first minimum number of data packets so that the sequence number sequence is a continuous sequence number sequence.
13. A decoding device is characterized in that a video to be decoded comprises at least one video segment, each video segment comprises a plurality of data packets, and the data packets corresponding to the at least one video segment are sent to a receiving end through a sending end to be decoded, and the device comprises:
the receiving module is configured to receive a data packet of a first video segment sent by the sending end; wherein the first video segment is one of the at least one video segment;
the determining module is configured to determine a first minimum number of data packets required for decoding the first video segment according to a preset definition level of the video and a total number of data packets of the first video segment carried in the received data packets; decoding the data packets corresponding to the first minimum number of data packets to obtain a video picture adaptive to the preset definition level;
the receiving module is further configured to terminate receiving the data packets of the first video segment if a first cumulative total of the received data packets reaches the first minimum number of data packets in the process of receiving the data packets of the first video segment;
a decoding module configured to decode the received data packets of the first minimum number of data packets.
14. An electronic device, comprising:
a memory storing computer readable instructions;
a processor reading computer readable instructions stored by the memory to perform the method of any of claims 1-12.
15. A computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the method of any one of claims 1-12.
CN202110764441.9A 2021-07-06 2021-07-06 Decoding method and device, electronic equipment and computer readable storage medium Active CN113542871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110764441.9A CN113542871B (en) 2021-07-06 2021-07-06 Decoding method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110764441.9A CN113542871B (en) 2021-07-06 2021-07-06 Decoding method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113542871A true CN113542871A (en) 2021-10-22
CN113542871B CN113542871B (en) 2023-05-26

Family

ID=78126964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110764441.9A Active CN113542871B (en) 2021-07-06 2021-07-06 Decoding method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113542871B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1252675A (en) * 1997-10-24 2000-05-10 松下电器产业株式会社 Method for computer moderate distorsion in video compressing system
US20020194613A1 (en) * 2001-06-06 2002-12-19 Unger Robert Allan Reconstitution of program streams split across multiple program identifiers
CN102405626A (en) * 2009-06-12 2012-04-04 赛格纳斯广播公司 Systems and methods for intelligent discard in a communication network
CN104869461A (en) * 2015-05-22 2015-08-26 南京创维信息技术研究院有限公司 Video data processing system and method
CN112243160A (en) * 2020-09-14 2021-01-19 视联动力信息技术股份有限公司 Data transmission method, device, terminal equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1252675A (en) * 1997-10-24 2000-05-10 松下电器产业株式会社 Method for computer moderate distorsion in video compressing system
US20020194613A1 (en) * 2001-06-06 2002-12-19 Unger Robert Allan Reconstitution of program streams split across multiple program identifiers
CN102405626A (en) * 2009-06-12 2012-04-04 赛格纳斯广播公司 Systems and methods for intelligent discard in a communication network
CN104869461A (en) * 2015-05-22 2015-08-26 南京创维信息技术研究院有限公司 Video data processing system and method
CN112243160A (en) * 2020-09-14 2021-01-19 视联动力信息技术股份有限公司 Data transmission method, device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN113542871B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
CN109600849B (en) Parallel resource allocation method based on mobile edge computing system
CN110620681B (en) Network connection timeout time setting method, device, equipment and medium
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN111031376B (en) Bullet screen processing method and system based on WeChat applet
CN110765354A (en) Information pushing method and device, electronic equipment and storage medium
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN113824689B (en) Edge computing network, data transmission method, device, equipment and storage medium
CN113542871B (en) Decoding method and device, electronic equipment and computer readable storage medium
CN113630476B (en) Communication method and communication device applied to computer cluster
CN113242446B (en) Video frame caching method, video frame forwarding method, communication server and program product
US11178413B1 (en) Dynamically transitioning a digital video file between encoding states
CN112346661B (en) Data processing method and device and electronic equipment
CN113542836B (en) Remote control method and device, electronic equipment and computer readable storage medium
CN109712011B (en) Community discovery method and device
CN112149584A (en) Coding system, method, device, equipment and medium
CN111628913A (en) Online time length determining method and device, readable medium and electronic equipment
CN113542849B (en) Video data processing method and device, electronic equipment and storage medium
CN116204201B (en) Service processing method and device
CN115379243B (en) CDN scheduling method, device, equipment and storage medium
CN110677463B (en) Parallel data transmission method, device, medium and electronic equipment
CN116016484A (en) Data transmission method, device, equipment and storage medium
CN112712570A (en) Image processing method, image processing apparatus, electronic device, and medium
CN114119153A (en) Page display method and device
CN117880568A (en) Video playing method and system, server and terminal equipment
CN116962821A (en) Video content processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40052850

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant