WO2018059175A1 - 视频码率处理方法和装置、存储介质及电子设备 - Google Patents

视频码率处理方法和装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2018059175A1
WO2018059175A1 PCT/CN2017/099595 CN2017099595W WO2018059175A1 WO 2018059175 A1 WO2018059175 A1 WO 2018059175A1 CN 2017099595 W CN2017099595 W CN 2017099595W WO 2018059175 A1 WO2018059175 A1 WO 2018059175A1
Authority
WO
WIPO (PCT)
Prior art keywords
video frames
current set
frame
target
current
Prior art date
Application number
PCT/CN2017/099595
Other languages
English (en)
French (fr)
Inventor
毛煦楠
谷沉沉
时永方
高安林
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to US16/308,600 priority Critical patent/US10666939B2/en
Priority to EP17854627.1A priority patent/EP3522534B1/en
Publication of WO2018059175A1 publication Critical patent/WO2018059175A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/115Selection of the code volume for a coding unit prior to coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/177Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a group of pictures [GOP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/141Systems for two-way working between two video terminals, e.g. videophone
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/141Systems for two-way working between two video terminals, e.g. videophone
    • H04N7/147Communication arrangements, e.g. identifying the communication as a video-communication, intermediate storage of the signals

Definitions

  • the present application relates to the field of video, and in particular to a video bit rate processing method and apparatus, a storage medium, and an electronic device.
  • a video bit rate processing method including: acquiring a quantity of video frames included in a current group of video frames, where the current group of video frames starts with an I frame. a frame; obtaining, according to at least the number of video frames included in the current set of video frames, a target code rate of the I frame in the current set of video frames; and pairing the current set of videos according to the target code rate
  • the I frame in the frame is encoded.
  • a storage medium comprising a stored program, wherein the program runs the video bit rate processing method of the present application.
  • an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor The computer program performs the video bit rate processing method of the present application.
  • FIG. 2 is a flowchart of an optional video bit rate processing method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an optional video bit rate processing apparatus according to an embodiment of the present application.
  • FIG. 4 is a structural block diagram of a terminal according to an embodiment of the present application.
  • an embodiment of a video bit rate processing method is provided.
  • the video bit rate processing method may be applied to a hardware environment formed by the server 102 and the terminal 104 as shown in FIG. 1.
  • the server 102 is connected to the terminal 104 through a network.
  • the network includes but is not limited to a wide area network, a metropolitan area network, or a local area network.
  • the terminal 104 is not limited to a PC, a mobile phone, a tablet, or the like.
  • the video bit rate processing method of the embodiment of the present application may be executed by the server 102, may be performed by the terminal 104, or may be jointly performed by the server 102 and the terminal 104.
  • the video code rate processing method performed by the terminal 104 in the embodiment of the present application may also be performed by a client installed thereon.
  • the I frame of the set of video frames is encoded according to the target code rate, and the encoded video frame information is transmitted to the second client after encoding.
  • the second client can display the set of video frames by decoding, thereby implementing a video call between the two clients.
  • Step S202 Acquire a quantity of video frames included in a current group of video frames, where the current group of video frames uses an I frame as a starting frame.
  • Step S204 Acquire a target code rate of an I frame in the current group of video frames according to the number of video frames included in the current group of video frames.
  • Step S206 encoding an I frame in the current group of video frames according to the target code rate.
  • the number of video frames included in the frequency frame is obtained according to the number of video frames included in the current group of video frames, and the target code rate of the I frame in the current group of video frames is obtained, and then the current set of video frames is used according to the target code rate.
  • the encoding of the I frame is performed. Since the target bit rate of the I frame in the current group of video frames is obtained according to the number of video frames included in the current group of video frames, the bit rate allocation of the video in the related art may be solved.
  • the technical problem caused by poor video performance achieves the purpose of determining the target bit rate of the I frame of the video frame according to the number of video frames per group, thereby improving the compression and playback quality of the video.
  • the number of video frames included in the current group of video frames (Group Of Picture, referred to as GOP) is acquired, and the video has multiple video frame groups, and each group of video frames has For a plurality of frames, each group of video frames starts with an I frame.
  • a group of video frames may include 10 frames or 15 frames.
  • the number of video frames included in multiple groups of video frames may be the same or different.
  • the number of video frames included in each group of video frames is set in advance. Therefore, the number of video frames included in the current group of video frames can be obtained, and the number of video frames included in the plurality of groups of video frames is different.
  • the video bit rate processing method of this embodiment can determine the target bit rate of the I frame of the video frame according to the number of each video frame, the I frame of each video frame can be better than the related art. Encoding to improve the compression and playback quality of the video.
  • step S204 after acquiring the number of video frames included in the current group of video frames, acquiring the target of the I frame in the current group of video frames according to the number of video frames included in the current group of video frames.
  • the code rate may be calculated according to the number of video frames included in the current set of video frames and a preset formula to obtain a target code rate, or may be obtained by looking up a table to obtain a preset I frame corresponding to the number of video frames.
  • the target bit rate where the target bit rate of the I frame is used to encode the I frame.
  • acquiring the target code rate of the I frame in the current group of video frames according to the number of video frames included in the current group of video frames may be: according to the video frames included in the current group of video frames.
  • the number of calculations obtains the target value of the quantization parameter difference of the current group of video frames, and the quantization parameter difference of the current group of video frames is between the quantization parameter of the I frame and the quantization parameter of the non-I frame in the current group of video frames.
  • the correction parameter is used to correct the target bit rate of the I frame in the current group of video frames.
  • the quantization parameter difference of the previous group of video frames is the average value of the actual quantization parameters of the non-I frames in the previous group of video frames. The difference between the average values of the actual quantization parameters of the I frames in the previous set of video frames; the target code rate of the I frames in the current set of video frames is obtained according to the value of the modified parameters.
  • the quantization parameter of the non-I frame may be a quantization parameter of the quantization parameter of the non-I frame, and the quantization parameter difference of the current group of video frames is the quantization parameter of the I frame and the non-I frame.
  • the difference between the quantization parameters, the average value of the I frame or non-I frame quantization parameter of the previous GOP referred to herein is the average value of the actual value, since the actual code rate of the I frame or non-I frame of the previous GOP has been Ok, so you can get an average of the actual values.
  • the target value of the quantization parameter difference is calculated by the first function
  • the first function is an increasing function of the number of video frames in the GOP
  • the target of the quantization parameter difference is The value is calculated by a second function, which is a subtraction function of the number of video frames in the GOP.
  • the target value of the quantization parameter difference may be continuous or discontinuous after the number of video frames in the GOP is before the first preset threshold and after the first preset threshold. Calculating the target value of the quantization parameter difference according to the number of video frames in the GOP can improve the flexibility of the target value of the quantization parameter difference of the GOP, can adapt to the GOP of different numbers of video frames, and make the result of the video bit rate processing. More accurate Indeed, the quality of the video call can be improved.
  • the value includes: calculating a difference ⁇ QP between the value of the actual quantization parameter ⁇ QP preGOP of the previous group of video frames of the current group of video frames and the value of the target value ⁇ QP Target of the quantization parameter difference of the current group of video frames preGOP - ⁇ QP Target ; Calculate the value of the correction parameter h( ⁇ QP preGOP - ⁇ QP Target ) of the current set of video frames according to the difference:
  • ⁇ QP max1 denotes a first predetermined value
  • ⁇ QP max2 denotes a second predetermined value
  • represents a third predetermined value
  • the modified parameter h( ⁇ QP preGOP - ⁇ QP Target ) is used to correct the target code rate of the I frame in the GOP.
  • the calculation of the modified parameter is also calculated by the piecewise function. According to the actual quantization parameter ⁇ QP of the previous GOP of the current GOP preGOP values and the difference between the target ⁇ QP target quantization parameter difference value of the current GOP ⁇ QP preGOP - ⁇ QP target segment as a reference section, using a different formula to calculate at different intervals, corrected The value of the parameter is then corrected by the value of the modified parameter. Since the correction parameter is segmented, the value of the correction parameter can be obtained more accurately, and then the target code rate in the current GOP is corrected by the value of the correction parameter to obtain a more accurate target code rate.
  • the present application also provides a preferred embodiment, and the calculation scheme of the present application is described below with a complete preferred embodiment:
  • the I frame interval is larger (since only the first frame is an I frame per GOP, the number of video frames in the GOP The larger the I frame interval is, the greater the improvement of the overall compression performance is. Therefore, when the number of video frames in the GOP is smaller than Thre GOP1 and greater than Thre GOP2 , the I frame interval is larger, and the I frame rate is higher. The higher the allocation.
  • the non-I frames that the I frame can affect are limited, so the larger the number of video frames in the GOP, the lower the I frame rate.
  • Thre GOP2 Thre GOP2 .
  • the target value ⁇ QP Target of the quantization parameter difference is calculated by the piecewise function:
  • GOP represents the number of video frames in the GOP
  • f(GOP) is an increasing function of the GOP
  • g(GOP) is a decreasing function of the GOP.
  • the first preset threshold may be 64
  • the second preset threshold may be 32.
  • the function of the h( ⁇ QP preGOP - ⁇ QP Target ) function is to correct the I frame target code rate and the h( ⁇ QP preGOP - ⁇ QP Target ) function according to the previous GOP actual quantization parameter ⁇ QP preGOP and the target value ⁇ QP Target of the quantization parameter difference.
  • ⁇ QP max1, ⁇ QP max2 target code rate in order to prevent excessive adjustments of the parameter set, and the values of ⁇ QP max1 ⁇ QP max2 parameters may be between 3 to 6, ⁇ is the number of values can be less than 0.08, e.g. Can be 0.05.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the related art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM).
  • the instructions include a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present application.
  • FIG. 3 is a schematic diagram of an optional video bit rate processing apparatus according to an embodiment of the present application. As shown in FIG. 3, the apparatus may include:
  • the first obtaining unit 10 is configured to acquire the number of video frames included in the current group of video frames, where the current group of video frames starts with an I frame;
  • the second obtaining unit 20 is configured to obtain, according to the number of video frames included in the current group of video frames, a target bit rate of the I frame in the current group of video frames, where
  • the encoding unit 30 is configured to encode the I frame in the current set of video frames according to the target code rate.
  • first obtaining unit 10 in this embodiment may be used to perform step S202 in Embodiment 1 of the present application, where the second obtaining unit 20 in this embodiment may be used to execute the present application.
  • the step S204 in the embodiment 1 is applied, and the encoding unit 30 in the embodiment may be used to perform step S206 in the embodiment 1 of the present application.
  • modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the foregoing module may be implemented in a hardware environment as shown in FIG. 1 as part of the device, and may be implemented by software or by hardware.
  • the second obtaining unit 20 includes: a first calculating module, configured to calculate, according to the number of video frames included in the current group of video frames, a target value of the quantization parameter difference of the current group of video frames, where The quantization parameter difference of the current group of video frames is the difference between the quantization parameter of the I frame in the current group of video frames and the quantization parameter of the non-I frame; the second calculation module is set to be based on the current group of video frames. Calculating the value of the correction parameter of the current set of video frames by using the target value of the quantization parameter difference and the quantization parameter difference of the previous set of video frames of the current group of video frames, wherein the correction parameter is used in the current group of video frames The target bit rate of the I frame is corrected.
  • a first calculating module configured to calculate, according to the number of video frames included in the current group of video frames, a target value of the quantization parameter difference of the current group of video frames, where The quantization parameter difference of the current group of video frames is the difference between the quantization parameter
  • the quantization parameter difference of the previous group of video frames is the average of the actual quantization parameters of the non-I frames in the previous group of video frames and the actual of the I frames in the previous group of video frames.
  • a difference between the average values of the quantization parameters an acquisition module configured to obtain a target code rate of the I frame in the current set of video frames according to the value of the correction parameter.
  • the first calculating module includes: a determining submodule, configured to determine a quantity relationship between the number of video frames included in the current group of video frames and the first preset threshold and the second preset threshold, where The preset threshold is greater than the second preset threshold; the determining submodule is configured to determine that the target value of the quantized parameter difference is the first pre-determined when the number of the video frames included in the current set of video frames is less than or equal to the second preset threshold.
  • the quantization parameter value is set; when the number of the video frames included in the current group of video frames is greater than the second preset threshold and less than or equal to the first preset threshold, the quantization parameter difference of the current group of video frames is calculated according to the first function.
  • Target value where the current set of video frames is in the package
  • the number of video frames included is the input parameter of the first function
  • the target value of the quantization parameter difference of the current set of video frames is the output parameter of the first function.
  • the first function the video included in the current set of video frames
  • the larger the number of frames the larger the target value of the quantization parameter difference of the current group of video frames is.
  • the current function is calculated according to the second function.
  • the target value of the quantization parameter difference of the group video frame wherein the number of video frames included in the current group of video frames is an input parameter of the second function
  • the target value of the quantization parameter difference of the current group of video frames is the second value.
  • the output parameter of the function, in the second function the larger the number of video frames included in the current set of video frames, the smaller the target value of the quantization parameter difference of the current set of video frames.
  • the second calculating module includes: a first calculating submodule configured to calculate a value of an actual quantization parameter ⁇ QP preGOP of the previous group of video frames of the current group of video frames and a quantization parameter difference of the current group of video frames
  • the difference between the values of the target value ⁇ QP Target is ⁇ QP preGOP - ⁇ QP Target ;
  • the second calculation sub-module is set to calculate the correction parameter h of the current set of video frames according to the difference formula ( ⁇ QP preGOP - ⁇ QP Target ) Value:
  • ⁇ QP max1 denotes a first predetermined value
  • ⁇ QP max2 denotes a second predetermined value
  • represents a third predetermined value
  • the obtaining module is configured to: calculate a target bit rate of the I frame in the current group of video frames by using the following formula: Where h( ⁇ QP preGOP - ⁇ QP Target ) represents the correction parameter of the current set of video frames, Isize Target represents the target bit rate of the I frame in the current set of video frames, and Bit I, pre represents the previous one of the current set of video frames.
  • the actual code rate of the I frame in the group video frame, Bit ave, not I, preGOP represents the average of the actual code rates of the non-I frames in the previous group of video frames of the current group of video frames.
  • an electronic device for implementing the above video bit rate processing method is also provided.
  • the electronic device may include: one or more (only one shown in the figure) processor 201, memory 203, and transmission
  • the device 205 (such as the transmitting device in the above embodiment), as shown in FIG. 4, the electronic device may further include an input and output device 207.
  • the memory 203 can be configured to store a software program and a module, such as a video code rate processing method and a program instruction/module corresponding to the device in the embodiment of the present application, and the processor 201 runs the software program and the module stored in the memory 203. Thereby, various function applications and data processing are performed, that is, the above-described video bit rate processing method is implemented.
  • Memory 203 can include high speed random access memory, and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 203 can further include memory remotely located relative to processor 201, which can be connected to the electronic device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 205 described above is arranged to receive or transmit data via a network, and may also be configured as data transmission between the processor and the memory. Specific examples of the above network may include a wired network and a wireless network.
  • the transmission device 205 includes a Network Interface Controller (NIC) that can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network.
  • the transmission device 205 is a Radio Frequency (RF) module configured to communicate with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • the processor 201 can call the executable instructions stored in the memory 203 through the transmission device 205 to perform the steps of: acquiring the number of video frames included in the current group of video frames, wherein the current group of video frames is in I frames. a start frame; acquiring, according to the number of video frames included in the current set of video frames, a target code rate of the I frame in the current set of video frames, where a target code rate of the I frame is used for Encoding the I frame; encoding the I frame in the current set of video frames according to the target code rate.
  • the processor 201 can also call the executable instructions stored in the memory 203 through the transmission device 205 to perform the following steps: calculating the quantization of the current group of video frames according to the number of video frames included in the current set of video frames.
  • the target value of the parameter difference value includes: determining a quantity relationship between the number of the video frames included in the current group of video frames and the first preset threshold and the second preset threshold, wherein the first preset threshold is greater than Determining, by the second predetermined threshold, a target value of the quantization parameter difference value as a first preset quantization, if the number of video frames included in the current group of video frames is less than or equal to the second preset threshold a parameter value; if the number of video frames included in the current set of video frames is greater than the second preset threshold and less than or equal to the first preset threshold, calculating the current set of video frames according to a first function Quantitative parameter difference a target value, wherein the number of video frames included in the current set of video frames is an input parameter of
  • the processor 201 can also invoke the executable instructions stored in the memory 203 through the transmission device 205 to perform the steps of: determining a target value of the quantization parameter difference value of the current set of video frames and a front of the current set of video frames.
  • Calculating the value of the correction parameter of the current set of video frames by calculating the quantization parameter difference of the set of video frames comprises: calculating the value of the actual quantization parameter ⁇ QP preGOP of the previous set of video frames of the current set of video frames and Determining the difference ⁇ QP preGOP - ⁇ QP Target between the values of the target value ⁇ QP Target of the quantization parameter difference of the current set of video frames; calculating the correction parameter h of the current set of video frames according to the difference by the following formula ( ⁇ QP preGOP - ⁇ QP Target ):
  • ⁇ QP max1 denotes a first predetermined value
  • ⁇ QP max2 denotes a second predetermined value
  • represents a third predetermined value
  • the processor 201 may also call the executable instruction stored in the memory 203 through the transmission device 205 to perform the following steps: acquiring a target code rate of the I frame in the current set of video frames according to the value of the correction parameter.
  • the method includes: calculating, by using the following formula, a target bit rate of the I frame in the current set of video frames:
  • Isize Target represents a target code rate of the I frame in the current set of video frames
  • Bit I pre represents a previous set of videos of the current set of video frames
  • the actual code rate of the I frame in the frame, Bit ave, not I, preGOP represents the average of the actual code rates of the non-I frames in the previous set of video frames of the current set of video frames.
  • the current frame group of video frames is obtained according to the number of video frames included in the current set of video frames by acquiring the number of video frames included in the current group of video frames starting with the I frame. a target code rate of the I frame in the frame, and then encoding the I frame in the current set of video frames according to the target code rate, because according to a video frame included in a current set of video frames Obtaining a target code rate of the I frame in the current set of video frames, and determining a target bit rate of the I frame of the set of video frames according to the number of each set of video frames, thereby improving video The technical effect of compression and playback quality, thereby solving the technical problem of poor video performance caused by inaccurate bit rate allocation of video in related art.
  • the structure shown in FIG. 4 is merely illustrative, and the electronic device can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a mobile Internet device (MID). , PAD and other electronic devices.
  • FIG. 4 does not limit the structure of the above electronic device.
  • the electronic device may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 4, or have a different configuration than that shown in FIG.
  • Another embodiment of the present application also provides a storage medium.
  • the foregoing storage medium may be used to execute program code of a video bit rate processing method.
  • the storage medium is arranged to store program code for performing the following steps:
  • ⁇ QP max1 denotes a first predetermined value
  • ⁇ QP max2 denotes a second predetermined value
  • represents a third predetermined value
  • the storage medium is further configured to store program code for: obtaining, according to the value of the correction parameter, a target code rate of the I frame in the current set of video frames comprises: The formula calculates a target bit rate of the I frame in the current set of video frames: Wherein, h( ⁇ QP preGOP - ⁇ QP Target ) represents a correction parameter of the current set of video frames, and Isize Target represents a target code rate of the I frame in the current set of video frames, and Bit I, pre represents the The actual code rate of the I frame in the previous set of video frames of the current set of video frames, Bit ave, not I, preGOP indicating the non-I frames in the previous set of video frames of the current set of video frames The average of the actual code rates.
  • the integrated unit in the above embodiment if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in the above-described computer readable storage medium.
  • the technical solution of the present application may be embodied in the form of a software product, or the whole or part of the technical solution, which is stored in the storage medium, including
  • the instructions are used to cause one or more computer devices (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
  • a target code rate of the I frame in the video frame and then encoding the I frame in the current set of video frames according to the target code rate, due to the video included in the current set of video frames
  • the purpose is to achieve the technical effect of improving the compression and playback quality of the video, thereby solving the technical problem of poor video performance caused by inaccurate rate allocation of the video in the related art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请公开了一种视频码率处理方法和装置、存储介质及电子设备。其中,该方法包括:获取当前一组视频帧中包括的视频帧的数量,其中,当前一组视频帧以I帧为起始帧;至少根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率;根据目标码率对当前一组视频帧中的I帧进行编码。本申请解决了相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题。

Description

视频码率处理方法和装置、存储介质及电子设备
本申请要求于2016年9月27日提交中国专利局、优先权号为2016108561037、发明名称为“视频码率处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频领域,具体而言,涉及一种视频码率处理方法和装置、存储介质及电子设备。
背景技术
视频播放过程中的码率控制对于视频质量具有重要影响,I帧码率分配不合适会影响整个视频的主观质量。如果I帧码率过多,I帧质量和非I帧质量差距较大,可能造成主观闪烁不连贯,同时,码率过高的I帧可能造成网络冲击,导致延时和丢包,造成视频卡顿;如果I帧码率过低,会降低I帧的编码质量,可能出现主观缺陷,同时,由于视频编码的帧间预测特性,I帧后续的非I帧质量也会受到I帧质量的影响,降低视频整体质量。因此I帧的码率分配策略对于码率平稳性和视频压缩效率非常重要。
相关技术中也有以下三种对于码率的控制方案:
相关技术一:设置I帧和非I帧的固定QP偏移量,在码率控制时,只对非I帧进行码率分配,并根据所分配的码率设置QP,在一帧内可以实时对QP进行调整;而对于I帧则采用前一个GOP中非I帧的平均QP减去QP偏移量作为I帧的QP,在帧内不再进行调整。H.264参考软件采用这种I帧码率分配方法。但这种方案的缺点为:(1)对于比较静止序列,I帧码率会远高于非I帧,实时通信中I帧会产生码率尖峰,造成网络冲击。(2)对I帧和非I帧用固定QP偏移量,不能适应不同场景需求。
相关技术二:根据缓冲区对每帧进行相同的码率分配策略,优势在于I帧码率较低,码率尖峰比较小,码率平稳,X264采用的是这种码率分配方法。但这种方案的缺点为:I帧作为被参考帧码率较低会降低视频的整体压缩质量。对于比较静止的视频聊天场景,I帧码率较低时,质量可能远低于非I帧,出现明显的主观质量缺陷。
相关技术三:首先,根据前一个GOP的I帧和P\B帧的实际码率比例分配当前GOP的I帧和P\B帧的码率比例,并结合量化步长调整码率分配比例,以IPPP结构为例,当前GOP的I帧目标码率/P帧平均目标码率=(前一个GOP的I帧码率/前一个GOP的P帧平均码率)*(前一个GOP的I帧量化步长/前一个GOP的P帧平均量化步长)。然后,根据缓冲区剩余码率限制I帧最大目标码率。但这种方案的缺点为:(1)第一步I帧码率分配方法收敛于I帧和P帧采用相同的量化步长,而没有考虑I帧和P帧对视频压缩效率的不同影响,也没有考虑不同GOP大小对码率平稳性的影响。(2)第二步限制I帧最大码率,只根据缓冲区码率设置最大值,而没有考虑实际编码情况。对部分场景不能有效降低I帧码率,对部分场景又可能分配I帧码率过低,影响视频质量。
针对上述的问题,目前尚未提出有效的解决方案。
发明内容
本申请实施例提供了一种视频码率处理方法和装置、存储介质及电子设备,以至少解决相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题。
根据本申请实施例的一个方面,提供了一种视频码率处理方法,包括:获取当前一组视频帧中包括的视频帧的数量,其中,所述当前一组视频帧以I帧为起始帧;至少根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率;根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码。
根据本申请实施例的另一方面,还提供了一种视频码率处理装置,包括:第一获取单元,设置为获取当前一组视频帧中包括的视频帧的数量,其中,所述当前一组视频帧以I帧为起始帧;第二获取单元,设置为根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率;编码单元,设置为根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码。
根据本申请实施例的另一方面,还提供了一种存储介质,包括存储的程序,其中,所述程序运行时执行本申请的视频码率处理方法。
根据本申请实施例的另一方面,还提供了一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器通过所述计算机程序执行本申请的视频码率处理方法。
在本申请实施例中,采用获取以I帧起始的当前一组视频帧中包括的视频帧的数量,至少根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,然后根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码的方式,由于根据当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,达到了根据每组视频帧的数量确定这组视频帧的I帧的目标码率的目的,从而实现了提高视频的压缩和播放质量的技术效果,进而解决了相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是根据本申请实施例的视频码率处理方法的硬件环境的示意图;
图2是根据本申请实施例的一种可选的视频码率处理方法的流程图;
图3是根据本申请实施例的一种可选的视频码率处理装置的示意图;
以及
图4是根据本申请实施例的一种终端的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本申请实施例进行描述的过程中出现的部分名词或者术语适用于如下解释:
QP(Quantization parameter):量化参数。
GOP(Group of Picture):以I帧起始的一组视频帧。
I帧:帧内预测帧,只采用帧内预测。
非I帧:帧间预测帧,可采用帧内预测和帧间预测。
根据本申请的一实施例,提供了一种视频码率处理方法的实施例。
可选地,在本实施例中,上述视频码率处理方法可以应用于如图1所示的由服务器102和终端104所构成的硬件环境中。如图1所示,服务器102通过网络与终端104进行连接,上述网络包括但不限于:广域网、城域网或局域网,终端104并不限定于PC、手机、平板电脑等。本申请实施例的视频码率处理方法可以由服务器102来执行,也可以由终端104来执行,还可以是由服务器102和终端104共同执行。其中,终端104执行本申请实施例的视频码率处理方法也可以是由安装在其上的客户端来执行。
在一个可选的应用场景中,该视频码率处理方法由安装在终端上的客户端执行,客户端可以是即时应用客户端,终端的形式不限。在两个客户端进行视频通话过程中,第一客户端通过第一终端的摄像头录制视频,录制的视频包括多个视频帧组,每组视频帧包括多个帧,每组视频帧以I帧为起始帧,第一客户端在录制视频过程中同步对每组视频帧中的多个帧进行编码,在编码之前,需要确定目标码率,在确定目标码率时,根据每一组视频帧的数量确定该组视频帧的I帧码率,确定出目标码率之后,根据目标码率对该组视频帧的I帧进行编码,编码之后将编码后的视频帧信息传输至第二客户端,第二客户端通过解码可以显示该组视频帧,从而实现两个客户端之间的视频通话。
图2是根据本申请实施例的一种可选的视频码率处理方法的流程图,如图2所示,该方法可以包括以下步骤:
步骤S202,获取当前一组视频帧中包括的视频帧的数量,其中,当前一组视频帧以I帧为起始帧。
步骤S204,根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率。
步骤S206,根据目标码率对当前一组视频帧中的I帧进行编码。
通过上述步骤S202至步骤S206,通过获取以I帧起始的当前一组视 频帧中包括的视频帧的数量,根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率,然后根据目标码率对当前一组视频帧中的I帧进行编码的方式,由于根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率,可以解决了相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题,达到了根据每组视频帧的数量确定这组视频帧的I帧的目标码率的目的,从而提高了视频的压缩和播放质量。
在步骤S202提供的技术方案中,视频通话过程中,获取当前一组视频帧(Group Of Picture,简称为GOP)中包括的视频帧的数量,视频具有多个视频帧组,每组视频帧具有多个帧,每组视频帧都以I帧为起始帧,例如,一组视频帧可以包括10帧,也可以包括15帧,多组视频帧中包括的视频帧的数量可以相同也可以不同,每组视频帧中包括的视频帧的数量是提前设定的,因此,可以获取到当前一组视频帧中包括的视频帧的数量,在多组视频帧中包括的视频帧的数量不同的情况下,由于该实施例的视频码率处理方法可以根据每组视频帧的数量确定这组视频帧的I帧的目标码率,能够比相关技术更好地对每组视频帧的I帧进行编码,提高视频的压缩和播放质量。
在步骤S204提供的技术方案中,在获取当前一组视频帧中包括的视频帧的数量之后,根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率,可以是,根据当前一组视频帧中包括的视频帧的数量和预设的公式进行计算得到目标码率,也可以是通过查表得到与视频帧的数量对应的预设的I帧的目标码率,其中,I帧的目标码率用于对I帧进行编码。
在步骤S206提供的技术方案中,在获取到当前一组视频帧中的I的目标码率之后,根据目标码率对当前一组视频帧中的I帧进行编码,对I帧进行编码之后,再根据I帧的码率对当前一组视频帧中的非I帧进行编码,非I帧可以是P帧,根据目标码率对当前一组视频帧中的I帧进行编 码可以是编码后的当前一组视频帧中的I帧的码率为目标码率,或者接近目标码率。
作为一种可选的实施例,根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率可以是:根据当前一组视频帧中包括的视频帧的数量计算得到当前一组视频帧的量化参数差值的目标值,当前一组视频帧的量化参数差值为当前一组视频帧中的I帧的量化参数和非I帧的量化参数之间的差值;根据当前一组视频帧的量化参数差值的目标值和当前一组视频帧的前一组视频帧的量化参数差值计算当前一组视频帧的修正参数的取值,其中,修正参数用于对当前一组视频帧中的I帧的目标码率进行修正,前一组视频帧的量化参数差值为前一组视频帧中的非I帧的实际量化参数的平均值与前一组视频帧中的I帧的实际量化参数的平均值之间的差值;根据修正参数的取值获取当前一组视频帧中的I帧的目标码率。
量化参数差值的目标值可以作为一个中间参数,用于计算当前GOP的修正参数的取值,以得到当前GOP中的I帧的目标码率。由于当前GOP的前一GOP编码完成之后,能够获取前一GOP中包括的每个视频帧中的I帧和非I帧的实际码率,因此能够得到前一GOP的量化参数差值,定义量化参数差值的计算公式为:δQP=QPave,not I-QPave,I,其中,δQP表示量化参数差值,QPave,not I表示非I帧量化参数的平均值,QPave,I表示I帧量化参数的平均值,I帧量化参数的平均值可以是对于该GOP的I帧图像的多个区域的量化参数平均值,根据当前GOP量化参数差值的目标值和前一GOP的量化参数差值计算当前GOP的修正参数的取值,非I帧的量化参数可以是非I帧的量化参数的量化参数,当前一组视频帧的量化参数差值为I帧的量化参数和非I帧的量化参数之间的差值,此处所称的前一GOP的I帧或非I帧量化参数平均值为实际值的平均值,由于前一GOP的I帧或非I帧的实际码率已经确定,因此,可以获取实际值的平均值。
作为一种可选的实施例,至少根据当前一组视频帧中包括的视频帧的 数量计算得到当前一组视频帧的量化参数差值的目标值包括:判断当前一组视频帧中包括的视频帧的数量与第一预设阈值和第二预设阈值的数量大小关系,其中,第一预设阈值大于第二预设阈值;如果当前一组视频帧中包括的视频帧的数量小于等于第二预设阈值,则确定量化参数差值的目标值为第一预设量化参数值;如果当前一组视频帧中包括的视频帧的数量大于第二预设阈值且小于等于第一预设阈值,则根据第一函数计算当前一组视频帧的量化参数差值的目标值,其中,当前一组视频帧中包括的视频帧的数量为第一函数的输入参数,当前一组视频帧的量化参数差值的目标值为第一函数的输出参数,在第一函数中,当前一组视频帧中包括的视频帧的数量越大、当前一组视频帧的量化参数差值的目标值越大;如果当前一组视频帧中包括的视频帧的数量大于第一预设阈值,则根据第二函数计算当前一组视频帧的量化参数差值的目标值,其中,当前一组视频帧中包括的视频帧的数量为第二函数的输入参数,当前一组视频帧的量化参数差值的目标值为第二函数的输出参数,在第二函数中,当前一组视频帧中包括的视频帧的数量越大、当前一组视频帧的量化参数差值的目标值越小。
根据当前GOP中包括的视频帧的数量计算得到当前一GOP的量化参数差值的目标值,量化参数差值的目标值是根据GOP中视频帧的数量分段计算的,第一预设阈值和第二预设阈值是预先设定的数量阈值,第一预设阈值和第二预设阈值可以根据实际需要进行更改。在GOP中视频帧的数量小于等于第二预设阈值时,量化参数差值的目标值是第一预设量化参数值,在GOP中视频帧数量在第一预设阈值和第二预设阈值之间时,量化参数差值的目标值通过第一函数计算,第一函数是GOP中视频帧数量的增函数;当GOP中视频帧数量大于第一预设阈值时,量化参数差值的目标值通过第二函数计算,第二函数是GOP中视频帧数量的减函数。其中,在GOP中视频帧数量为第一预设阈值前和第一预设阈值后,量化参数差值的目标值可能连续也可能不连续。根据GOP中的视频帧的数量分段计算量化参数差值的目标值能够提高GOP的量化参数差值的目标值的灵活性,能够适应不同数量的视频帧的GOP,使视频码率处理的结果更准 确,进而能够提高视频通话的质量。
作为一种可选的实施例,根据当前一组视频帧的量化参数差值的目标值和当前一组视频帧的前一组视频帧的量化参数差值计算当前一组视频帧的修正参数的取值包括:计算当前一组视频帧的前一组视频帧的实际量化参数δQPpreGOP的取值和当前一组视频帧的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget;根据差值通过以下公式计算当前一组视频帧的修正参数h(δQPpreGOP-δQPTarget)的取值:
Figure PCTCN2017099595-appb-000001
其中,δQPmax1表示第一预设值,δQPmax2表示第二预设值,λ表示第三预设值。
修正参数h(δQPpreGOP-δQPTarget)的作用是对GOP中的I帧的目标码率进行修正,修正参数的计算也是通过分段函数计算的,根据当前GOP的前一GOP的实际量化参数δQPpreGOP的取值和当前GOP的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget作为分段的区间参照,在不同区间采用不同的计算公式进行计算,得到修正参数的取值,然后用修正参数的取值对目标码率进行修正。由于修正参数是分段计算的,因此,能够更加准确地得到修正参数的数值,然后用修正参数的数值对当前GOP中的目标码率进行修正,以得到更准确的目标码率。
作为一种可选的实施例,根据修正参数的取值获取当前一组视频帧中的I帧的目标码率包括:通过以下公式计算当前一组视频帧中的I帧的目标码率:
Figure PCTCN2017099595-appb-000002
其中,h(δQPpreGOP-δQPTarget)表示当前一组视频帧的修正参数,IsizeTarget表示当前一组视频帧中的I帧的目标码率,BitI,pre表示当前一组视频帧的前一组视频 帧中的I帧的实际码率,Bitave,not I,preGOP表示当前一组视频帧的前一组视频帧中的非I帧的实际码率的平均值。
在计算得到修正参数的取值之后,根据修正参数的取值计算得到当前一组视频帧中的I帧的目标码率,通过修正参数对目标码率进行修正,提高了目标码率计算结果的准确性,也提高了视频码率处理的准确性,进而提高实时视频通话的质量,并且对于视频通话过程中的质量平稳性,码率平稳性具有重要意义,对于延时,超出网络承载能力,压缩效率等多个方面的问题,都能够有效地予以弥补。
本申请还提供了一种优选实施例,下面以一个完整的优选实施例对本申请的计算方案进行说明:
一般的,I帧量化参数QP小于或等于非I帧量化参数,定义δQP=QPave,not I-QPave,I,由于量化参数的计算是差值计算得到,因此δQP也称为量化参数差值,QPave,not I表示非I帧量化参数的平均值,也即非I帧量化参数实际值的平均值。QPave,I表示I帧量化参数的平均值,也即I帧量化参数实际值的平均值,对相同序列,δQP越大,则I帧码率/非I帧码率越大。定义δQP目标为δQPTarget,也即量化参数差值的目标值。
在GOP中视频帧数量小于第一预设阈值ThreGOP1且大于第二预设阈值ThreGOP2时,I帧间隔越大(由于每个GOP只有第一帧是I帧,因此GOP中视频帧的数量越大,I帧间隔越大),提高I帧码率对整体压缩性能的提高越大,所以在GOP中视频帧数量小于ThreGOP1且大于ThreGOP2时,I帧间隔越大,I帧码率分配越高。GOP中视频帧数量大于阈值ThreGOP1时,I帧可影响到的非I帧有限,故GOP中视频帧数量越大,反而应降低I帧码率。并且,在GOP中视频帧数量小于阈值ThreGOP2时,提高I帧码率,容易造成场景变化时的实际码率超出目标码率,故应进一步降低I帧码率。一般的,ThreGOP2<ThreGOP1
通过分段函数计算量化参数差值的目标值δQPTarget
Figure PCTCN2017099595-appb-000003
其中,GOP表示GOP中视频帧的数量,f(GOP)为GOP的增函数,g(GOP)为GOP的减函数。可选地,第一预设阈值可以是64,第二预设阈值可以是32。
计算I帧目标码率IsizeTarget可以通过以下公式计算:
Figure PCTCN2017099595-appb-000004
其中,h(δQPpreGOP-δQPTarget)函数的作用是根据前一个GOP实际量化参数δQPpreGOP和量化参数差值的目标值δQPTarget修正I帧目标码率,h(δQPpreGOP-δQPTarget)函数的一种实现方式如下:
Figure PCTCN2017099595-appb-000005
其中,δQPmax1、δQPmax2是为了防止目标码率调整过快而设置的参数,δQPmax1和δQPmax2的值可以为3至6之间的参数,λ的取值可以是小于0.08的数,例如,可以是0.05。
I帧的码率分配策略对于码率平稳性和视频压缩效率非常重要,在计算得到I帧的目标码率之后,根据目标码率对每组GOP中的I帧进行编码,然后对GOP中的非I帧进行编码,非I帧可以是P帧,通过这样的编码方式,能够有效解决相关技术中,视频通话中的画面主观闪烁不连贯,延时或者丢包等技术问题,提高了视频通话时的画面质量和文件传输的稳定性。
该实施例的视频码率处理方法可以作为实时视频通信中对I帧、P\B帧联合进行码率控制时I帧码率分配方法,能够有效解决相关技术中视频 的码率分配不准确导致的视频效果不佳的技术问题,提高了视频通话的效果,使画面流畅,减少卡顿,也提高了用户体验。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
根据本申请的其他一实施例,还提供了一种用于实施上述视频码率处理方法的视频码率处理装置。图3是根据本申请实施例的一种可选的视频码率处理装置的示意图,如图3所示,该装置可以包括:
第一获取单元10,设置为获取当前一组视频帧中包括的视频帧的数量,其中,当前一组视频帧以I帧为起始帧;
第二获取单元20,设置为根据当前一组视频帧中包括的视频帧的数量获取当前一组视频帧中的I帧的目标码率,;
编码单元30,设置为根据目标码率对当前一组视频帧中的I帧进行编码。
需要说明的是,该实施例中的第一获取单元10可以用于执行本申请实施例1中的步骤S202,该实施例中的第二获取单元20可以用于执行本 申请实施例1中的步骤S204,该实施例中的编码单元30可以用于执行本申请实施例1中的步骤S206。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例1所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图1所示的硬件环境中,可以通过软件实现,也可以通过硬件实现。
通过上述模块,可以解决了相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题,进而达到提高视频的压缩和播放质量的技术效果。
可选地,第二获取单元20包括:第一计算模块,设置为根据当前一组视频帧中包括的视频帧的数量计算得到当前一组视频帧的量化参数差值的目标值中,其中,当前一组视频帧的量化参数差值为当前一组视频帧中的I帧的量化参数和非I帧的量化参数之间的差值;第二计算模块,设置为根据当前一组视频帧的量化参数差值的目标值和当前一组视频帧的前一组视频帧的量化参数差值计算当前一组视频帧的修正参数的取值,其中,修正参数用于对当前一组视频帧中的I帧的目标码率进行修正,前一组视频帧的量化参数差值为前一组视频帧中的非I帧的实际量化参数的平均值与前一组视频帧中的I帧的实际量化参数的平均值之间的差值;获取模块,设置为根据修正参数的取值获取当前一组视频帧中的I帧的目标码率。
可选地,第一计算模块包括:判断子模块,设置为判断当前一组视频帧中包括的视频帧的数量与第一预设阈值和第二预设阈值的数量大小关系,其中,第一预设阈值大于第二预设阈值;确定子模块,设置为在当前一组视频帧中包括的视频帧的数量小于等于第二预设阈值时,确定量化参数差值的目标值为第一预设量化参数值;在当前一组视频帧中包括的视频帧的数量大于第二预设阈值且小于等于第一预设阈值时,根据第一函数计算当前一组视频帧的量化参数差值的目标值,其中,当前一组视频帧中包 括的视频帧的数量为第一函数的输入参数,当前一组视频帧的量化参数差值的目标值为第一函数的输出参数,在第一函数中,当前一组视频帧中包括的视频帧的数量越大、当前一组视频帧的量化参数差值的目标值越大;在当前一组视频帧中包括的视频帧的数量大于第一预设阈值时,根据第二函数计算当前一组视频帧的量化参数差值的目标值,其中,当前一组视频帧中包括的视频帧的数量为第二函数的输入参数,当前一组视频帧的量化参数差值的目标值为第二函数的输出参数,在第二函数中,当前一组视频帧中包括的视频帧的数量越大、当前一组视频帧的量化参数差值的目标值越小。
可选地,第二计算模块包括:第一计算子模块,设置为计算当前一组视频帧的前一组视频帧的实际量化参数δQPpreGOP的取值和当前一组视频帧的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget;第二计算子模块,设置为根据差值通过以下公式计算当前一组视频帧的修正参数h(δQPpreGOP-δQPTarget)的取值:
Figure PCTCN2017099595-appb-000006
其中,δQPmax1表示第一预设值,δQPmax2表示第二预设值,λ表示第三预设值。
可选地,获取模块设置为:通过以下公式计算当前一组视频帧中的I帧的目标码率:
Figure PCTCN2017099595-appb-000007
其中,h(δQPpreGOP-δQPTarget)表示当前一组视频帧的修正参数,IsizeTarget表示当前一组视频帧中的I帧的目标码率,BitI,pre表示当前一组视频帧的前一组视频帧中的I帧的实际码率,Bitave,not I,preGOP表示当前一组视频帧的前一组视频帧中的非I帧的实际码率的平均值。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例1所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图1所示的硬件环境中,可以通过软件实现,也可以通过硬件实现,其中,硬件环境包括网络环境。
根据本申请的其他一实施例,还提供了一种用于实施上述视频码率处理方法的电子设备。
图4是根据本申请实施例的一种电子设备的结构框图,如图4所示,该电子设备可以包括:一个或多个(图中仅示出一个)处理器201、存储器203、以及传输装置205(如上述实施例中的发送装置),如图4所示,该电子设备还可以包括输入输出设备207。
其中,存储器203可设置为存储软件程序以及模块,如本申请实施例中的视频码率处理方法和装置对应的程序指令/模块,处理器201通过运行存储在存储器203内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的视频码率处理方法。存储器203可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器203可进一步包括相对于处理器201远程设置的存储器,这些远程存储器可以通过网络连接至电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
上述的传输装置205设置为经由一个网络接收或者发送数据,还可以设置为处理器与存储器之间的数据传输。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置205包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置205为射频(Radio Frequency,RF)模块,其设置为通过无线方式与互联网进行通讯。
其中,具体地,存储器203用于存储可执行指令。
处理器201可以通过传输装置205调用存储器203存储的可执行指令,以执行下述步骤:获取当前一组视频帧中包括的视频帧的数量,其中,所述当前一组视频帧以I帧为起始帧;根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,其中,所述I帧的目标码率用于对所述I帧进行编码;根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码。
处理器201还可以通过传输装置205调用存储器203存储的可执行指令,以执行下述步骤:根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率包括:根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视频帧的量化参数差值的目标值,其中,当前一组视频帧的量化参数差值为当前一组视频帧中的I帧的量化参数和非I帧的量化参数之间的差值;根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值,其中,所述修正参数用于对所述当前一组视频帧中的所述I帧的目标码率进行修正,所述前一组视频帧的量化参数差值为所述前一组视频帧中的非I帧的实际量化参数的平均值与所述前一组视频帧中的I帧的实际量化参数的平均值之间的差值;根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率。
处理器201还可以通过传输装置205调用存储器203存储的可执行指令,以执行下述步骤:根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视频帧的量化参数差值的目标值包括:判断所述当前一组视频帧中包括的视频帧的数量与第一预设阈值和第二预设阈值的数量大小关系,其中,所述第一预设阈值大于所述第二预设阈值;如果所述当前一组视频帧中包括的视频帧的数量小于等于所述第二预设阈值,则确定所述量化参数差值的目标值为第一预设量化参数值;如果所述当前一组视频帧中包括的视频帧的数量大于所述第二预设阈值且小于等于所述第一预设阈值,则根据第一函数计算所述当前一组视频帧的量化参数差值的 目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第一函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第一函数的输出参数,在所述第一函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越大;如果所述当前一组视频帧中包括的视频帧的数量大于所述第一预设阈值,则根据第二函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第二函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第二函数的输出参数,在所述第二函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越小。
处理器201还可以通过传输装置205调用存储器203存储的可执行指令,以执行下述步骤:根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值包括:计算所述当前一组视频帧的前一组视频帧的实际量化参数δQPpreGOP的取值和所述当前一组视频帧的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget;根据所述差值通过以下公式计算所述当前一组视频帧的修正参数h(δQPpreGOP-δQPTarget)的取值:
Figure PCTCN2017099595-appb-000008
其中,δQPmax1表示第一预设值,δQPmax2表示第二预设值,λ表示第三预设值。
处理器201还可以通过传输装置205调用存储器203存储的可执行指令,以执行下述步骤:根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率包括:通过以下公式计算所述当前一组视频帧中的所述I帧的目标码率:
Figure PCTCN2017099595-appb-000009
其中,h(δQPpreGOP-δQPTarget)
表示所述当前一组视频帧的修正参数,IsizeTarget表示所述当前一组视频帧中的所述I帧的目标码率,BitI,pre表示所述当前一组视频帧的前一组视频帧中的所述I帧的实际码率,Bitave,not I,preGOP表示所述当前一组视频帧的前一组视频帧中的所述非I帧的实际码率的平均值。
采用本申请实施例,采用获取以I帧起始的当前一组视频帧中包括的视频帧的数量,根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,然后根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码的方式,由于根据当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,达到了根据每组视频帧的数量确定这组视频帧的I帧的目标码率的目的,从而实现了提高视频的压缩和播放质量的技术效果,进而解决了相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题。
可选地,本实施例中的具体示例可以参考上述实施例1和实施例2中所描述的示例,本实施例在此不再赘述。
本领域普通技术人员可以理解,图4所示的结构仅为示意,电子设备可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等电子设备。图4其并不对上述电子设备的结构造成限定。例如,电子设备还可包括比图4中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图4所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令电子设备设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中。
本申请的其他一实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于执行视频码率处理方法的程序代码。
可选地,在本实施例中,上述存储介质可以位于上述实施例所示的网络中的多个网络设备中的至少一个网络设备上。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:
S1,获取当前一组视频帧中包括的视频帧的数量,其中,所述当前一组视频帧以I帧为起始帧;
S2,根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,其中,所述I帧的目标码率用于对所述I帧进行编码;
S3,根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率包括:根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视频帧的量化参数差值的目标值,其中,当前一组视频帧的量化参数差值为当前一组视频帧中的I帧的量化参数和非I帧的量化参数之间的差值;根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值,其中,所述修正参数用于对所述当前一组视频帧中的所述I帧的目标码率进行修正,所述前一组视频帧的量化参数差值为所述前一组视频帧中的非I帧的实际量化参数的平均值与所述前一组视频帧中的I帧的实际量化参数的平均值之间的差值;根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视 频帧的量化参数差值的目标值包括:判断所述当前一组视频帧中包括的视频帧的数量与第一预设阈值和第二预设阈值的数量大小关系,其中,所述第一预设阈值大于所述第二预设阈值;如果所述当前一组视频帧中包括的视频帧的数量小于等于所述第二预设阈值,则确定所述量化参数差值的目标值为第一预设量化参数值;如果所述当前一组视频帧中包括的视频帧的数量大于所述第二预设阈值且小于等于所述第一预设阈值,则根据第一函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第一函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第一函数的输出参数,在所述第一函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越大;如果所述当前一组视频帧中包括的视频帧的数量大于所述第一预设阈值,则根据第二函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第二函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第二函数的输出参数,在所述第二函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越小。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值包括:计算所述当前一组视频帧的前一组视频帧的实际量化参数δQPpreGOP的取值和所述当前一组视频帧的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget;根据所述差值通过以下公式计算所述当前一组视频帧的修正参数h(δQPpreGOP-δQPTarget)的取值:
Figure PCTCN2017099595-appb-000010
其中,δQPmax1表示第一预设值,δQPmax2表示第二预设值,λ表示第三预设 值。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率包括:通过以下公式计算所述当前一组视频帧中的所述I帧的目标码率:
Figure PCTCN2017099595-appb-000011
其中,h(δQPpreGOP-δQPTarget)表示所述当前一组视频帧的修正参数,IsizeTarget表示所述当前一组视频帧中的所述I帧的目标码率,BitI,pre表示所述当前一组视频帧的前一组视频帧中的所述I帧的实际码率,Bitave,not I,preGOP表示所述当前一组视频帧的前一组视频帧中的所述非I帧的实际码率的平均值。
可选地,本申请的每个具体实施方式对于技术方案的论述各有侧重,在某个具体实施方式中没有提及的内容可以参考上述其他实施方式中所描述的示例,本实施方式在此不再赘述。
可选地,在本实施例中,上述存储介质可以包括但不限于:闪存盘、U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实 施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。
工业实用性
在本申请实施例中,采用获取以I帧起始的当前一组视频帧中包括的视频帧的数量,至少根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,然后根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码的方式,由于根据当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率,达到了根据每组视频帧的数量确定这组视频帧的I帧的目标码率的 目的,从而实现了提高视频的压缩和播放质量的技术效果,进而解决了相关技术中视频的码率分配不准确导致的视频效果不佳的技术问题。

Claims (12)

  1. 一种视频码率处理方法,包括:
    获取当前一组视频帧中包括的视频帧的数量,其中,所述当前一组视频帧以I帧为起始帧;
    至少根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率;
    根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码。
  2. 根据权利要求1所述的方法,其中,至少根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率包括:
    根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧的量化参数差值为所述当前一组视频帧中的I帧的量化参数和非I帧的量化参数之间的差值;
    根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值,其中,所述修正参数用于对所述当前一组视频帧中的所述I帧的目标码率进行修正,所述前一组视频帧的量化参数差值为所述前一组视频帧中的非I帧的实际量化参数的平均值与所述前一组视频帧中的I帧的实际量化参数的平均值之间的差值;
    根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率。
  3. 根据权利要求2所述的方法,其中,根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视频帧的量化参数差值的目标值包括:
    判断所述当前一组视频帧中包括的视频帧的数量与第一预设阈 值和第二预设阈值的数量大小关系,其中,所述第一预设阈值大于所述第二预设阈值;
    如果所述当前一组视频帧中包括的视频帧的数量小于等于所述第二预设阈值,则确定所述量化参数差值的目标值为第一预设量化参数值;
    如果所述当前一组视频帧中包括的视频帧的数量大于所述第二预设阈值且小于等于所述第一预设阈值,则根据第一函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第一函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第一函数的输出参数,在所述第一函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越大;
    如果所述当前一组视频帧中包括的视频帧的数量大于所述第一预设阈值,则根据第二函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第二函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第二函数的输出参数,在所述第二函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越小。
  4. 根据权利要求2所述的方法,其中,根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值包括:
    计算所述当前一组视频帧的前一组视频帧的实际量化参数δQPpreGOP的取值和所述当前一组视频帧的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget
    根据所述差值通过以下公式计算所述当前一组视频帧的修正参数h(δQPpreGOP-δQPTarget)的取值:
    Figure PCTCN2017099595-appb-100001
    其中,δQPmax1表示第一预设值,δQPmax2表示第二预设值,λ表示第三预设值。
  5. 根据权利要求2至4中任一项所述的方法,其中,根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率包括:
    通过以下公式计算所述当前一组视频帧中的所述I帧的目标码率:
    Figure PCTCN2017099595-appb-100002
    其中,h(δQPpreGOP-δQPTarget)表示所述当前一组视频帧的修正参数,IsizeTarget表示所述当前一组视频帧中的所述I帧的目标码率,BitI,pre表示所述当前一组视频帧的前一组视频帧中的所述I帧的实际码率,Bitave,not I,preGOP表示所述当前一组视频帧的前一组视频帧中的所述非I帧的实际码率的平均值。
  6. 一种视频码率处理装置,包括:
    第一获取单元,设置为获取当前一组视频帧中包括的视频帧的数量,其中,所述当前一组视频帧以I帧为起始帧;
    第二获取单元,设置为至少根据所述当前一组视频帧中包括的视频帧的数量获取所述当前一组视频帧中的所述I帧的目标码率;
    编码单元,设置为根据所述目标码率对所述当前一组视频帧中的所述I帧进行编码。
  7. 根据权利要求6所述的装置,其中,所述第二获取单元包括:
    第一计算模块,设置为根据所述当前一组视频帧中包括的视频帧的数量计算得到所述当前一组视频帧的量化参数差值的目标值,其中, 所述当前一组视频帧的量化参数差值为所述当前一组视频帧中的I帧的量化参数和非I帧的量化参数之间的差值;
    第二计算模块,设置为根据所述当前一组视频帧的量化参数差值的目标值和所述当前一组视频帧的前一组视频帧的量化参数差值计算所述当前一组视频帧的修正参数的取值,其中,所述修正参数用于对所述当前一组视频帧中的所述I帧的目标码率进行修正,所述前一组视频帧的量化参数差值为所述前一组视频帧中的非I帧的实际量化参数的平均值与所述前一组视频帧中的I帧的实际量化参数的平均值之间的差值;
    获取模块,设置为根据所述修正参数的取值获取所述当前一组视频帧中的所述I帧的目标码率。
  8. 根据权利要求7所述的装置,其中,所述第一计算模块包括:
    判断子模块,设置为判断所述当前一组视频帧中包括的视频帧的数量与第一预设阈值和第二预设阈值的数量大小关系,其中,所述第一预设阈值大于所述第二预设阈值;
    确定子模块,设置为在所述当前一组视频帧中包括的视频帧的数量小于等于所述第二预设阈值时,确定所述量化参数差值的目标值为第一预设量化参数值;
    在所述当前一组视频帧中包括的视频帧的数量大于所述第二预设阈值且小于等于所述第一预设阈值时,根据第一函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第一函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第一函数的输出参数,在所述第一函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越大;
    在所述当前一组视频帧中包括的视频帧的数量大于所述第一预设阈值时,根据第二函数计算所述当前一组视频帧的量化参数差值的目标值,其中,所述当前一组视频帧中包括的视频帧的数量为所述第 二函数的输入参数,所述当前一组视频帧的量化参数差值的目标值为所述第二函数的输出参数,在所述第二函数中,所述当前一组视频帧中包括的视频帧的数量越大、所述当前一组视频帧的量化参数差值的目标值越小。
  9. 根据权利要求7所述的装置,其中,所述第二计算模块包括:
    第一计算子模块,设置为计算所述当前一组视频帧的前一组视频帧的实际量化参数δQPpreGOP的取值和所述当前一组视频帧的量化参数差值的目标值δQPTarget的取值之间的差值δQPpreGOP-δQPTarget
    第二计算子模块,设置为根据所述差值通过以下公式计算所述当前一组视频帧的修正参数h(δQPpreGOP-δQPTarget)的取值:
    Figure PCTCN2017099595-appb-100003
    其中,δQPmax1表示第一预设值,δQPmax2表示第二预设值,λ表示第三预设值。
  10. 根据权利要求7至9中任一项所述的装置,其中,所述获取模块设置为:
    通过以下公式计算所述当前一组视频帧中的所述I帧的目标码率:
    Figure PCTCN2017099595-appb-100004
    其中,h(δQPpreGOP-δQPTarget)表示所述当前一组视频帧的修正参数,IsizeTarget表示所述当前一组视频帧中的所述I帧的目标码率,BitI,pre表示所述当前一组视频帧的前一组视频帧中的所述I帧的实际码率,Bitave,not I,preGOP表示所述当前一组视频帧的前一组视频帧中的所述非I帧的实际码率的平均值。
  11. 一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行 时执行所述权利要求1至5任一项中所述的方法。
  12. 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器通过所述计算机程序执行所述权利要求1至5中任一项所述的方法。
PCT/CN2017/099595 2016-09-27 2017-08-30 视频码率处理方法和装置、存储介质及电子设备 WO2018059175A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/308,600 US10666939B2 (en) 2016-09-27 2017-08-30 Method and apparatus for processing video bitrate, storage medium, and electronic device
EP17854627.1A EP3522534B1 (en) 2016-09-27 2017-08-30 Video code rate processing method and apparatus, storage medium and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610856103.7 2016-09-27
CN201610856103.7A CN107872669B (zh) 2016-09-27 2016-09-27 视频码率处理方法和装置

Publications (1)

Publication Number Publication Date
WO2018059175A1 true WO2018059175A1 (zh) 2018-04-05

Family

ID=61752365

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099595 WO2018059175A1 (zh) 2016-09-27 2017-08-30 视频码率处理方法和装置、存储介质及电子设备

Country Status (4)

Country Link
US (1) US10666939B2 (zh)
EP (1) EP3522534B1 (zh)
CN (1) CN107872669B (zh)
WO (1) WO2018059175A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992880A (zh) * 2021-10-15 2022-01-28 上海佰贝科技发展股份有限公司 4k视频识别方法、系统、设备及计算机可读存储介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385571B (zh) * 2018-12-29 2022-07-19 浙江宇视科技有限公司 一种超长图像组码率控制方法及装置
CN110290402B (zh) * 2019-07-31 2021-11-05 腾讯科技(深圳)有限公司 一种视频码率调整方法、装置、服务器及存储介质
CN112788346B (zh) * 2019-11-11 2022-06-14 腾讯科技(深圳)有限公司 编码结构选择方法及相关装置
CN112019850B (zh) * 2020-08-27 2022-08-23 广州市百果园信息技术有限公司 基于场景切换的图像组划分方法、视频编码方法及装置
CN112989934B (zh) * 2021-02-05 2024-05-24 方战领 视频分析方法、装置及系统
CN113382242B (zh) * 2021-05-20 2023-01-24 北京大学深圳研究生院 码率控制方法、装置、设备及计算机可读存储介质
CN114025190B (zh) * 2021-11-03 2023-06-20 北京达佳互联信息技术有限公司 多码率调度方法和多码率调度装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188752A (zh) * 2007-12-18 2008-05-28 方春 一种基于相关性的自适应码率控制方法
CN101198042A (zh) * 2007-12-26 2008-06-11 广东威创视讯科技股份有限公司 视频编码的码率控制方法及视频数据的发射设备
CN103179394A (zh) * 2013-01-21 2013-06-26 北京航空航天大学 一种基于区域视频质量平稳的i帧码率控制方法
US20150349915A1 (en) * 2014-05-29 2015-12-03 Electronics And Telecommunications Research Institute Method and apparatus for generating frames for error correction

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW501022B (en) * 1998-03-16 2002-09-01 Mitsubishi Electric Corp Moving picture coding system
DE60206738D1 (de) * 2002-06-11 2005-11-24 St Microelectronics Srl Videokodierungsverfahren und -Vorrichtung mit variabler Bitrate
US8325797B2 (en) * 2005-04-11 2012-12-04 Maxim Integrated Products, Inc. System and method of reduced-temporal-resolution update for video coding and quality control
US8396118B2 (en) * 2007-03-19 2013-03-12 Sony Corporation System and method to control compressed video picture quality for a given average bit rate
CN104737542B (zh) * 2013-01-30 2018-09-25 英特尔公司 用于下一代视频的内容自适应熵编码
FR3024313B1 (fr) * 2014-07-25 2017-12-08 Allegro Dvt Codeur de video a debit variable
US10097828B2 (en) * 2014-12-11 2018-10-09 Intel Corporation Rate control for parallel video encoding

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188752A (zh) * 2007-12-18 2008-05-28 方春 一种基于相关性的自适应码率控制方法
CN101198042A (zh) * 2007-12-26 2008-06-11 广东威创视讯科技股份有限公司 视频编码的码率控制方法及视频数据的发射设备
CN103179394A (zh) * 2013-01-21 2013-06-26 北京航空航天大学 一种基于区域视频质量平稳的i帧码率控制方法
US20150349915A1 (en) * 2014-05-29 2015-12-03 Electronics And Telecommunications Research Institute Method and apparatus for generating frames for error correction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3522534A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992880A (zh) * 2021-10-15 2022-01-28 上海佰贝科技发展股份有限公司 4k视频识别方法、系统、设备及计算机可读存储介质
CN113992880B (zh) * 2021-10-15 2024-04-12 上海佰贝科技发展股份有限公司 4k视频识别方法、系统、设备及计算机可读存储介质

Also Published As

Publication number Publication date
US20190182480A1 (en) 2019-06-13
CN107872669A (zh) 2018-04-03
EP3522534A4 (en) 2020-01-22
EP3522534A1 (en) 2019-08-07
CN107872669B (zh) 2019-05-24
US10666939B2 (en) 2020-05-26
EP3522534B1 (en) 2021-12-08

Similar Documents

Publication Publication Date Title
WO2018059175A1 (zh) 视频码率处理方法和装置、存储介质及电子设备
US11089305B2 (en) Video frame coding method during scene change, terminal and storage medium
US9419875B2 (en) Video quality assessment method and apparatus
US20130096904A1 (en) Quality of User Experience Testing for Video Transmissions
US9154820B2 (en) Encoding apparatus, encoding method, and storage medium
US8750293B2 (en) Apparatus and method for rendering video with retransmission delay
US10834405B2 (en) Bit rate allocation method and device, and storage medium
US20210409724A1 (en) Method and device for bitrate adjustment in encoding process
CN107920041B (zh) 一种直播视频数据编码比特率的调整方法和装置
Nguyen et al. A new adaptation approach for viewport-adaptive 360-degree video streaming
US10116715B2 (en) Adapting encoded bandwidth
JP2016111699A (ja) リアルタイム符号化のための方法及び装置
EP3522544A1 (en) Estimating video quality of experience
EP3319317B1 (en) Video encoding and decoding method and device
US20110317758A1 (en) Image processing apparatus and method of processing image and video
US10880562B2 (en) Image processing method and camera thereof
CN116962613A (zh) 数据传输方法及装置、计算机设备、存储介质
Nguyen et al. A QoS-adaptive framework for screen sharing over Internet
AU2013377642A1 (en) Method and apparatus for context-based video quality assessment
US8913200B2 (en) Encoding apparatus, encoding method, and program
TW201429229A (zh) 影片傳輸系統及方法
JP2013031038A (ja) 通信装置、映像取得方法、及び映像取得プログラム
JP5707461B2 (ja) 映像品質推定装置、映像品質推定方法及びプログラム
TW201429228A (zh) 影片傳輸系統及方法
CN117135415A (zh) 视频数据的传输方法、装置及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17854627

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017854627

Country of ref document: EP

Effective date: 20190429