CN109729353B - Video coding method, device, system and medium - Google Patents

Video coding method, device, system and medium Download PDF

Info

Publication number
CN109729353B
CN109729353B CN201910098851.7A CN201910098851A CN109729353B CN 109729353 B CN109729353 B CN 109729353B CN 201910098851 A CN201910098851 A CN 201910098851A CN 109729353 B CN109729353 B CN 109729353B
Authority
CN
China
Prior art keywords
mse
code rate
video code
video
value
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.)
Active
Application number
CN201910098851.7A
Other languages
Chinese (zh)
Other versions
CN109729353A (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.)
Shenzhen Xunlei Network Culture Co ltd
Original Assignee
Shenzhen Xunlei Network Culture 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 Shenzhen Xunlei Network Culture Co ltd filed Critical Shenzhen Xunlei Network Culture Co ltd
Priority to CN201910098851.7A priority Critical patent/CN109729353B/en
Publication of CN109729353A publication Critical patent/CN109729353A/en
Application granted granted Critical
Publication of CN109729353B publication Critical patent/CN109729353B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a video coding method, a device, a system and a medium, wherein the method comprises the following steps: receiving video data and encoding the video data according to the original video code rate; adjusting and operating the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate; and continuing to encode the video data according to the new video code rate. The method can relatively avoid the situation that the available video code rate of the subsequent video frame to be coded is insufficient after the video frame with large pixel change degree is coded, so that the definition and the fluency of the coded video can be relatively ensured, and the experience of a user in the video watching process can be relatively ensured. In addition, the invention also provides a video coding device, a video coding system and a video coding medium, and the beneficial effects are as described above.

Description

Video coding method, device, system and medium
Technical Field
The present invention relates to the field of live video, and in particular, to a method, an apparatus, a system, and a medium for video encoding.
Background
In recent years, the continuous development of network technology makes our lives more and more colorful. With the convenient carrier of the network, the multimedia technology has been developed day by day, and the streaming transmission of video data based on the network is widely applied to scenes such as video live broadcast, video call and the like, so the video coding technology gradually becomes the core and key technology of the multimedia, and the main function of video coding is to compress video pixel data into video code streams, thereby achieving the purpose of reducing the data volume during video transmission.
In the current video coding method, a video code rate, that is, the number of data bits coded in a unit time during transmission, is usually preset by a user, and then the video data is coded at a fixed video code rate by an encoder. However, when there is a situation that the movement of an object in a video is suddenly aggravated, and further the change of pixels between adjacent video frames is large, the video frames with large pixel changes are often transmitted in a concentrated manner due to the concentrated video code rate, so that the code rate is consumed in a large amount in advance, and the situation that the available video code rate of subsequent video frames is insufficient is caused, and further the video frames are excessively compressed, so that the phenomenon that the video images are displayed in a screen in a short time is caused, the definition and the fluency of the coded video are difficult to ensure, and the experience of a user in the video watching process is relatively reduced.
Therefore, it is an urgent need to solve the problem of the art to provide a video encoding method to relatively ensure the definition and the fluency of the encoded video and further relatively improve the user experience in the video viewing process.
Disclosure of Invention
The invention aims to provide a video coding method, a video coding device, a video coding system and a video coding medium, so that the definition and the fluency of a video after being coded are relatively ensured, and the experience of a user in the video watching process is relatively improved.
To solve the above technical problem, the present invention provides a video encoding method, comprising:
receiving video data and encoding the video data according to the original video code rate;
adjusting and operating the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate;
and continuing to encode the video data according to the new video code rate.
Preferably, the adjusting operation of the original video bitrate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame, and the generating of the new video bitrate includes:
calculating the MSE current value according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame;
and acquiring a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the size relation between the current MSE value and the MSE standard value to generate a new video code rate.
Preferably, the MSE standard values comprise MSE high-line standard values, MSE middle-line standard values and MSE low-line standard values;
correspondingly, acquiring a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the size relationship between the current MSE value and the MSE standard value to generate a new video code rate, wherein the method comprises the following steps:
acquiring an MSE high line standard value, an MSE middle line standard value and an MSE low line standard value;
collecting MSE current values which are continuously generated in a preset number, and acquiring a preset default video code rate;
when the current MSE is higher than the MSE high lineWhen the standard value is obtained, calculating the new video code rate R according to the following formulaMovable part:RMovable part=Rdefault*(1+RSupplement device),RSupplement device=(MSE–MSECenter line)*(λ/MSEavg) (ii) a Wherein R isdefaultThe MSE is the current MSE value as the default video code rateCenter lineIs a MSE median norm, MSEavgTaking the mean value of the MSE of the current value of each MSE, wherein lambda is a preset adjusting constant;
when the current MSE value is higher than the MSE central line standard value and lower than the MSE high line standard value, setting a new video code rate as a fixed value;
when the current MSE value is higher than the MSE low-line standard value and lower than the MSE medium-line standard value, judging whether the original video code rate is higher than a default video code rate, if so, carrying out attenuation calculation on the original video code rate according to a first preset attenuation rate until the original video code rate is attenuated to the default video code rate so as to generate a new video code rate;
and when the current value of the MSE is lower than the standard value of the MSE low line, carrying out attenuation calculation on the original video code rate according to a second preset attenuation rate to generate a new video code rate.
Preferably, when the current MSE value is higher than the MSE low-line standard value and lower than the MSE medium-line standard value, if the original video code rate is lower than the default video code rate, setting the new video code rate as the default video code rate;
performing attenuation calculation on the original video code rate according to a first preset attenuation rate, and generating a new video code rate comprises the following steps:
and continuously carrying out attenuation calculation on the original video code rate from video frame to video frame according to the first preset attenuation rate to generate a new video code rate which is greater than or equal to the default video code rate.
Preferably, the fixed value is an average value of new video code rates calculated in a previous calculation interval, or a new video code rate value of a designated point; the first predetermined decay rate is greater than the second predetermined decay rate.
Preferably, the adjusting operation of the original video bitrate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame, and the generating of the new video bitrate includes:
adjusting and operating the original video code rate according to the parameter variation of each corresponding pixel in the target area between the current coding frame and the previous coding frame to generate a new video code rate; wherein the area of the target region is smaller than the image area of the video frame.
In addition, the invention also provides a video coding device, which comprises a memory, a processor and a bus, wherein the memory stores a video coding program which can be transmitted to the processor by the bus and run on the processor, and the video coding program realizes the method when being executed by the processor.
Preferably, the device is a node constituting a CDN network or a blockchain network.
In addition, the present invention also provides a video encoding system, comprising:
the encoding unit is used for receiving the video data and encoding the video data according to the original video code rate; receiving a new video code rate transmitted by the code rate adjusting unit, and continuously encoding the video data according to the new video code rate;
and the code rate adjusting unit is used for adjusting and calculating the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate and sending the new video code rate to the coding unit.
Furthermore, the present invention also provides a computer-readable storage medium having a video encoding program stored thereon, the video encoding program being executable by one or more processors to implement the video encoding method as described above.
The video coding method provided by the invention comprises the steps of firstly receiving video data and coding the video data according to an original video code rate, further carrying out adjustment operation on the original video code rate according to the parameter variation of each corresponding pixel between a current coding frame and a previous coding frame in the coding process to generate a new video code, and further continuing coding the video data according to the new video code. The method adjusts the video code rate according to the video coding process in a dynamic mode according to the pixel change degree between the video frames, so that the video code rate in the subsequent video coding process can be correspondingly improved when the pixel change degree between the video frames is larger, and compared with the mode of coding the video data with the fixed video code rate in the prior art, the method can relatively avoid the situation that the available video code rate of the subsequent video frame to be coded is insufficient after the video frame with the larger pixel change degree is coded, so that the definition and the fluency of the coded video can be relatively ensured, and the experience of a user in the video watching process can be relatively ensured. In addition, the invention also provides a video coding device, a video coding system and a video coding medium, and the beneficial effects are as described above.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a video encoding method according to an embodiment of the present invention;
fig. 2 is a flowchart of another video encoding method according to an embodiment of the present invention;
fig. 3(a) is an MSE fluctuation curve of a scenario embodiment provided by the present invention;
FIG. 3(b) is a graph illustrating video bitrate adjustment of an original video bitrate in a scene embodiment provided by the present invention;
fig. 4 is a video encoding apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
The core of the invention is to provide a video coding method to relatively ensure the definition and the fluency of the coded video, thereby relatively improving the experience of a user in the video watching process. Another core of the present invention is to provide a video encoding apparatus, system and medium.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Example one
Fig. 1 is a flowchart of a video encoding method according to an embodiment of the present invention. Referring to fig. 1, the specific steps of the video encoding method include:
step S10: receiving video data and encoding the video data according to the original video code rate.
It should be noted that the video data received in this step is video data that has not been video-encoded, and after the video data is received, video encoding is performed on the video data in units of video frames according to the original video encoding rate. The video encoding refers to a method of compressing a file in a certain video format and converting the file into a file in another video format by a specific compression technique, and details of the video encoding are well known to those skilled in the art and therefore are not described herein.
In addition, it should be noted that the video code rate is the number of data bits transmitted in unit time during data transmission in the video encoding process, and the common unit is kbps, i.e. kilobits per second, which can be understood as the sampling rate of the video frame to be encoded in the encoding process, and the larger the sampling rate in unit time is, the closer the definition of the encoded video is to the original video data. The original video code rate in this step is equivalent to the upper limit of the data sampling rate when the video data is encoded at the beginning of the method.
Step S11: and adjusting and calculating the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate.
In the process of encoding video data, when the overall variation degree of pixels between adjacent video frames of the video data is large, it is necessary to take more video encoding rates to resample a larger number of pixels, and since the available amount of the encoding rate in a unit time is fixed, there may be a case where the encoding rate is insufficient when encoding subsequent video frames, and further, the average sampling rate of pixels of subsequent video frames is small, resulting in a case where the encoded video is unclear. In summary, the key point of this step is to perform adjustment operation on the original video bitrate according to the parameter variation of each corresponding pixel between the current encoded frame and the previous encoded frame in the process of encoding the video data. That is to say, when the overall change degree of pixels between adjacent video frames is large, the original video code rate is increased, so that the subsequent video frames are ensured to have relatively sufficient video code rate in the encoding process, and the situation that the video code rate available for encoding of each subsequent video frame is small and the encoded video is unclear due to the fact that the video code rate is occupied by a large amount of the video frames encoded before is relatively avoided.
It should be noted that the last encoded frame in this step represents a video frame that is first subjected to video encoding in an adjacent video frame, and the current encoded frame represents a video frame that is subsequently subjected to video encoding in an adjacent video frame, so that the current encoded frame and the last encoded frame are relatively general concepts and do not refer to a certain video frame in the video encoding process. In addition, the parameter variation of each corresponding pixel in this step refers to the parameter variation of the pixel on the pixel point at the same position of each adjacent video frame, and the parameter variation rate of the pixel refers to the parameter content of the pixel in the encoding process.
Step S12: and continuing to encode the video data according to the new video code rate.
It can be understood that, in this step, after the adjustment operation is performed on the original video code rate to generate the new video code rate, the video code rate according to the video encoding process is modified, and the video data is continuously encoded at the new video code rate.
The video coding method provided by the invention comprises the steps of firstly receiving video data and coding the video data according to an original video code rate, further carrying out adjustment operation on the original video code rate according to the parameter variation of each corresponding pixel between a current coding frame and a previous coding frame in the coding process to generate a new video code, and further continuing coding the video data according to the new video code. The method adjusts the video code rate according to the video coding process in a dynamic mode according to the pixel change degree between the video frames, so that the video code rate in the subsequent video coding process can be correspondingly improved when the pixel change degree between the video frames is larger, and compared with the mode of coding the video data with the fixed video code rate in the prior art, the method can relatively avoid the situation that the available video code rate of the subsequent video frame to be coded is insufficient after the video frame with the larger pixel change degree is coded, so that the definition and the fluency of the coded video can be relatively ensured, and the experience of a user in the video watching process can be relatively ensured.
Example two
On the basis of the above examples, the present invention also provides a series of preferred embodiments as follows.
Fig. 2 is a flowchart of another video encoding method according to an embodiment of the present invention. Step S10 and step S12 in fig. 2 are the same as those in fig. 1, and are not repeated here.
As shown in fig. 2, as a preferred embodiment, step S11 includes:
step S20: and calculating the MSE current value according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame.
Note that, in the present embodiment, the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame is calculated by means of MSE (mean-square error), that is, a mean-square error. The mean square error is a metric that reflects the degree of difference between the estimator and the estimated quantity. The MSE current value calculated in this step reflects the degree of difference between the parameter variation and the expected amount of the current video frame time pixel. In the present embodiment, the formula used for calculating the current value of MSE may be(s) or (e.g., MSE — s)1 2+s2 2+…+sn 2) N, where s ═ pixelCurrent frame–pixelLast frameThe parameter variation of the pixels of the current frame and the previous frame at the same pixel point position is obtained, n is the number of groups of the corresponding pixel points obtained during calculation, and the accuracy of representing the pixel variation degree of the adjacent video frames can be relatively improved through the MSE current value in the step.
Step S21: and acquiring a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the size relation between the current MSE value and the MSE standard value to generate a new video code rate.
The MSE standard value obtained in this step may be a critical MSE value at which the pixel change degree between video frames affects the entire coding resources, or an MSE value corresponding to the pixel change degree of a video frame that is adapted to the default coding rate of the video encoder.
On the basis of the above embodiments, as a preferred embodiment, the MSE standard value includes an MSE high-line standard value, an MSE medium-line standard value, and an MSE low-line standard value; the above three standard values divide the calculation of the new video code rate into four calculation intervals, which will be described in detail below;
correspondingly, acquiring a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the size relationship between the current MSE value and the MSE standard value to generate a new video code rate, wherein the method comprises the following steps:
acquiring an MSE high line standard value, an MSE middle line standard value and an MSE low line standard value;
collecting MSE current values which are continuously generated in a preset number, and acquiring a preset default video code rate;
when the current MSE value is higher than the high MSE line standard value (first calculation interval), calculating the new video code rate R according to the following formulaMovable part:RMovable part=Rdefault*(1+RSupplement device),RSupplement device=(MSE–MSECenter line)*(λ/MSEavg) (ii) a Wherein R isdefaultThe MSE is the current MSE value as the default video code rateCenter lineIs a MSE median norm, MSEavgTaking the mean value of the MSE of the current value of each MSE, wherein lambda is a preset adjusting constant;
when the current MSE value is higher than the MSE central line standard value and lower than the MSE high line standard value (a second calculation interval), setting the new video code rate as a fixed value; the fixed value may be an average value of new video code rates calculated in a previous calculation interval, or a new video code rate value of a specified point, such as a maximum value, a minimum value, or a value calculated from a starting point, or a value calculated from an ending point.
When the current MSE value is higher than the MSE low-line standard value and lower than the MSE medium-line standard value (a third calculation interval), judging whether the original video code rate is higher than a default video code rate, if so, performing attenuation calculation on the original video code rate according to a first preset attenuation rate until the original video code rate is attenuated to the default video code rate to generate a new video code rate, and if not, setting the new video code rate as the default video code rate;
and when the current MSE value is lower than the MSE low-line standard value (a fourth calculation interval), performing attenuation calculation on the default video code rate according to a second preset attenuation rate to generate a new video code rate.
It should be noted that, in this embodiment, the MSE standard value includes an MSE high line standard value, an MSE middle line standard value, and an MSE low line standard value, where the MSE middle line standard value may correspond to the default video code rate, that is, the MSE middle line standard value in this embodiment is an MSE value corresponding to a video frame pixel change degree adapted to the default coding rate of the video encoder, the MSE high line standard value is higher than the MSE middle line standard value, and the MSE low line standard value is lower than the MSE middle line standard value, further, the MSE high line standard value may represent a critical MSE value where a pixel change degree of an adjacent video frame occupies a relatively high total coding resource, and the MSE low line standard value may represent a critical MSE value where a pixel change degree of an.
According to the expression RSupplement device=(MSE–MSECenter line)*(λ/MSEavg) The purpose of calculating the growth value is to calculate the degree that the mean MSE value between a plurality of previous adjacent video frames is higher than the standard value of the MSE line, and the mean MSE value is used as the growth value of the original video code rate, wherein λ is an adjustment constant set in consideration of fluctuation of pixel content between adjacent video frames, and is determined according to actual video coding requirements, and is not specifically limited herein.
The first attenuation rate and the second attenuation rate are set by a technician according to the experience of video encoding, and are not specifically limited herein.
Because the encoding of the video frames is continuously performed, the embodiment collects the MSE current values which are continuously generated in a preset number, so that the change trend of the MSE current values in a section of encoding period relative to the MSE high-line standard value, the MSE middle-line standard value and the MSE low-line standard value is observed, the whole adjustment operation is performed on the original video code rate, the accuracy of the new video code rate can be improved, the phenomenon that the original video code rate is frequently adjusted due to the pixel fluctuation of pictures between adjacent video frames can be avoided, and the whole resource overhead caused by the adjustment of the video code rate is relatively saved.
On the basis of the foregoing embodiment, as a preferred embodiment, performing attenuation calculation on the original video bitrate according to a first preset attenuation rate, and generating a new video bitrate includes:
and continuously carrying out attenuation calculation on the original video code rate from video frame to video frame according to the first preset attenuation rate to generate a new video code rate which is greater than or equal to the default video code rate.
In the embodiment, the original video code rate is attenuated and calculated as the new video code rate at one time by a certain preset attenuation rate, and the situation that the unpredictable pixel content fluctuation of the subsequent video frame is possibly caused due to the instant steep drop of the video code rate, so that the instability of the subsequent video encoding process is further caused is considered. In addition, it should be emphasized that, since the line standard value in the MSE is the MSE value corresponding to the change degree of the pixels of the video frame that is adapted to the default encoding rate of the video encoder, the original video encoding rate is first reduced to the default encoding rate by default in the embodiment, so as to ensure the preliminary rationality of the attenuation of the original video encoding rate.
In addition to the above-described embodiment, as a preferable embodiment, the first preset attenuation rate is larger than the second preset attenuation rate.
Since the scene applying the first attenuation rate is often that the currently used video bitrate has an influence on the overall stability of the video coding, in order to ensure the overall stability of the video coding, the current video bitrate needs to be attenuated by a relatively large margin. And the scene applying the second attenuation rate is often that the current video coding resource is already in a relatively idle state, so that a sufficient video code rate is available, and the video code rate is adjusted with a relatively small amplitude in order to avoid pixel fluctuation of adjacent video frames.
On the basis of the above series of embodiments, as a preferred embodiment, performing an adjustment operation on an original video bitrate according to a parameter variation of each corresponding pixel between a current coded frame and a previous coded frame to generate a new video bitrate includes:
adjusting and operating the original video code rate according to the parameter variation of each corresponding pixel in the target area between the current coding frame and the previous coding frame to generate a new video code rate; wherein the area of the target region is smaller than the image area of the video frame.
It should be noted that the key point of the present embodiment is to limit the target area for extracting the pixel point to be smaller than the image area of the video frame when extracting the pixel of the adjacent video frame, so as to relatively reduce the number of pixels to be extracted, reduce the occupation of resources, and improve the video coding efficiency.
Based on the above series of embodiments, the present embodiment provides a parameter selection for video encoding in which the video type to be encoded is the RGB32 format, where λ is 0.6; the first preset attenuation rate is 0.75; the second preset attenuation rate is 0.15; taking grid points of 8x8 as the image area of the target region between the current coding frame and the last coding frame; the preset number of consecutive collections of the current value of MSE is 50 frames. An MSE fluctuation curve generated after the current MSE value is collected is shown in fig. 3(a), and an MSE high-line standard value, an MSE center-line standard value and an MSE low-line standard value are shown in fig. 3 (a). Fig. 3(b) shows a graph of video bitrate adjustment of the original video bitrate according to the MSE current value.
As shown in fig. 3 (a):
I-H section, keeping code rate unchanged, and continuing to use the code rate peak value or mean value calculated in the previous section or the code rate value calculated at the time of I point;
H-E section, which has the same processing mode as C-D section;
E-F section, keeping code rate unchanged, and continuing to use the code rate peak value or mean value calculated in the previous section or the code rate value calculated in the E point;
in the F-B section, the code rate adjustment formula is as follows: rMovable part=Rdefault*(1+RSupplement device),
RSupplement device=(MSE–MSECenter line)*(0.6/MSEavg);
The section B-C keeps the code rate unchanged, and continues to use the code rate peak value or the average value calculated by the previous section or the code rate value calculated when the point B is used;
C-D section, code rate adjustment formula: if the code rate is higher than the default code rate, performing 75% attenuation frame by frame until the attenuation reaches the default code rate, and if the code rate is lower than the default code rate, directly changing to the default code rate;
namely, the code rate is adjusted to the default code rate at this stage;
D-G section, code rate adjustment formula: rMovable part=Rdefault*(1+RSupplement device),RSupplement device=-0.15。
EXAMPLE III
In the above, the embodiments of the video encoding method are described in detail, and the present invention further provides a video encoding apparatus corresponding to the method.
Referring to fig. 4, fig. 4 is a video encoding apparatus 1 according to an embodiment of the present invention, the apparatus includes a memory 11, a processor 12 and a bus 13, the memory 11 stores a video encoding program that can be transmitted from the bus 13 to the processor 12 and run on the processor 12, and the video encoding program implements the video encoding method when executed by the processor 12.
The video encoding apparatus 1 may be a node constituting a CDN network or a blockchain network. May be nodes that make up a CDN network or a blockchain network.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the apparatus 1, for example a hard disk of the apparatus 1. The memory 11 may in other embodiments also be an external storage device of the apparatus 1, such as a plug-in hard disk provided on the apparatus 1, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. Further, the memory 11 may also comprise both internal memory units of the apparatus 1 and external memory devices. The memory 11 can be used not only for storing application software installed in the apparatus 1 and various types of data such as codes of video encoding programs, etc., but also for temporarily storing data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing video coding programs.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The video coding device provided by the invention firstly receives video data and codes the video data according to the original video code rate, then adjusts and operates the original video code rate according to the parameter variable quantity of each corresponding pixel between the current coding frame and the previous coding frame in the coding process and generates a new video code, and then continues to code the video data according to the new video code. The device adjusts the video code rate according to the video coding process in a dynamic mode according to the change degree of the pixels among the video frames, so that when the change degree of the pixels among the video frames is large, the video code rate in the subsequent video coding process can be correspondingly improved, and compared with the mode of coding video data with a fixed video code rate in the prior art, the device can relatively avoid the situation that the available video code rate of the subsequent video frame to be coded is insufficient after the video frame with the large change degree of the pixels is coded, so that the definition and the fluency of the coded video can be relatively ensured, and the experience of a user in the video watching process can be relatively ensured.
In addition, the present invention also provides a video encoding system, comprising:
the encoding unit is used for receiving the video data and encoding the video data according to the original video code rate; and receiving the new video code rate transmitted by the code rate adjusting unit, and continuously encoding the video data according to the new video code rate.
And the code rate adjusting unit is used for adjusting and calculating the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate and sending the new video code rate to the coding unit.
The video coding system provided by the invention firstly receives video data and codes the video data according to the original video code rate, then adjusts and operates the original video code rate according to the parameter variable quantity of each corresponding pixel between the current coding frame and the previous coding frame in the coding process and generates a new video code, and then continues to code the video data according to the new video code. The system adjusts the video code rate according to the video coding process in a dynamic mode according to the change degree of the pixels among the video frames, so that the video code rate in the subsequent video coding process can be correspondingly improved when the change degree of the pixels among the video frames is large, and compared with the mode of coding the video data with the fixed video code rate in the prior art, the system can relatively avoid the situation that the available video code rate of the subsequent video frames to be coded is insufficient after the video frames with the large change degree of the pixels are coded, so that the definition and the fluency of the coded video can be relatively ensured, and the experience of a user in the video watching process can be relatively ensured.
Furthermore, the present invention also provides a computer-readable storage medium having a video encoding program stored thereon, the video encoding program being executable by one or more processors to implement the video encoding method as described above.
The computer-readable storage medium provided by the invention firstly receives video data and codes the video data according to the original video code rate, and then adjusts and operates the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame in the coding process to generate a new video code, and then continues to code the video data according to the new video code. The computer-readable storage medium adjusts the video code rate according to the video coding process in a dynamic mode according to the change degree of the pixels among the video frames, so that the video code rate in the subsequent video coding process can be correspondingly improved when the change degree of the pixels among the video frames is large, and compared with the mode of coding video data with a fixed video code rate in the prior art, the computer-readable storage medium can relatively avoid the situation that the available video code rate of the subsequent video frames to be coded is insufficient after the video frames with large pixel change degree are coded, so that the definition and the fluency of the coded video can be relatively ensured, and the user experience in the video watching process can be relatively ensured.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A method of video encoding, the method comprising:
receiving video data and encoding the video data according to an original video code rate;
adjusting the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate;
continuing to encode the video data in accordance with the new video bitrate;
wherein, the adjusting operation of the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate the new video code rate comprises:
calculating the current MSE value according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame;
acquiring a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the size relation between the current MSE value and the MSE standard value to generate the new video code rate;
wherein the MSE standard value comprises an MSE high-line standard value, an MSE middle-line standard value and an MSE low-line standard value;
correspondingly, the obtaining a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the magnitude relation between the current MSE value and the MSE standard value, and generating the new video code rate includes:
acquiring the MSE high line standard value, the MSE middle line standard value and the MSE low line standard value;
collecting a preset number of MSE current values which are continuously generated, and acquiring a preset default video code rate;
when the current MSE value is higher than the high MSE line standard value, calculating a new video code rate R according to the following formulaMovable part:RMovable part=Rdefault*(1+RSupplement device),RSupplement device=(MSE–MSECenter line)*(λ/MSEavg) (ii) a Wherein R isdefaultThe MSE is the current MSE value as the default video code rateCenter lineIs said MSE median criterion value, MSEavgLambda is a preset adjusting constant value of the mean value of the MSE of the current value of the MSE;
when the current MSE value is higher than the MSE central line standard value and lower than the MSE high line standard value, setting a new video code rate as a fixed value; the fixed value is the average value of the new video code rates calculated in the previous calculation interval or the new video code rate value of one designated point;
when the current MSE value is higher than the MSE low-line standard value and lower than the MSE medium-line standard value, judging whether the original video code rate is higher than the default video code rate, if so, performing attenuation calculation on the original video code rate according to a first preset attenuation rate until the original video code rate is attenuated to the default video code rate so as to generate the new video code rate;
and when the current MSE value is lower than the MSE low-line standard value, carrying out attenuation calculation on the default video code rate according to a second preset attenuation rate to generate the new video code rate.
2. The method of claim 1, wherein when the current MSE value is higher than the low MSE line criterion value and lower than the line criterion value, if the original video bitrate is lower than the default video bitrate, the new video bitrate is set to the default video bitrate;
performing attenuation calculation on the original video code rate according to a first preset attenuation rate, and generating the new video code rate includes:
and continuously carrying out attenuation calculation on the original video code rate on a video frame by video frame basis according to the first preset attenuation rate to generate the new video code rate which is greater than or equal to the default video code rate.
3. The method of claim 1, wherein the fixed value is an average value of new video bitrate calculated in a previous calculation interval, or a new video bitrate value of a specified point in the previous calculation interval; the first preset attenuation rate is greater than the second preset attenuation rate.
4. The method according to any one of claims 1 to 3, wherein the performing an adjustment operation on the original video bitrate according to a parameter variation of each corresponding pixel between a current coding frame and a previous coding frame to generate a new video bitrate comprises:
performing the adjustment operation on the original video code rate according to the parameter variation of each corresponding pixel in the target area between the current coding frame and the previous coding frame to generate the new video code rate; wherein the area of the target region is smaller than the image area of the video frame.
5. A video coding device, characterized in that it comprises a memory, a processor and a bus, said memory storing thereon a video coding program that can be transferred to and run on said processor by said bus, said video coding program realizing the method according to any one of claims 1 to 4 when executed by said processor.
6. The apparatus of claim 5, wherein the apparatus is a node constituting a CDN network or a blockchain network.
7. A video encoding system, the system comprising:
the encoding unit is used for receiving video data and encoding the video data according to an original video code rate; receiving a new video code rate transmitted by a code rate adjusting unit, and continuously encoding the video data according to the new video code rate;
the code rate adjusting unit is used for adjusting and operating the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate a new video code rate and sending the new video code rate to the coding unit;
wherein, the adjusting operation of the original video code rate according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame to generate the new video code rate comprises:
calculating the current MSE value according to the parameter variation of each corresponding pixel between the current coding frame and the previous coding frame;
acquiring a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the size relation between the current MSE value and the MSE standard value to generate the new video code rate;
wherein the MSE standard value comprises an MSE high-line standard value, an MSE middle-line standard value and an MSE low-line standard value;
correspondingly, the obtaining a preset MSE standard value, and performing corresponding adjustment operation on the original video code rate according to the magnitude relation between the current MSE value and the MSE standard value, and generating the new video code rate includes:
acquiring the MSE high line standard value, the MSE middle line standard value and the MSE low line standard value;
collecting a preset number of MSE current values which are continuously generated, and acquiring a preset default video code rate;
when the current MSE value is higher than the high MSE line standard value, calculating a new video code rate R according to the following formulaMovable part:RMovable part=Rdefault*(1+RSupplement device),RSupplement device=(MSE–MSECenter line)*(λ/MSEavg) (ii) a Wherein R isdefaultThe MSE is the current MSE value as the default video code rateCenter lineIs said MSE median criterion value, MSEavgFor the mean value of the MSE of each current value of the MSE, lambda is presetAn adjustment constant of (d);
when the current MSE value is higher than the MSE central line standard value and lower than the MSE high line standard value, setting a new video code rate as a fixed value; the fixed value is the average value of the new video code rates calculated in the previous calculation interval or the new video code rate value of one designated point;
when the current MSE value is higher than the MSE low-line standard value and lower than the MSE medium-line standard value, judging whether the original video code rate is higher than the default video code rate, if so, performing attenuation calculation on the original video code rate according to a first preset attenuation rate until the original video code rate is attenuated to the default video code rate so as to generate the new video code rate;
and when the current MSE value is lower than the MSE low-line standard value, carrying out attenuation calculation on the default video code rate according to a second preset attenuation rate to generate the new video code rate.
8. A computer-readable storage medium having stored thereon a video encoding program executable by one or more processors to implement the video encoding method of any one of claims 1 to 4.
CN201910098851.7A 2019-01-31 2019-01-31 Video coding method, device, system and medium Active CN109729353B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910098851.7A CN109729353B (en) 2019-01-31 2019-01-31 Video coding method, device, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910098851.7A CN109729353B (en) 2019-01-31 2019-01-31 Video coding method, device, system and medium

Publications (2)

Publication Number Publication Date
CN109729353A CN109729353A (en) 2019-05-07
CN109729353B true CN109729353B (en) 2021-01-19

Family

ID=66301117

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910098851.7A Active CN109729353B (en) 2019-01-31 2019-01-31 Video coding method, device, system and medium

Country Status (1)

Country Link
CN (1) CN109729353B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112767953B (en) * 2020-06-24 2024-01-23 腾讯科技(深圳)有限公司 Speech coding method, device, computer equipment and storage medium
CN112052293B (en) * 2020-09-17 2024-04-19 中国银行股份有限公司 Decentralizing information recording method and device
CN112637631B (en) * 2020-12-17 2022-04-26 清华大学 Code rate determining method and device, electronic equipment and storage medium
CN113473131B (en) * 2021-07-01 2023-12-29 成都国科微电子有限公司 Video coding rate dynamic adjustment method and device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5878166A (en) * 1995-12-26 1999-03-02 C-Cube Microsystems Field frame macroblock encoding decision
EP2286595A1 (en) * 2008-06-16 2011-02-23 Dolby Laboratories Licensing Corporation Rate control model adaptation based on slice dependencies for video coding
CN102625106B (en) * 2012-03-28 2014-08-27 上海交通大学 Scene self-adaptive screen encoding rate control method and system
CN103079065B (en) * 2012-12-27 2016-08-03 华为技术有限公司 A kind of video data handling procedure and device
CN108012149B (en) * 2017-12-19 2021-05-18 四川九洲电器集团有限责任公司 Code rate control method in video coding

Also Published As

Publication number Publication date
CN109729353A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
CN109729353B (en) Video coding method, device, system and medium
US10735740B2 (en) Bit rate control method and device
CN102780918B (en) A kind of video distribution formula transform coding format approach
US11172220B2 (en) Video encoding method, and storage medium thereof
CN105163134A (en) Video coding parameter setting method, device and video coding device for live video
CN111182303A (en) Encoding method and device for shared screen, computer readable medium and electronic equipment
WO2017041551A1 (en) Spice protocol-based image transmission method and apparatus
CN110708570B (en) Video coding rate determining method, device, equipment and storage medium
CN113301342B (en) Video coding method, network live broadcasting method, device and terminal equipment
CN108347580A (en) A kind of method and electronic equipment of processing video requency frame data
CN114245196B (en) Screen recording and stream pushing method and device, electronic equipment and storage medium
CN111263243A (en) Video coding method and device, computer readable medium and electronic equipment
CN109218722B (en) Video coding method, device and equipment
CN111464811A (en) Image processing method, device and system
US20080267284A1 (en) Moving picture compression apparatus and method of controlling operation of same
CN110740316A (en) Data coding method and device
CN115529300A (en) System and method for automatically adjusting key frame quantization parameter and frame rate
CN112437301B (en) Code rate control method and device for visual analysis, storage medium and terminal
CN115278289B (en) Cloud application rendering video frame processing method and device
CN110891195B (en) Method, device and equipment for generating screen image and storage medium
CN103796036A (en) Coding parameter adjusting method and device
CN115767149A (en) Video data transmission method and device
CN111510715B (en) Video processing method, system, computer device and storage medium
CN111754387B (en) Image processing method and device
CN112702632B (en) Live program injection method, device, system, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant