WO2021088263A1 - 一种控制视频转码码率的方法和装置 - Google Patents

一种控制视频转码码率的方法和装置 Download PDF

Info

Publication number
WO2021088263A1
WO2021088263A1 PCT/CN2020/074966 CN2020074966W WO2021088263A1 WO 2021088263 A1 WO2021088263 A1 WO 2021088263A1 CN 2020074966 W CN2020074966 W CN 2020074966W WO 2021088263 A1 WO2021088263 A1 WO 2021088263A1
Authority
WO
WIPO (PCT)
Prior art keywords
live stream
target live
bit rate
code rate
rate
Prior art date
Application number
PCT/CN2020/074966
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 EP20719917.5A priority Critical patent/EP3840390A4/en
Priority to US16/863,799 priority patent/US20210168418A1/en
Publication of WO2021088263A1 publication Critical patent/WO2021088263A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/611Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • 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/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2402Monitoring of the downstream path of the transmission network, e.g. bandwidth available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities

Definitions

  • This application relates to the technical field of video processing, and in particular to a method and device for controlling video transcoding rate.
  • Watching live broadcasts is a mainstream form of entertainment at the moment.
  • a large number of user terminals are equipped with live broadcast clients. Through the live broadcast clients, users can play live streams provided by the live broadcast platform. Generally, the host will push live streams with higher resolution, frame rate and bit rate. In order to adapt to different network bandwidths, terminal processing capabilities and user needs, live streaming platforms often need to transcode the live streams on the server side. .
  • the background server of the live broadcast platform pulls a new live stream from the live source, it can generate multiple transcoding tasks according to different transcoding rules, and then create a corresponding transcoding process for each transcoding task, which can then be converted
  • the transcoding thread in the coding process realizes the steps of parsing, transcoding, and encapsulating the live stream.
  • the background server may push the corresponding live stream to the user terminal.
  • the live broadcast stream pushed by the host has a high probability of fluctuating bit rate. Therefore, when the back-end server is transcoding, if it is transcoded according to a specific bit rate manually set, it may cause a waste of live stream bit rate or loss of image quality; if no specific bit rate is set, the back-end server defaults to each video
  • the picture complexity of the frame transcodes the live stream, and the bit rate of the live stream obtained by transcoding may fluctuate greatly, so it is easy to cause the video playback on the user terminal to freeze, and the quality of the live service is poor.
  • a method for controlling a video transcoding rate includes:
  • a device for controlling a video transcoding rate includes:
  • the input detection module is configured to periodically detect the average input bit rate of the target live stream during the process of transcoding the target live stream;
  • a code rate calculation module configured to determine the code rate to be set according to the average input code rate and the preset standard code rate corresponding to the target live stream;
  • the real-time transcoding module is configured to transcode the target live stream based on the to-be-set bit rate.
  • a backend server in a third aspect, includes a processor and a memory.
  • the memory stores at least one instruction, at least one program, code set, or instruction set. A piece of program, the code set or the instruction set is loaded and executed by the processor to implement the method for controlling the video transcoding rate as described in the first aspect.
  • a computer-readable storage medium stores at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, and the code
  • the set or instruction set is loaded and executed by the processor to implement the method for controlling the video transcoding rate as described in the first aspect.
  • the average input bit rate of the target live stream is periodically detected; the average input bit rate and the preset standard bit rate corresponding to the target live stream are determined to be set Fixed bit rate; transcode the target live stream based on the bit rate to be set.
  • the transcoding rate is regularly adjusted to ensure that the transcoding rate is basically the same as the input bit rate. Avoid image quality loss or live broadcast jams due to excessively high or low transcoding rates, thereby improving the quality of live broadcast services.
  • FIG. 1 is a flowchart of a method for controlling a video transcoding rate provided by an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an apparatus for controlling a video transcoding rate provided by an embodiment of the present application
  • Fig. 3 is a schematic structural diagram of a backend server provided by an embodiment of the present application.
  • the embodiment of the present application provides a method for controlling the video transcoding rate, and the execution subject of the method may be a background server of a live broadcast platform.
  • the back-end server may have a video transcoding function. After receiving the live stream, the back-end server may transcode the live video, and then provide the transcoded live video to the outside world.
  • the live broadcast platform can be equipped with multiple back-end servers, each back-end server can be used to perform multiple transcoding tasks of different live streams, and each video stream can correspond to multiple transcoding tasks according to the transcoding requirements.
  • the above-mentioned background server may include a processor, a memory, and a transceiver. The processor may be used to transcode the live stream in the following process.
  • the memory may be used to store the data required and generated during the following processing.
  • the transceiver It can be used to receive and send related data in the following processing.
  • the method for controlling the video transcoding rate disclosed in this embodiment can also be applied to on-demand video, and the specific process is similar to the processing process of live video.
  • Step 101 In the process of transcoding the target live stream, periodically detect the average input bit rate of the target live stream.
  • the data collection component on the host can collect the pictures and sounds used to generate the live video in real time, and then the video production component generates the corresponding live video, and the video transmission component streams the live stream Real-time push to the background server of the live broadcast platform.
  • the background server obtains a certain live stream (take the target live stream as an example), it can generate a transcoding task corresponding to the target live stream according to the transcoding rules preset by the live platform, and create a transcoding task for each transcoding task.
  • a transcoding process is a certain live stream.
  • the background server can create a main thread in the transcoding process, and realize the transcoding processing of the target live stream through the main thread according to the information such as the packaging format, audio and video parameters, and codec parameters carried by the transcoding task.
  • the backend server can transcode the target live stream according to the manually set default bitrate, or automatically select the bitrate to transcode the target live stream according to the screen complexity of the detected live stream.
  • the background server can continuously adjust the transcoding rate according to the method disclosed in this embodiment.
  • the background server may periodically detect the average input bit rate of the target live stream, for example, every 10 seconds. Specifically, the background server may store the data packet in the global queue when receiving the data packet of the target live stream. In this way, when detecting the average input bit rate, the background server can calculate the average input bit rate of the target live stream based on the amount of data stored in the global queue. It can be understood that the background server can only store the data volume information of the data packet in the global queue to reduce the occupation of the storage space of the device. It is worth mentioning that the background server can specifically set a detection thread in the transcoding process to perform the detection processing of the average input bit rate of the target live stream.
  • Step 102 Determine the bit rate to be set according to the average input bit rate and the preset standard bit rate corresponding to the target live stream.
  • the background server can set corresponding preset standard bitrates for live streams with different video parameters. If the real-time bit rate of the transcoded live stream is lower than the preset standard bit rate, the live screen will suffer a loss of image quality and the playback effect will be affected to some extent; and if the real-time bit rate continues to be higher than the preset standard bit rate, The above situation can be avoided with a high probability. Therefore, after detecting the average input bit rate of the target live stream, the background server can first determine the preset standard bit rate corresponding to the target live stream, and then can determine the next cycle based on the above average input bit rate and the preset standard bit rate The reference bit rate when transcoding the target live stream, that is, the bit rate to be set.
  • the preset standard bit rate corresponding to the target live stream can be calculated according to the video parameters of the target live stream and the video parameters of the standard live stream.
  • the standard live stream can be a live stream with the lowest bit rate that meets the specified resolution and frame rate, and when the user terminal is playing, the playback is smooth and there is no obvious loss of image quality;
  • the video parameters include at least the resolution and frame rate. Rate and bit rate.
  • technicians can set video parameters such as the resolution, frame rate, and bit rate of the standard live stream on the background server.
  • the background server can calculate the preset standard bit rate corresponding to the target live stream according to the video parameters of the target live stream and the video parameters of the standard live stream.
  • the calculation method of the preset standard code rate may also adopt other algorithms, which is not limited in this embodiment.
  • the backend server can use multiple algorithms to calculate the preset standard code rate at the same time, and use multiple calculation results at the same time.
  • the subsequent association office will give a detailed description of the usage method. In this way, by comparing the video parameters of the target live stream and the standard live stream, the preset standard bit rate of the target live stream can be calculated more intuitively and accurately.
  • the degree of picture fluctuation of the live stream can be considered at the same time, and the corresponding processing can be as follows: according to the video parameters of the target live stream and the video parameters of the standard live stream, and the target live stream Calculate the preset standard bit rate corresponding to the target live stream.
  • the backend server when it calculates the preset standard bit rate corresponding to the target live stream, it can first determine the degree of picture fluctuation of the target live stream, which can be specifically determined according to the live broadcast type of the target live stream, such as the picture fluctuation of the hosted live broadcast The degree is weak, and the picture fluctuation degree of the sports live broadcast is strong; or the background server can periodically detect the picture fluctuation degree of the target live stream based on the multi-frame latest live pictures that have been transcoded during the transcoding process . After that, the background server can calculate the preset standard bit rate corresponding to the target live stream according to the video parameters of the target live stream and the video parameters of the standard live stream, and the degree of picture fluctuation of the target live stream.
  • the picture fluctuation coefficient S can be introduced into the calculation formula.
  • the calculation formulas can be as follows:
  • M line (W ⁇ H ⁇ F)/(1920 ⁇ 1080 ⁇ 30) ⁇ 2 ⁇ 1024 ⁇ 1024 ⁇ S
  • the picture fluctuation coefficient S is introduced when calculating the preset standard bit rate, which can more accurately distinguish live streams with different degrees of picture fluctuation, so that the preset standard bit rate is more in line with the real bit rate requirements of the live stream.
  • the detected average input code rate of the target live stream may include the total average input code rate and the period average input code rate in the current period. Accordingly, the processing of step 102 may be as follows: If the period average input code rate If the rate is less than the preset standard bit rate corresponding to the target live stream, set the bit rate to be set to the maximum value of the preset standard bit rate and the total average input bit rate; if the periodic average input bit rate is not less than the preset standard bit rate corresponding to the target live stream If the standard code rate is set, the code rate to be set is the product of the periodic average input code rate and the preset code rate control coefficient.
  • the backend server after the backend server detects the total average input bit rate of the target live stream and the periodic average input bit rate in the current period, it can first determine whether the period average input bit rate and the preset standard bit rate corresponding to the target live stream are The size relationship between. If the period average input bit rate is less than the preset standard bit rate, it indicates that the input bit rate of the target live stream in the current period is too low.
  • the background server can select the maximum of the preset standard bit rate and the total average input bit rate as the waiting rate. Set the bit rate.
  • the background server can compare the period average input bit rate with the preset bit rate control coefficient Multiply, and then use the product of the two as the code rate to be set.
  • the above-mentioned preset code rate control system may be empirical data summed up by technical personnel with reference to the transcoding process of historical live streams, and the specific values may be manually configured.
  • the backend server uses multiple algorithms to calculate multiple preset standard code rates, in this step, you can select the minimum value of the multiple preset standard code rates, and then use the minimum value to set Set bit rate processing.
  • the transcoding rate can be set in different ways during the initial stage of transcoding and the middle stage of transcoding. Accordingly, the processing of step 103 can be as follows: If the transcoding duration of the stream is greater than the preset duration, the bit rate to be set is determined according to the average input bit rate and the preset standard bit rate corresponding to the target live stream; if the transcoding duration of the target live stream is not greater than the preset duration, then Determine the bit rate to be set according to the average input bit rate and the preset standard bit rate corresponding to the target live stream, and the peak input bit rate of the target live stream in the current period.
  • the background server can use different methods to determine the bit rate to be set according to the transcoding duration of the target live stream. Specifically, if the transcoding duration of the target live stream is not greater than the preset duration, the background server can first determine the size between the average input bit rate and the preset standard bit rate corresponding to the target live stream.
  • the backend server uses multiple algorithms to calculate multiple preset standard code rates, in the above processing, the maximum value of the multiple preset standard code rates can be selected, and then the maximum value is used for processing.
  • Set bit rate setting processing If the transcoding duration of the target live stream is longer than the preset duration, the background server can determine the bit rate to be set according to the average input bit rate and the preset standard bit rate corresponding to the target live stream.
  • the specific processing process can refer to the above .
  • the processing of step 102 can be as follows: according to the average input bit rate and the preset corresponding to the target live stream The standard bit rate and the current bandwidth load status of the entire network determine the bit rate to be set.
  • the background server can obtain the current bandwidth load status of the entire network during the process of transcoding the target live stream.
  • the obtaining method can be to determine whether the current time belongs to the preset peak or low traffic period, or The data transmission status of the network link can be detected in real time to determine the bandwidth load status of the entire network.
  • the background server can determine the bit rate to be set according to the average input bit rate and the preset standard bit rate corresponding to the target live stream, as well as the bandwidth load status of the entire network at the current moment.
  • the bandwidth load status of the entire network can be embodied in the form of a bandwidth load factor, that is, it can be multiplied by the bandwidth load factor on the basis of the original formula.
  • the higher the bandwidth load of the whole network the transcoding rate of the live stream can be appropriately reduced to ensure the smoothness of the live stream transmission. Therefore, a smaller bandwidth load factor is selected.
  • the lower the bandwidth load of the whole network then The transcoding rate of the live stream can be appropriately increased to improve the picture quality and playback effect of the live stream, so a larger bandwidth load factor is selected.
  • Step 103 Transcoding the target live stream based on the bit rate to be set.
  • the background server can use the code rate to be set as a reference to adjust the code rate of the encoder in the main thread, so that the target live stream can be continuously transcoded.
  • the transcoding rate is reset only when the difference between the code rate to be set and the code rate that has been set is too large.
  • the processing of step 103 may be as follows: If the difference between the bit rate and the set bit rate of the target live stream is greater than the preset threshold, the target live stream will be transcoded according to the to-be-set bit rate; otherwise, the target live stream will be transcoded according to the set bit rate.
  • the background server can compare the bit rate to be set with the set bit rate of the target live stream. If the difference between the two is greater than the preset threshold, the background server can update the transcoding rate of the target live stream to the to-be-set bitrate, and then transcode the target live stream according to the to-be-set bitrate; if two If the difference is not greater than the preset threshold, the background server can keep the current transcoding rate of the target live stream unchanged, that is, continue to transcode the target live stream according to the above-mentioned set bit rate. In this way, before resetting the transcoding rate, the size of the bit rate to be set is compared with the set bit rate, which can prevent the background server from frequently changing the transcoding rate in a small area, thereby saving the equipment of the background server Processing resources.
  • the code rate to be set can be compared with the transcoding output code rate, and the transcoding rate can be reset when the difference between the two is too large.
  • the processing of step 103 can be as follows: Count the periodic average output bit rate of the target live stream in the current cycle; if the difference between the to-be-set bit rate and the periodic average output bit rate is greater than the preset threshold, the target live stream will be transcoded according to the to-be-set bit rate, Otherwise, transcode the target live stream according to the set bit rate.
  • the background server may periodically detect the periodic average output bit rate of the target live stream, for example, it may be detected every 10 seconds. Similar to the detection of the average input code rate, the background server can count the data volume of the transcoded output data packets at regular intervals, and then calculate the periodic average output code rate in the current period. It is worth mentioning that the background server can set up a detection thread in the transcoding process to perform the detection processing of the periodic average output bit rate of the target live stream. After that, the background server can compare the size of the code rate to be set with the period average code rate.
  • the background server can update the transcoding rate of the target live stream to the to-be-set bitrate, and then transcode the target live stream according to the to-be-set bitrate; if two If the difference is not greater than the preset threshold, the background server can keep the current transcoding rate of the target live stream unchanged, that is, continue to transcode the target live stream according to the above-mentioned set bit rate. In this way, compared to the set bit rate, the periodic average output bit rate can more accurately reflect the true transcoding rate of the target live stream. Compare the to-be-set bit rate with the periodic average output bit rate, which can be Avoid the background server frequently changing the transcoding rate in a small area to save the equipment processing resources of the background server. It can also avoid the need to repeatedly change the transcoding rate due to the low value of the set bit rate.
  • the detection period of the average input bit rate can be adjusted according to the fluctuation of the input bit rate of the live stream, and the corresponding processing can be as follows: record the real-time input bit rate of the target live stream; if the real-time input bit rate is If the fluctuation range is greater than the preset fluctuation threshold, the detection period of the average input code rate is shortened according to the fluctuation range, otherwise the detection period of the average input code rate is extended.
  • the backend server can record the real-time input bit rate of the target live stream during the transcoding process of the target live stream.
  • the real-time input bit rate can be calculated according to the amount of data input to the encoder within the unit time. You can choose a duration of 1 second or less.
  • the background server can calculate the fluctuation range of the real-time input code rate according to the recorded content. If the fluctuation range is greater than the preset fluctuation threshold, the detection period of the average input code rate can be shortened according to the fluctuation range; and if the fluctuation range is not greater than the preset fluctuation Threshold, you can extend the detection period of the average input bit rate.
  • the fluctuation range can be characterized in the form of fluctuation coefficient, and the detection period can be changed by multiplying the detection period of the average input code rate by the fluctuation coefficient.
  • the fluctuation range when the fluctuation range is high, the fluctuation coefficient is greater than 1, and the value is large; when the fluctuation range is low, the fluctuation coefficient is less than 1, and the value is small.
  • the detection period of the input code rate can be changed adaptively, which can improve the detection accuracy of the average input code rate, thereby making the control of the transcoding rate more reasonable and accurate.
  • the average input bit rate of the target live stream is periodically detected; the average input bit rate and the preset standard bit rate corresponding to the target live stream are determined to be set Fixed bit rate; transcode the target live stream based on the bit rate to be set.
  • the transcoding rate is regularly adjusted to ensure that the transcoding rate is basically the same as the input bit rate. Avoid image quality loss or live broadcast jams due to excessively high or low transcoding rates, thereby improving the quality of live broadcast services.
  • an embodiment of the present application also provides a device for controlling a video transcoding rate. As shown in FIG. 2, the device includes:
  • the input detection module 201 is configured to periodically detect the average input bit rate of the target live stream during the process of transcoding the target live stream;
  • the code rate calculation module 202 is configured to determine the code rate to be set according to the average input code rate and the preset standard code rate corresponding to the target live stream;
  • the real-time transcoding module 203 is configured to transcode the target live stream based on the to-be-set bitrate.
  • the code rate calculation module 202 is specifically configured to:
  • the transcoding duration of the target live stream is not greater than the preset duration, then according to the average input bit rate and the preset standard bit rate corresponding to the target live stream, and the input of the target live stream in the current cycle
  • the peak bit rate is used to determine the bit rate to be set.
  • the average input code rate includes a total average input code rate and a periodic average input code rate in the current period
  • the code rate calculation module 202 is specifically configured to:
  • the periodic average input code rate is less than the preset standard code rate corresponding to the target live stream, then set the to-be-set code rate to be the maximum value of the preset standard code rate and the total average input code rate;
  • the to-be-set code rate is set to the product of the periodic average input code rate and the preset code rate control coefficient.
  • Fig. 3 is a schematic structural diagram of a background server provided by an embodiment of the present application.
  • the background server 300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units 322 (for example, one or more processors) and a memory 332, and one or more storage application programs 342 or
  • the storage medium 330 of the data 344 (for example, one or a storage device with a large amount of storage).
  • the memory 332 and the storage medium 330 may be short-term storage or persistent storage.
  • the program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of command operations on the background server 300.
  • the central processing unit 322 may be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the background server 300.
  • the background server 300 may also include one or more power supplies 329, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, one or more keyboards 356, and/or, one or more operating systems 341, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
  • the background server 300 may include a memory and one or more programs. One or more programs are stored in the memory and configured to be executed by one or more processors. The above instructions to control the video transcoding rate.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium mentioned can be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请公开了一种控制视频转码码率的方法和装置,属于视频处理技术领域。所述方法包括:在对目标直播流进行转码的过程中,周期性检测所述目标直播流的平均输入码率(101);根据平均输入码率和目标直播流对应的预设标准码率,确定待设定码率(102);基于待设定码率对目标直播流进行转码(103)。

Description

一种控制视频转码码率的方法和装置
交叉引用
本申请引用于2019年11月08日递交的名称为“一种控制视频转码码率的方法和装置”的第201911088745.7号中国专利申请,其通过引用被全部并入本申请。
技术领域
本申请涉及视频处理技术领域,特别涉及一种控制视频转码码率的方法和装置。
背景技术
观看直播是一种当下主流的娱乐形式,大量的用户终端上都安装有直播客户端,通过直播客户端,用户可以播放直播平台提供的直播流。一般主播端推送上来的是分辨率、帧率和码率较高的直播流,而为了适应不同的网络带宽、终端处理能力和用户需求,直播平台往往需要在服务端对直播流进行转码处理。
直播平台的后台服务器从直播源拉取到新的直播流后,可以按照不同的转码规则,生成多个转码任务,然后针对每个转码任务创建对应的转码进程,进而可以通过转码进程内的转码线程实现对直播流的解析、转码、封装等步骤。之后,在接收到用户终端对于某一转码规则下的直播流的直播播放请求后,后台服务器可以向用户终端推送相应的直播流。
在实现本申请的过程中,发明人发现现有技术至少存在以下问题:
在直播过程中,受推流策略和画面复杂度的影响,主播端推送的直播流大概率存在码率波动情况。故而后台服务器在转码时,如果按照人工设置的某个 特定码率进行转码,则可能会造成直播流码率浪费或者画质损失;如果未设置特定码率,后台服务器则默认根据各视频帧的画面复杂度对直播流进行转码,转码得到的直播流的码率可能存在很大波动,故而容易造成用户终端上视频播放卡顿,直播服务的质量较差。
发明内容
为了解决现有技术的问题,本申请实施例提供了一种控制视频转码码率的方法和装置。所述技术方案如下:
第一方面,提供了一种控制视频转码码率的方法,所述方法包括:
在对目标直播流进行转码的过程中,周期性检测所述目标直播流的平均输入码率;
根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
基于所述待设定码率对所述目标直播流进行转码。
第二方面,提供了一种控制视频转码码率的装置,所述装置包括:
输入检测模块,用于在对目标直播流进行转码的过程中,周期性检测所述目标直播流的平均输入码率;
码率计算模块,用于根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
实时转码模块,用于基于所述待设定码率对所述目标直播流进行转码。
第三方面,提供了一种后台服务器,所述后台服务器包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如第一方面所述的控制视频转码码率的方法。
第四方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少 一段程序、所述代码集或指令集由处理器加载并执行以实现如第一方面所述的控制视频转码码率的方法。
本申请实施例提供的技术方案带来的有益效果是:
本申请实施例中,在对目标直播流进行转码的过程中,周期性检测目标直播流的平均输入码率;根据平均输入码率和目标直播流对应的预设标准码率,确定待设定码率;基于待设定码率对目标直播流进行转码。这样,在对直播流进行转码时,以直播流的输入码率和预设标准码率为基准,定期调节转码码率,可以最大限度地保证转码码率与输入码率基本一致,避免因转码码率过高或过低而出现画质损失或直播卡顿的情况,从而可以提高直播服务的质量。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种控制视频转码码率的方法流程图;
图2是本申请实施例提供的一种控制视频转码码率的装置结构示意图;
图3是本申请实施例提供的一种后台服务器的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作详细描述。
本申请实施例提供了一种控制视频转码码率的方法,该方法的执行主体可以是直播平台的后台服务器。其中,后台服务器可以具备视频转码功能,后台服务器在接收到直播流后,可以对直播视频进行转码处理,然后将转码后的直播视频提供给外界。直播平台可以设置有多个后台服务器,每台后台服务器 可以用于执行多个不同直播流的转码任务,每个视频流按转码需求可以对应存在多个转码任务。上述后台服务器可以包括处理器、存储器和收发器,处理器可以用于进行下述流程中对直播流转码的处理,存储器可以用于存储下述处理过程中需要的数据以及产生的数据,收发器可以用于接收和发送下述处理过程中的相关数据。本实施例公开的控制视频转码码率的方法也可应用于点播视频,具体过程与直播视频的处理过程相似。
下面将结合具体实施例,对图1所示的处理流程进行详细的说明,内容可以如下:
步骤101,在对目标直播流进行转码的过程中,周期性检测目标直播流的平均输入码率。
在实施中,主播在直播间开始直播后,主播端的数据采集组件可以实时采集用于生成直播视频的画面、声音等,再由视频制作组件生成相应的直播视频,并由视频传输组件将直播流实时推送至直播平台的后台服务器。这样,后台服务器在获取到某一直播流(以目标直播流为例)后,可以按照直播平台预设的转码规则,生成目标直播流对应的转码任务,并针对每个转码任务创建一个转码进程。之后,后台服务器可以在转码进程中创建主线程,根据转码任务携带的封装格式、音视频参数以及编解码参数等信息,通过主线程实现对目标直播流的转码处理。在转码初始阶段,后台服务器可以按照人工设置的默认码率对目标直播流进行转码,也可以根据检测到的直播流的画面复杂度,自动选取码率对目标直播流进行转码。在转码的后续过程中,后台服务器则可以按照本实施例公开的方法对转码码率持续进行调整。
在对目标直播流进行转码的过程中,后台服务器可以周期性地检测目标直播流的平均输入码率,例如可以每隔10秒检测一次。具体的,后台服务器可以在接收到目标直播流的数据包时,将数据包存入全局队列中。这样,在检测平均输入码率时,后台服务器可以根据全局队列中已存储数据的数据量,来计算目标直播流的平均输入码率。可以理解,后台服务器可以仅将数据包的数据 量信息存入全局队列,以降低对设备存储空间的占用。值得一提的是,后台服务器可以在转码进程中专门设置检测线程,用于执行上述目标直播流的平均输入码率的检测处理。
步骤102,根据平均输入码率和目标直播流对应的预设标准码率,确定待设定码率。
在实施中,后台服务器可以针对不同视频参数的直播流,设置对应的预设标准码率。若转码完成的直播流的实时码率低于预设标准码率,则直播画面将出现画质损失,播放效果将会受到一定影响;而若实时码率持续高于预设标准码率,则可以大概率避免上述情况。故而,在检测到目标直播流的平均输入码率之后,后台服务器可以先确定目标直播流对应的预设标准码率,进而可以根据上述平均输入码率和预设标准码率,确定下一周期对目标直播流进行转码时的参考码率,即待设定码率。
在一个实施例中,可以根据目标直播流的视频参数和标准直播流的视频参数,计算目标直播流对应的预设标准码率。
其中,标准直播流可以是符合指定的分辨率、帧率,且用户终端在播放时,播放流畅不存在明显的画质损失的,具备最低码率的直播流;视频参数至少包括分辨率、帧率和码率。
在实施中,技术人员可以在后台服务器设置标准直播流的分辨率、帧率和码率等视频参数。进而,后台服务器可以根据目标直播流的视频参数和标准直播流的视频参数,计算目标直播流对应的预设标准码率。举例而言,标准直播流可以选取分辨率为“1920×1080”,帧率为“30fps”,码率为“2M/s”,而假设目标直播流的分辨率为W×H(W代表宽度,H代表高度),帧率为F,故而可以按照如下线性算法计算预设标准码率M line:M line=(W×H×F)/(1920×1080×30)×2×1024×1024;或者可以按照如下对数算法计算预设标准码率M log:M log=log(W×H×F)/log(1920×1080×30)×2×1024×1024。当然,预设标准码率的计算方式还可以采用其它算法,本实施例对此不作限定。 例如,后台服务器可以同时使用多种算法计算预设标准码率,并同时使用多个计算结果,后续关联处将会对使用方式进行具体说明。这样,将目标直播流和标准直播流的视频参数进行比对,可以较为直观准确地计算出目标直播流的预设标准码率。
在一个实施例中,在计算预设标准码率时,可以同时考虑直播流的画面波动程度,相应的处理可以如下:根据目标直播流的视频参数和标准直播流的视频参数,以及目标直播流的画面波动程度,计算目标直播流对应的预设标准码率。
在实施中,后台服务器在计算目标直播流对应的预设标准码率时,可以先判断目标直播流的画面波动程度,具体可以根据目标直播流的直播类型进行判断,例如主持类直播的画面波动程度较弱,运动类直播的画面波动程度较强;或者,后台服务器可以在对目标直播流转码的过程中,定期根据已转码完成的多帧最新直播画面,检测目标直播流的画面波动程度。之后,后台服务器可以根据目标直播流的视频参数和标准直播流的视频参数,以及目标直播流的画面波动程度,计算目标直播流对应的预设标准码率。具体的,可以在计算公式中引入画面波动系数S,画面波动程度越高,则画面波动系数S越大,画面波动程度越低,则画面波动系数S越小,故而,M line和M log的计算公式可以分别如下:
M line=(W×H×F)/(1920×1080×30)×2×1024×1024×S
M log=log(W×H×F)/log(1920×1080×30)×2×1024×1024×S
这样,在计算预设标准码率时引入画面波动系数S,可以更加准确地区分不同画面波动程度的直播流,使得预设标准码率更符合直播流的真实码率需求。
在一个实施例中,检测到的目标直播流的平均输入码率可以包括总平均输入码率和当前周期内的周期平均输入码率,相应的,步骤102的处理可以如下:如果周期平均输入码率小于目标直播流对应的预设标准码率,则设置待设定码率为预设标准码率和总平均输入码率的最大值;如果周期平均输入码率不 小于目标直播流对应的预设标准码率,则设置待设定码率为周期平均输入码率和预设码率控制系数的乘积。
在实施中,后台服务器在检测到目标直播流的总平均输入码率和当前周期内的周期平均输入码率后,可以先判断周期平均输入码率和目标直播流对应的预设标准码率之间的大小关系。如果周期平均输入码率小于预设标准码率,表明当前周期内目标直播流的输入码率过低,后台服务器则可以选取预设标准码率和总平均输入码率两者的最大值作为待设定码率。而如果周期平均输入码率不小于目标直播流对应的预设标准码率,表示当前周期内目标直播流的输入码率正常,后台服务器则可以将周期平均输入码率与预设码率控制系数相乘,然后将二者的乘积作为待设定码率。值得一提的是,上述预设码率控制系统可以是技术人员参考历史直播流的转码过程总结出的经验数据,具体数值可以由人工配置。这样,将周期平均输入码率与预设标准码率进行比较,一方面可以保证转码码率尽可能保持与直播流的输入码率一致,以避免直播流码率浪费或者画质损失;另一方面可以避免因直播流的输入码率较低,而导致转码后直播流码率大幅波动的情况,从而可以保证用户终端上直播的播放流畅性。需要说明的是,如果后台服务器采用多种算法计算得到多个预设标准码率,则在本步骤中,可以选取多个预设标准码率中的最小值,然后使用该最小值进行待设定码率的设置处理。
在一个实施例中,受网络连接、数据缓存等因素的影响,可以在转码初期和转码中期采用不同的方式设定转码码率,相应的,步骤103的处理可以如下:如果目标直播流的转码时长大于预设时长,则根据平均输入码率和目标直播流对应的预设标准码率,确定待设定码率;如果目标直播流的转码时长不大于预设时长,则根据平均输入码率和目标直播流对应的预设标准码率,以及目标直播流在当前周期内的输入码率峰值,确定待设定码率。
在实施中,后台服务器在接收目标直播流,并对目标直播流进行转码的初期,受设备间网络建连和直播流信息缓存等处理的影响,目标直播流的输入 码率可能出现过低的情况。故而,后台服务器可以根据目标直播流的转码时长,采用不同的方式来确定待设定码率。具体的,如果目标直播流的转码时长不大于预设时长,后台服务器可以先判断平均输入码率与目标直播流对应的预设标准码率之间的大小,如果平均码率大于预设标准码率,则可以设置待设定码率为平均输入码率,否则可以设置待设定码率为预设标准码率和目标直播流在当前周期内的输入码率峰值两者间的最大值。需要说明的是,如果后台服务器采用多种算法计算得到多个预设标准码率,则在上述处理过程中,可以选取多个预设标准码率中的最大值,然后使用该最大值进行待设定码率的设置处理。而如果目标直播流的转码时长大于预设时长,后台服务器则可以根据平均输入码率和目标直播流对应的预设标准码率,确定待设定码率,具体的处理过程可以参照上文。这样,对转码初始阶段采用不同的码率设置方式,可以有效降低网络建连、数据缓存等因素对直播流输入码率的影响,避免了转码码率过低而导致直播流码率浪费或画质损失的情况。
在一个实施例中,在设定直播流转码码率时,还可以兼顾当前的全网带宽负载状态,相应的,步骤102的处理可以如下:根据平均输入码率和目标直播流对应的预设标准码率,以及当前时刻的全网带宽负载状态,确定待设定码率。
在实施中,后台服务器在对目标直播流进行转码的过程中,可以获取当前时刻的全网带宽负载状态,获取方式可以是判断当前时刻是否属于预设的流量高峰期或流量低谷期,或者可以实时检测网络链路的数据传输状态来确定全网带宽负载状态。之后,后台服务器可以根据平均输入码率和目标直播流对应的预设标准码率,以及当前时刻的全网带宽负载状态,确定待设定码率。具体来讲,在确定待设定码率时,全网带宽负载状态可以以带宽负载系数的形式体现,即可以在原公式的基础上乘以带宽负载系数。其中,全网带宽负载越高,则可以适当降低直播流的转码码率,以确保直播流传输时的流畅性,故选择较小的带宽负载系数,反之,全网带宽负载越低,则可以适当提高直播流的转码 码率,以提高直播流的画面质量和播放效果,故选择较大的带宽负载系数。
步骤103,基于待设定码率对目标直播流进行转码。
在实施中,后台服务器确定了待设定码率之后,可以以待设定码率为参考,调节主线程中编码器的编码码率,从而可以继续对目标直播流进行转码处理。
在一个实施例中,仅当待设定码率与已设定码率的差值过大时,才重新设定转码码率,相应的,步骤103的处理可以如下:如果待设定码率与目标直播流的已设定码率的差值大于预设阈值,则按照待设定码率对目标直播流进行转码,否则,按照已设定码率对目标直播流进行转码。
在实施中,后台服务器确定了待设定码率之后,可以比较待设定码率与目标直播流的已设定码率的大小。如果二者的差值大于预设阈值,后台服务器则可以将目标直播流的转码码率更新为该待设定码率,然后按照待设定码率对目标直播流进行转码;如果二者的差值未大于预设阈值,后台服务器则可以保持目标直播流当前的转码码率不变,即继续按照上述已设定码率对目标直播流进行转码。这样,在重新设定转码码率前,对待设定码率和已设定码率进行大小比对,可以避免后台服务器在小范围内频繁变更转码码率,从而可以节省后台服务器的设备处理资源。
在一个实施例中,可以将待设定码率与转码输出码率进行比较,当二者差值过大时,才重新设定转码码率,相应的,步骤103的处理可以如下:统计目标直播流在当前周期内的周期平均输出码率;如果待设定码率与周期平均输出码率的差值大于预设阈值,则按照待设定码率对目标直播流进行转码,否则,按照已设定码率对目标直播流进行转码。
在实施中,在对目标直播流进行转码的过程中,后台服务器可以周期性地检测目标直播流的周期平均输出码率,例如可以每隔10秒检测一次。与检测平均输入码率相似,后台服务器可以每隔一定时间统计一次转码输出的数据包的数据量,进而计算当前周期内的周期平均输出码率。值得一提的是,后台服 务器可以在转码进程中专门设置检测线程,用于执行上述目标直播流的周期平均输出码率的检测处理。之后,后台服务器可以比较待设定码率与周期平均码率的大小。如果二者的差值大于预设阈值,后台服务器则可以将目标直播流的转码码率更新为该待设定码率,然后按照待设定码率对目标直播流进行转码;如果二者的差值未大于预设阈值,后台服务器则可以保持目标直播流当前的转码码率不变,即继续按照上述已设定码率对目标直播流进行转码。这样,相比于已设定码率,周期平均输出码率更能准确地反映出目标直播流的真实转码码率,将待设定码率和周期平均输出码率进行比对,既可以避免后台服务器在小范围内频繁变更转码码率,以节省后台服务器的设备处理资源,还可以避免因已设定码率取值较低,导致需要反复变更转码码率的情况。
在一个实施例中,可以按照直播流的输入码率波动情况,对平均输入码率的检测周期进行调节,相应的处理可以如下:记录目标直播流的实时输入码率;若实时输入码率的波动幅度大于预设波动阈值,则根据波动幅度缩短平均输入码率的检测周期,否则延长平均输入码率的检测周期。
在实施中,后台服务器在对目标直播流进行转码的过程中,可以记录目标直播流的实时输入码率,具体可以根据单位时长内输入编码器的数据量来计算实时输入码率,单位时长可以选取1秒或者更短时长。接下来,后台服务器可以根据记录内容计算实时输入码率的波动幅度,如果波动幅度大于预设波动阈值,则可以根据波动幅度缩短平均输入码率的检测周期;而如果波动幅度不大于预设波动阈值,则可以延长平均输入码率的检测周期。具体而言,可以以波动系数的形式来表征波动幅度,并通过将平均输入码率的检测周期与波动系数相乘的方式,对检测周期进行变更。如波动幅度较高时,波动系数大于1,且取值较大;而波动幅度较低时,波动系数小于1,且取值较小。这样,根据直播流实时输入码率的波动情况,适应性地变更输入码率的检测周期,可以提高平均输入码率的检测准确性,从而使得对于转码码率的控制更加合理精确。
本申请实施例中,在对目标直播流进行转码的过程中,周期性检测目标 直播流的平均输入码率;根据平均输入码率和目标直播流对应的预设标准码率,确定待设定码率;基于待设定码率对目标直播流进行转码。这样,在对直播流进行转码时,以直播流的输入码率和预设标准码率为基准,定期调节转码码率,可以最大限度地保证转码码率与输入码率基本一致,避免因转码码率过高或过低而出现画质损失或直播卡顿的情况,从而可以提高直播服务的质量。
基于相同的技术构思,本申请实施例还提供了一种控制视频转码码率的装置,如图2所示,所述装置包括:
输入检测模块201,用于在对目标直播流进行转码的过程中,周期性检测所述目标直播流的平均输入码率;
码率计算模块202,用于根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
实时转码模块203,用于基于所述待设定码率对所述目标直播流进行转码。
在一个实施例中,所述码率计算模块202,具体用于:
如果所述目标直播流的转码时长大于预设时长,则根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
如果所述目标直播流的转码时长不大于预设时长,则根据所述平均输入码率和所述目标直播流对应的预设标准码率,以及所述目标直播流在当前周期内的输入码率峰值,确定待设定码率。
在一个实施例中,所述平均输入码率包括总平均输入码率和当前周期内的周期平均输入码率;
所述码率计算模块202,具体用于:
如果所述周期平均输入码率小于所述目标直播流对应的预设标准码率,则设置待设定码率为所述预设标准码率和所述总平均输入码率的最大值;
如果所述周期平均输入码率不小于所述目标直播流对应的预设标准码率,则设置待设定码率为所述周期平均输入码率和预设码率控制系数的乘积。
图3是本申请实施例提供的后台服务器的结构示意图。该后台服务器300 可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器322(例如,一个或一个以上处理器)和存储器332,一个或一个以上存储应用程序342或数据344的存储介质330(例如一个或一个以上海量存储设备)。其中,存储器332和存储介质330可以是短暂存储或持久存储。存储在存储介质330的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对后台服务器300中的一系列指令操作。在本实施例中,中央处理器322可以设置为与存储介质330通信,在后台服务器300上执行存储介质330中的一系列指令操作。
后台服务器300还可以包括一个或一个以上电源329,一个或一个以上有线或无线网络接口350,一个或一个以上输入输出接口358,一个或一个以上键盘356,和/或,一个或一个以上操作系统341,例如Windows Server,Mac OS X,Unix,Linux,FreeBSD等等。
后台服务器300可以包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行上述控制视频转码码率的指令。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的部分实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (15)

  1. 一种控制视频转码码率的方法,包括:
    在对目标直播流进行转码的过程中,周期性检测所述目标直播流的平均输入码率;
    根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
    基于所述待设定码率对所述目标直播流进行转码。
  2. 根据权利要求1所述的方法,其中,所述周期性检测所述目标直播流的平均输入码率,包括:
    当接收到所述目标直播流的数据包时,将所述数据包存入全局队列;
    周期性根据所述全局队列中已存储数据的数据量,确定所述目标直播流的平均输入码率
  3. 根据权利要求1所述的方法,其中,所述方法还包括:
    根据所述目标直播流的视频参数和标准直播流的视频参数,计算所述目标直播流对应的预设标准码率,其中,所述视频参数至少包括分辨率、帧率和码率。
  4. 根据权利要求3所述的方法,其中,所述根据所述目标直播流的视频参数和标准直播流的视频参数,计算所述目标直播流对应的预设标准码率,包括:
    根据所述目标直播流的视频参数和标准直播流的视频参数,以及所述目标直播流的画面波动程度,计算所述目标直播流对应的预设标准码率。
  5. 根据权利要求1所述的方法,其中,所述根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率,包括:
    如果所述目标直播流的转码时长大于预设时长,则根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
    如果所述目标直播流的转码时长不大于预设时长,则根据所述平均输入码率和所述目标直播流对应的预设标准码率,以及所述目标直播流在当前周期内 的输入码率峰值,确定待设定码率。
  6. 根据权利要求1或5所述的方法,其中,所述平均输入码率包括总平均输入码率和当前周期内的周期平均输入码率;
    所述根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率,包括:
    如果所述周期平均输入码率小于所述目标直播流对应的预设标准码率,则设置待设定码率为所述预设标准码率和所述总平均输入码率的最大值;
    如果所述周期平均输入码率不小于所述目标直播流对应的预设标准码率,则设置待设定码率为所述周期平均输入码率和预设码率控制系数的乘积。
  7. 根据权利要求1所述的方法,其中,所述根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率,包括:
    根据所述平均输入码率和所述目标直播流对应的预设标准码率,以及当前时刻的全网带宽负载状态,确定待设定码率。
  8. 根据权利要求1所述的方法,其中,所述基于所述待设定码率对所述目标直播流进行转码,包括:
    如果所述待设定码率与所述目标直播流的已设定码率的差值大于预设阈值,则按照所述待设定码率对所述目标直播流进行转码,否则,按照所述已设定码率对所述目标直播流进行转码。
  9. 根据权利要求1所述的方法,其中,所述基于所述待设定码率对所述目标直播流进行转码,包括:
    统计所述目标直播流在当前周期内的周期平均输出码率;
    如果所述待设定码率与所述周期平均输出码率的差值大于预设阈值,则按照所述待设定码率对所述目标直播流进行转码,否则,按照所述已设定码率对所述目标直播流进行转码。
  10. 根据权利要求1所述的方法,其中,所述方法还包括:
    记录所述目标直播流的实时输入码率;
    若所述实时输入码率的波动幅度大于预设波动阈值,则根据所述波动幅度缩短所述平均输入码率的检测周期,否则延长所述平均输入码率的检测周期。
  11. 一种控制视频转码码率的装置,包括:
    输入检测模块,用于在对目标直播流进行转码的过程中,周期性检测所述目标直播流的平均输入码率;
    码率计算模块,用于根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
    实时转码模块,用于基于所述待设定码率对所述目标直播流进行转码。
  12. 根据权利要求11所述的装置,其中,所述码率计算模块,具体用于:
    如果所述目标直播流的转码时长大于预设时长,则根据所述平均输入码率和所述目标直播流对应的预设标准码率,确定待设定码率;
    如果所述目标直播流的转码时长不大于预设时长,则根据所述平均输入码率和所述目标直播流对应的预设标准码率,以及所述目标直播流在当前周期内的输入码率峰值,确定待设定码率。
  13. 根据权利要求11或12所述的装置,其中,所述平均输入码率包括总平均输入码率和当前周期内的周期平均输入码率;
    所述码率计算模块,具体用于:
    如果所述周期平均输入码率小于所述目标直播流对应的预设标准码率,则设置待设定码率为所述预设标准码率和所述总平均输入码率的最大值;
    如果所述周期平均输入码率不小于所述目标直播流对应的预设标准码率,则设置待设定码率为所述周期平均输入码率和预设码率控制系数的乘积。
  14. 一种后台服务器,所述后台服务器包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1至10任一所述的控制视频转码码率的方法。
  15. 一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至 少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1至10任一所述的控制视频转码码率的方法。
PCT/CN2020/074966 2019-11-08 2020-02-12 一种控制视频转码码率的方法和装置 WO2021088263A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20719917.5A EP3840390A4 (en) 2019-11-08 2020-02-12 METHOD AND DEVICE FOR CONTROLLING THE VIDEO TRANSCODING CODE RATE
US16/863,799 US20210168418A1 (en) 2019-11-08 2020-04-30 Method and device for controlling video transcoding code rate

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911088745.7 2019-11-08
CN201911088745.7A CN110913245A (zh) 2019-11-08 2019-11-08 一种控制视频转码码率的方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/863,799 Continuation US20210168418A1 (en) 2019-11-08 2020-04-30 Method and device for controlling video transcoding code rate

Publications (1)

Publication Number Publication Date
WO2021088263A1 true WO2021088263A1 (zh) 2021-05-14

Family

ID=69816994

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/074966 WO2021088263A1 (zh) 2019-11-08 2020-02-12 一种控制视频转码码率的方法和装置

Country Status (4)

Country Link
US (1) US20210168418A1 (zh)
EP (1) EP3840390A4 (zh)
CN (1) CN110913245A (zh)
WO (1) WO2021088263A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586433B (zh) * 2020-06-05 2021-09-21 广州繁星互娱信息科技有限公司 码率调整方法、装置、设备及存储介质
CN111866533B (zh) * 2020-07-13 2022-03-08 网宿科技股份有限公司 一种直播转码方法及装置
CN111901631B (zh) * 2020-07-30 2023-02-17 有半岛(北京)信息科技有限公司 一种直播视频的转码方法、装置、服务器和存储介质
CN112616053B (zh) * 2020-11-30 2023-09-05 北京达佳互联信息技术有限公司 直播视频的转码方法、装置及电子设备
CN113676754B (zh) * 2021-08-18 2023-08-29 上海哔哩哔哩科技有限公司 直播视频转码方法及装置
CN114025190B (zh) * 2021-11-03 2023-06-20 北京达佳互联信息技术有限公司 多码率调度方法和多码率调度装置
CN116132717A (zh) * 2021-11-12 2023-05-16 中兴通讯股份有限公司 入向码流码率获取方法、收流处理方法、电子设备、介质
CN114339311B (zh) * 2021-12-09 2022-10-11 北京邮电大学 一种视频云转码及分发联合决策方法及系统
CN115665485B (zh) * 2022-12-26 2023-04-28 杭州星犀科技有限公司 视频画面优化方法及装置、存储介质和视频终端

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013123259A (ja) * 2013-02-08 2013-06-20 Mitsubishi Electric Corp 映像ストリームの伝送方法
CN104363463A (zh) * 2014-11-10 2015-02-18 能力天空科技(北京)有限公司 一种视频处理方法、装置及系统
CN107659819A (zh) * 2017-10-30 2018-02-02 网宿科技股份有限公司 一种视频转码的方法和装置
CN109788316A (zh) * 2019-02-27 2019-05-21 腾讯科技(深圳)有限公司 码率控制、视频转码方法与装置、计算机设备及存储介质
CN109963169A (zh) * 2019-04-04 2019-07-02 网宿科技股份有限公司 一种转码方法、服务器和计算机可读存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5076083B2 (ja) * 2008-02-25 2012-11-21 株式会社メガチップス トランスコーダ
CN107920041B (zh) * 2016-10-08 2020-08-25 北京小唱科技有限公司 一种直播视频数据编码比特率的调整方法和装置
CN108712422B (zh) * 2018-05-18 2021-05-25 网宿科技股份有限公司 一种创建转码任务的方法和装置
CN108966008B (zh) * 2018-08-02 2020-08-11 腾讯科技(深圳)有限公司 直播视频回放方法及装置
CN109413416A (zh) * 2018-12-14 2019-03-01 网宿科技股份有限公司 一种直播视频流转码质量监控的方法及装置
CN110267100B (zh) * 2019-07-12 2022-01-25 北京达佳互联信息技术有限公司 Flv视频的码率切换方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013123259A (ja) * 2013-02-08 2013-06-20 Mitsubishi Electric Corp 映像ストリームの伝送方法
CN104363463A (zh) * 2014-11-10 2015-02-18 能力天空科技(北京)有限公司 一种视频处理方法、装置及系统
CN107659819A (zh) * 2017-10-30 2018-02-02 网宿科技股份有限公司 一种视频转码的方法和装置
CN109788316A (zh) * 2019-02-27 2019-05-21 腾讯科技(深圳)有限公司 码率控制、视频转码方法与装置、计算机设备及存储介质
CN109963169A (zh) * 2019-04-04 2019-07-02 网宿科技股份有限公司 一种转码方法、服务器和计算机可读存储介质

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
EP3840390A1 (en) 2021-06-23
US20210168418A1 (en) 2021-06-03
CN110913245A (zh) 2020-03-24
EP3840390A4 (en) 2021-06-23

Similar Documents

Publication Publication Date Title
WO2021088263A1 (zh) 一种控制视频转码码率的方法和装置
US10587664B2 (en) Systems and methods for controlling the encoding of a segmented media stream using segment transmit times
EP2745523B1 (en) Dynamic bit rate adaptation over bandwidth varying connection
US11765400B2 (en) Systems and methods for selecting an initial streaming bitrate
CN111135569A (zh) 云游戏处理方法、装置、存储介质与电子设备
US20130304934A1 (en) Methods and systems for controlling quality of a media session
US20140181266A1 (en) System, streaming media optimizer and methods for use therewith
US9826260B2 (en) Video encoding device and video encoding method
US20110299589A1 (en) Rate control in video communication via virtual transmission buffer
CN104394486A (zh) 一种基于云桌面的视频流处理方法及装置
TW201026064A (en) Method for audio and video control response and bandwidth adaptation based on network streaming application and server using the same
US20170142029A1 (en) Method for data rate adaption in online media services, electronic device, and non-transitory computer-readable storage medium
KR101569510B1 (ko) 적응적 실시간 트랜스코딩 방법 및 이를 위한 스트리밍 서버
MX2013004481A (es) Ajuste de configuracion de codigo dinamico.
CN107295395A (zh) 码率自适应调节方法、装置及电子设备
CN107659819B (zh) 一种视频转码的方法和装置
WO2017084277A1 (zh) 在线媒体服务的码流自适应方法及系统
CN110099250B (zh) 一种监控视频质量判断方法及播放控制装置
WO2014066975A1 (en) Methods and systems for controlling quality of a media session
CN117599412A (zh) 一种基于云游戏业务质量检测的自适应渲染系统及方法
EP4068779A1 (en) Cross-validation of video encoding
US8612552B2 (en) Method for buffering streaming data and a terminal device
KR101514128B1 (ko) 콘텐츠 제공 장치 및 방법
WO2021013558A1 (en) A media client with adaptive buffer size and the related method
US11736552B1 (en) Sender based adaptive bit rate control

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2020719917

Country of ref document: EP

Effective date: 20200429

NENP Non-entry into the national phase

Ref country code: DE