WO2020143423A1 - 视频流码率分配方法、装置及计算机可读存储介质 - Google Patents

视频流码率分配方法、装置及计算机可读存储介质 Download PDF

Info

Publication number
WO2020143423A1
WO2020143423A1 PCT/CN2019/126713 CN2019126713W WO2020143423A1 WO 2020143423 A1 WO2020143423 A1 WO 2020143423A1 CN 2019126713 W CN2019126713 W CN 2019126713W WO 2020143423 A1 WO2020143423 A1 WO 2020143423A1
Authority
WO
WIPO (PCT)
Prior art keywords
resolution
bit rate
video stream
sent
remaining
Prior art date
Application number
PCT/CN2019/126713
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 广州视源电子科技股份有限公司
Publication of WO2020143423A1 publication Critical patent/WO2020143423A1/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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/437Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities

Definitions

  • the present disclosure relates to the field of communication technologies, for example, to a video stream bit rate allocation method, device, and computer-readable storage medium.
  • the source video When the source video is multicast, it is often necessary to support sending multiple video streams, such as sending video streams with resolutions of 180p, 360p, 720p, and 1080p.
  • the inventor found that there are at least the following problems when implementing the related technology: if the default source sends all the supported multi-channel videos to the server, the receiver then obtains the corresponding video stream from the server according to the demand, which on the one hand will increase the coding burden on the source On the other hand, each video stream is sent from the source to the server.
  • the process of sending from the source will occupy the upstream bandwidth of the source, and the process of receiving from the server will occupy the downstream bandwidth of the server. Unwanted video streams will occupy the source and the The bandwidth on the server side is a waste of bandwidth resources.
  • the present disclosure provides a video stream code rate distribution method, device, and computer-readable storage medium, which is beneficial to reduce the coding burden on the video source side and avoid waste of upstream bandwidth resources.
  • the present disclosure provides a video stream bit rate allocation method, including:
  • the subscription information includes the resolution of the subscribed video stream
  • a video stream bit rate allocation method provided by an embodiment of the present disclosure can determine the resolution of the current video stream that needs to be sent to the receiving end according to the subscription request of the receiving end and the upstream bit rate of the sending end, and allocate an appropriate bit rate, Therefore, it is only necessary to generate the video stream to be sent with the required resolution, and send the video stream according to the determined bit rate, which meets the subscription needs of the receiving end, and solves the need to generate and send video streams of all resolutions in the related technology, thereby reducing Video source coding burden to avoid waste of upstream bandwidth resources.
  • the receiving end includes several, and the determining the resolution of the video stream to be sent includes:
  • the present disclosure allocates reasonable video streams to different receiving ends according to the subscription requests of different receiving ends and the upstream bit rate of the sending end, so as to avoid the waste of the upstream bit rate while meeting the subscription requirements of the receiving end.
  • the determining the resolutions of the video streams to be sent and the code rate of the video streams to be sent allocated to each resolution include:
  • the subscription information and the uplink bit rate determine the number of resolutions of the video stream to be sent and allocate to each The bit rate of the video stream to be sent at one resolution.
  • This disclosure considers the minimum bit rate, target bit rate, and highest bit rate required for video streams of different resolutions to determine the resolutions of several video streams to be sent and the bit rates of the video streams to be sent assigned to each resolution ,
  • the lowest bit rate of the video stream to be sent can be guaranteed, and the reasonable allocation of the bit rate of the video stream to be sent can also be achieved according to the lowest bit rate, the target bit rate and the highest bit rate.
  • the determining of several resolutions of the video stream to be sent includes:
  • the resolution requirement of each video stream subscribed by the receiving end and to meet the minimum bit rate of the to-be-sent video stream of several resolutions to be determined, determine what the uplink bit rate can support Several resolutions are used as the resolution of the video stream to be sent.
  • the resolution that can be supported by determining the uplink code rate as the resolution of the video stream to be sent includes:
  • the resolution of each subscription video stream in the subscription information determines the minimum bit rate of the resolution of the selected subscription video stream Whether it is not greater than the current remaining bit rate of the uplink bit rate, if yes, the selected resolution of the requested subscription is determined as the subscription layer to be sent, if not, the value is lower than the selected subscribed video stream resolution
  • the resolution of the video stream to be transmitted is taken as the resolution of the video stream to be transmitted, where the lowest code rate satisfies the current remaining code rate of the uplink code rate.
  • bit rate of the video stream to be sent allocated to each resolution includes:
  • the remaining code rate is the first remaining code rate
  • the target bit rate of the to-be-sent video stream is satisfied, and the first remaining bit rate is assigned to each of the to-be-sent video streams in a preset order Bit rate
  • the second remaining bit rate is greater than zero, the highest bit rate of the to-be-sent video stream is met, and the second remaining bit rate is sequentially given to the to-be-sent of each resolution in a preset order Video stream allocation code rate.
  • the determining the resolution that can be supported by the uplink code rate as the resolution of the video stream to be sent and assigning the lowest code rate to each of the resolutions to be sent includes:
  • step S311 Determine whether each resolution in the subscription information has been selected in order from the lowest resolution to the highest resolution. If yes, skip to step S316; if not, skip to step S312;
  • step S313 Determine whether the current resolution has been assigned the lowest bit rate, if yes, return to step S311, if not, go to step S314;
  • step S314. Determine whether the remaining bit rate of the uplink bit rate is not less than the lowest bit rate of the current resolution. If yes, determine that the current resolution is the resolution of the video stream to be sent and assign it to all Said the lowest bit rate corresponding to the current resolution, and at the same time updating the remaining bit rate of the uplink bit rate, and skip to step S311; if not, go to step S315;
  • step S315. Determine whether there is a next resolution with a resolution lower than the current resolution among the resolutions that support sending. If yes, the next layer resolution will be selected as the current resolution and step S313 is executed, if not, Then go to step S316;
  • the target bit rate that satisfies the resolution to be sent is a target, and the first remaining bit rate is sequentially given to each of the videos to be sent in order of resolution from high to low
  • the stream resolution allocation code rate includes:
  • step S341 Determine whether all the determined resolutions of the to-be-sent video streams have been selected in order from the highest resolution to the lowest resolution. If yes, go to step S334; if no, go to step S342;
  • the highest bit rate that satisfies the resolution of the video stream to be sent is targeted, and the second remaining bit rate is sequentially given to each
  • the resolution allocation code rate of the sent video stream includes:
  • step S361 Determine whether all the determined resolutions of the to-be-sent video stream have been selected in order from high resolution to low resolution. If yes, go to step S364; if no, go to step S362;
  • S362 Select the resolution of the next currently-to-be-sent video stream from the determined resolutions of all the to-be-sent video streams in the order of resolution from high to low;
  • S363. Determine whether the sum of the current remaining code rate of the first remaining code rate and the currently assigned code rate of the resolution of the current video stream to be sent is greater than the maximum code rate of the current resolution to be sent, If yes, allocate a part of the second remaining bit rate to the current resolution to be sent, so that the bit rate allocated to the resolution of the current video stream to be sent reaches the maximum bit rate, and update the The second remaining code rate, the current remaining code rate, and go to step S361; if not, all the current remaining code rates of the second remaining code rate are allocated to the current resolution to be sent;
  • the receiving subscription information from the receiving end includes:
  • sending the to-be-sent video stream to the receiving end includes:
  • an embodiment of the present disclosure also provides a video stream bit rate allocation device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor executing When the computer program is described, the above-mentioned video stream bit rate allocation method is realized.
  • an embodiment of the present disclosure also provides a computer-readable storage medium, the computer-readable storage medium includes a stored computer program, wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute The video stream bit rate allocation method as described above.
  • FIG. 1 is a flowchart of a video stream bit rate allocation method in an embodiment of the present disclosure
  • FIG. 2 is a sequence diagram of a video stream bit rate allocation method in an embodiment of the present disclosure
  • step S3 is a flowchart of step S3 in the embodiment of the present disclosure.
  • step S31 is a flowchart of actual application of step S31 in an embodiment of the present disclosure
  • step S33 is a flowchart of actual application of step S33 in the embodiment of the present disclosure.
  • FIG. 6 is a flowchart of actual application of step S35 in the embodiment of the present disclosure.
  • the video stream bit rate allocation method provided in Embodiment 1 of the present disclosure includes the following steps:
  • a video stream bit rate allocation method provided by an embodiment of the present disclosure can determine the resolution of the video stream currently required to be sent to the receiving end according to the subscription request of the receiving end and the upstream bit rate of the sending end, and allocate an appropriate bit rate, Therefore, it is only necessary to generate a video stream to be sent at the required resolution and to send the video stream according to the determined bit rate, which meets the subscription needs of the receiving end, and solves the need to generate and send video streams of all resolutions in related technologies, thereby reducing Video source coding burden to avoid waste of upstream bandwidth resources.
  • the upload bit rate here uploads the bit rate of the video stream.
  • the uplink code rate is a code rate obtained by combining packet loss, delay, jitter, etc., and can basically reflect the uplink bandwidth status.
  • the receiving end includes several, then:
  • the subscription request statistical information in step S1 includes statistical resolution information of the subscription requested by several receiving ends;
  • the determination of the resolution of the video stream to be sent in step S3 includes: determining several resolutions of the video stream to be sent and the bit rate of the video stream to be sent assigned to each resolution.
  • the present disclosure can allocate reasonable video streams to different receiving ends according to the receiving end's subscription request and the sending end's own upstream bit rate, thereby avoiding waste of the upstream bit rate while satisfying the receiving end's subscription requirements.
  • the resolution requested by each of the receiving ends is the highest resolution video stream that each receiving end can receive; in addition, each of the receiving ends requests The resolution of the subscription can also be the resolution that the user needs to accept.
  • This embodiment is applicable to a sending end, which is a source of a video stream, and is also referred to as a video source end in this disclosure. It can be understood by those skilled in the art that the resolutions of the video streams that the sending end and the receiving end can select to generate/request are not arbitrary values, but several fixed values, such as video streams with resolutions of 180p, 360p, 720p, and 1080p.
  • the working environment of this embodiment further includes a server.
  • the server counts the resolution information of the requested subscription from the receiving end, counts the received resolution information, and collects the statistical information Send to the sending end to obtain the corresponding resolution video stream;
  • Step S1 includes:
  • Step S4 is: sending the video stream to be sent to the server; after receiving the video stream of the resolution to be sent, the server, according to the resolution information of the subscription requested by the receiving end, the The video stream with the resolution to be transmitted is forwarded to the corresponding receiving end.
  • the subscription request statistics information of the server to the sending end generally counts the highest resolution video stream information expected by different receiving ends.
  • the bandwidth of the receiving end 1 can support the video stream of the source 180P, so it requests the server to subscribe to the video of the sending end 180P
  • the bandwidth of the receiving end 2 can support the video stream of the source 360P, so it requests the server to subscribe to the source 360P Video streaming.
  • the server will count the subscription request information of receiver 1 and receiver 2, and then subscribe 180P and 360P video streams to the sender.
  • the sender will give each resolution according to the server's subscription request statistics and its own upstream bit rate.
  • the video stream is assigned a bit rate.
  • both 180P and 360P will be assigned a bit rate to send 180P and 360P video streams to the server.
  • the server will forward 180P from the sending end to the receiving end 1, and forward the 360P Give the receiver 2 a video stream with a reasonable bit rate for different receivers. If the upstream bit rate is not sufficient to support the simultaneous sending of 180P and 360P video streams, the 180P video stream is sent to the server, so that the server sends the 180P video stream to the receiving end 1 and the receiving end 2.
  • step S3 includes: according to the subscription information and the uplink bit rate, and based on the minimum bit rate determination, target bit rate, and maximum bit rate required to send a video stream of each resolution, determine Several resolutions of the sent video stream and the bit rate of the video stream to be sent assigned to each resolution.
  • each video stream of the said resolution is sent, for example, the video streams with resolutions of 180p, 360p, 720p and 1080p are preset with corresponding minimum code rate, target code rate and maximum code rate; the minimum code Rate is the minimum code rate required for the resolution to be sent, the target code rate is the desired ideal code rate for the resolution to be sent, and the maximum code rate is the resolution for the resolution to be sent The maximum bit rate that can be received.
  • the determination of several resolutions of the video stream to be sent in step S3 includes:
  • step S31 determining the resolution that the uplink code rate can support as the resolution of the video stream to be sent includes:
  • the resolution of each subscription video stream in the subscription information determines the minimum bit rate of the resolution of the selected subscription video stream Whether it is not greater than the current remaining bit rate of the uplink bit rate, if yes, the selected resolution of the requested subscription is determined as the subscription layer to be sent, if not, the value is lower than the selected subscribed video stream resolution
  • the resolution of the video stream to be transmitted is taken as the resolution of the video stream to be transmitted, where the lowest code rate satisfies the current remaining code rate of the uplink code rate.
  • the code rate of the video stream to be sent allocated to each resolution in step S3 includes:
  • S33 Obtain the uplink code rate and assign the lowest code rate to each of the resolutions to be sent.
  • the remaining code rate is the first remaining code rate
  • the target code rate that satisfies the resolution to be sent is the target, and the first remaining code rate is sequentially given to each of the to-be-sent in accordance with a preset order
  • the preset order in steps S34 and S36 is the order from high resolution to low resolution.
  • the steps S31 and S32 include:
  • step S311 Determine whether each resolution in the subscription request statistical information has been selected in order from low resolution to high resolution. If yes, skip to step S316. If no, skip to step S312;
  • step S311 is started, and the resolution in the subscription request statistical information has never been selected by default;
  • step S313 Determine whether the current resolution has been assigned the lowest bit rate, if yes, return to step S311, if not, go to step S314;
  • step S314. Determine whether the remaining code rate of the uplink code rate is not less than the minimum code rate of the current resolution, and if so, determine that the current resolution is the resolution to be sent and assign it to the current The lowest bit rate corresponding to the resolution, and simultaneously update the remaining bit rate of the uplink bit rate, and jump to step S311; if not, go to step S315;
  • the resolution supported for sending in step S315 of the present disclosure is the resolution that can be sent in the video source end/transmit end, such as commonly provided resolutions of 180p, 360p, 720p, and 1080p. This step can ensure that when the resolution cannot be sent, the lower-layer resolution video stream can be selected to meet the subscription requirements.
  • the main purpose of the step S31 is to confirm which resolutions the uplink bit rate can support subscription on the basis of satisfying the subscription requirement of the resolution to be sent as much as possible.
  • the principle of satisfying the subscription requirement of the resolution to be sent as far as possible is: first consider the resolution requested by the receiving end, if the uplink bit rate cannot support the resolution requested by the receiving end, then Priority is given to the layer with a lower resolution than the resolution requested by the receiving end. If it is still unsatisfactory, continue to consider the layer with a lower resolution until the lower resolution layer has been assigned a code rate or There are no lower levels.
  • the code rate is assigned to the lower layer on the basis of meeting the subscription requirements as much as possible.
  • the step S34 includes:
  • step S341 Determine whether all the determined resolutions to be sent have been selected in order from high resolution to low resolution. If yes, go to step S334; if no, go to step S342;
  • S342 In accordance with the order of resolution from high to low, select the next currently to be sent resolution from all the determined resolutions to be sent;
  • the step S36 includes:
  • step S361 Determine whether all the determined resolutions to be sent have been selected in order from the highest resolution to the lowest resolution. If yes, go to step S364; if no, go to step S362;
  • constexpr uint32_tminBitrate[4] ⁇ 30000,200000,600000,800000 ⁇ ;//The lowest bit rate
  • constexpr uint32_t targetBitrate[4] ⁇ 100000,300000,1000000,2000000 ⁇ ;//target bit rate
  • constexpr uint32_t maxBitrate[4] ⁇ 200000,700000,1800000,3000000 ⁇ ;//The highest bit rate
  • the resolution supported by simulcast represents the determined resolution of the video stream to be sent.
  • bitrateAllocate[180] 30k
  • the code rate is not allocated to the 720P subscription layer.
  • it is determined that there is a subscription layer lowerLayers [180,360] lower than 720P.
  • bitrateAllocate[360] true
  • the remaining code rate bitrate 0k.
  • this embodiment can be applied to a multi-person video conference scenario.
  • a participant acts as a sender when sending its own scene video, while other participants act relatively as receivers. Both the receiver and the sender are connected to the same server.
  • the receiving end can send the subscription request to the receiving end through the server, and the receiving end determines which resolution video stream the scene video needs to generate and the allocated code rate according to the subscription request and its own upstream code rate.
  • An embodiment 2 of the present disclosure also provides a video stream bit rate allocation device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor executing the The computer program implements the video stream bit rate allocation method described above.
  • the video stream bit rate allocation device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor.
  • the processor executes the computer program, the steps in the above embodiments of the video stream bit rate allocation method are implemented, for example, the steps shown in FIG. 1.
  • the processor executes the computer program, the functions of the modules/units in the foregoing device embodiments are realized.
  • the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory and executed by the processor to complete the present disclosure.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the video stream code rate distribution device, for example:
  • a statistical information receiving unit configured to receive statistical information of a subscription request; wherein, the statistical information of the subscription request includes information about the resolution of the subscription requested by several receiving ends counted by the server;
  • Uplink bit rate acquisition unit used to acquire the current uplink bit rate
  • a resolution determination unit to be sent used to determine the resolution to be sent and the code rate allocated to each resolution to be sent based on the subscription request statistical information and the uplink bit rate;
  • the sending unit is configured to send the video stream of the resolution to be sent with the code rate allocated to the server.
  • the video stream bit rate distribution device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the video stream bit rate allocation device may include, but is not limited to, a processor and a memory.
  • a processor and a memory.
  • the video stream bit rate distribution apparatus may further include input and output devices, network access devices, buses, and the like.
  • the so-called processor can be a central processing unit (Central Processing Unit, CPU), it can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), ready-made Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the processor is the control center of the video stream bit rate distribution device, and uses various interfaces and lines to connect the entire video stream code Various parts of the rate distribution device.
  • the memory may be used to store the computer program and/or module, and the processor implements the video by running or executing the computer program and/or module stored in the memory and calling the data stored in the memory Various functions of the stream code rate distribution device.
  • the memory may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, application programs required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store Data created according to the use of mobile phones (such as audio data, phonebooks, etc.), etc.
  • the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media, Card, SMC), and a secure digital (SD) card.
  • non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media, Card, SMC), and a secure digital (SD) card.
  • Flash card Flash
  • at least one disk storage device such as compact flash, Secure Digital (SD) card, or other volatile solid-state storage devices.
  • the module/unit integrated in the video stream bit rate distribution device can be stored in a computer-readable storage medium.
  • the present disclosure implements all or part of the processes in the methods of the above embodiments, and can also be completed by a computer program instructing related hardware.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, etc.
  • the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals and software distribution media, etc.
  • the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in jurisdictions. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media Does not include electrical carrier signals and telecommunications signals.
  • Embodiment 3 of the present disclosure also provides a computer-readable storage medium including a stored computer program, wherein the computer is controlled when the computer program is running
  • the device where the readable storage medium is located executes the video stream bit rate allocation method as described above.
  • a video stream bit rate distribution method, device, and computer-readable storage medium provided by an embodiment of the present disclosure, by receiving subscription request statistical information; wherein, the subscription request statistical information includes a number of receivers counted by the server Request information about the resolution of the subscription; obtain the current uplink bit rate; determine the resolution to be sent and the bit rate assigned to each of the resolutions to be sent based on the subscription request statistics and the uplink bit rate Sending the video stream of the resolution to be sent with the code rate to the server.
  • the present disclosure can allocate reasonable video streams to different receiving ends according to the receiving end's subscription request and the sending end's own upstream bit rate, thereby avoiding waste of the upstream bit rate while satisfying the receiving end's subscription requirements.

Landscapes

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

Abstract

本公开提供了一种视频流码率分配方法、装置及计算机可读存储介质,其中方法包括:接收来自接收端的订阅信息;其中,所述订阅信息包括订阅视频流的分辨率;获取当前的上行码率;根据所述订阅信息与所述上行码率,确定待发送视频流的分辨率和对应的码率;根据已确定的码率,将所述待发送视频流发送给所述接收端。本公开有利于降低视频源端编码负担,且避免上行带宽资源的浪费。

Description

视频流码率分配方法、装置及计算机可读存储介质
本申请要求在2019年1月10日提交中国专利局、申请号为201910025892.3的中国专利申请的优先权,以上申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及通信技术领域,例如涉及一种视频流码率分配方法、装置及计算机可读存储介质。
背景技术
源端视频在进行多播时,往往需要支持发送多路的视频流,例如发送分辨率为180p、360p、720p和1080p的视频流。发明人在实施相关技术时发现至少存在如下问题:如果默认源端将支持的多路视频全部发送至服务器,接收端再根据需求从服务器获取对应的视频流,这样一方面会增加源端的编码负担,另一方面每路视频流从源端发送到服务器端接收,源端发送的过程会占用源端的上行带宽,服务器接收的过程会占用服务器端的下行带宽,非需求的视频流会占用源端和服务器端的带宽,造成带宽资源的浪费。
发明内容
本公开提供一种视频流码率分配方法、装置及计算机可读存储介质,有利于降低视频源端编码负担,且避免上行带宽资源的浪费。
本公开提供一种视频流码率分配方法,包括:
接收来自接收端的订阅信息;其中,所述订阅信息包括订阅视频流的分辨率;
获取当前的上行码率;
根据所述订阅信息与所述上行码率,确定待发送视频流的分辨率和对应的码率;
根据已确定的码率,将所述待发送视频流发送给所述接收端。
本公开实施例提供的一种视频流码率分配方法,能够根据接收端的订阅请求和发送端自身的上行码率,确定当前需要发送到接收端的视频流的分辨率,以及分配适应的码率,从而只需生成所需分辨率的待发送视频流,以及根据确定的码率发送视频流,满足接收端的订阅需求的同时,解决了相关技术中需要生成以及发送所有分辨率的视频流,从而降低视频源端编码负担,避免上行带宽资源的浪费。
在一实施方式中,所述接收端包括若干个,则所述确定待发送视频流的分辨率包括:
确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率。
本公开根据不同接收端的订阅请求和发送端自身的上行码率,为不同的接收端分配合理的视频流,从而在满足接收端的订阅需求的同时,避免造成上行码率的浪费。
在一实施方式中,所述确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率包括:
根据所述订阅信息和所述上行码率,并基于发送每一分辨率的视频流所需的最低码率、目标码率和最高码率,确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率。
本公开考虑了不同分辨率的视频流所需的最低码率、目标码率和最高码率,来确定若干待发送视频流的分辨率和分配给每一分辨率的待发送视频流的码率,可以实现保证待发送视频流的最低码率,同时也可以根据最低码率、目标码率和最高码率来实现待发送视频流的码率的合理分配。
在一实施方式中,所述确定待发送视频流的若干分辨率包括:
根据每一所述接收端订阅的视频流的分辨率的需求,并以满足待确定的若干分辨率的所述待发送视频流的最低码率为目标,确定所述上行码率所能够支持的若干分辨率作为所述待发送视频流的分辨率。
在一实施方式中,所述确定所述上行码率所能够支持的分辨率作为所述待发送视频流的分辨率包括:
按照从低到高的顺序,依次选取所述订阅信息中每一订阅视频流的分辨率,并对于每一选取的订阅视频流的分辨率,判断选取的订阅视频流的分辨率的最低码率是否不大于所述上行码率当前剩余的码率,若是,则将所述选取的请求订阅的分辨率确定为待发送订阅层,若否,则在数值低于选取的订阅视频流分辨率的分辨率中,将最低码率满足所述上行码率当前剩余的码率的最高分辨率作为所述待发送视频流的分辨率。
在一实施方式中,所述分配给每一分辨率的待发送视频流的码率包括:
给所述每一分辨率的待发送视频流分配最低码率;
获取所述上行码率给每一分辨率的待发送视频流分配最低码率后剩余的码率为所述第一剩余码率;
若所述第一剩余码率大于零,则以满足所述待发送视频流的目标码率为目标,按照预设顺序将所述第一剩余码率依次给每一所述待发送视频流分配码率;
获取所述第一剩余码率以满足所述待发送视频流的目标码率为目标进行分配后剩余的码率为第二剩余码率;
若所述第二剩余码率大于零,则以满足所述待发送视频流的最高码率为目标,按照预设顺序将所述第二剩余码率依次给每一分辨率的所述待发送视频流分配码率。
在一实施方式中,所述确定所述上行码率所能够支持的分辨率作为所述待发送视频流的分辨率和给每一所述待发送的分辨率分配最低码率包括:
S311、判断是否已按照分辨率从低到高的顺序依次选取过所述订阅信息中的每一分辨率,若是,则跳转至步骤S316,若否,则转至步骤S312;
S312、按照分辨率从低到高的顺序,从所述订阅信息中选取出下一订阅视频流的分辨率作为当前分辨率;
S313、判断所述当前分辨率是否已分配最低码率,若是,则返回步骤S311,若否,则转至步骤S314;
S314、判断所述上行码率所剩余的码率是否不小于所述当前分辨率的最低码率,若是,则确定所述当前分辨率为所述待发送视频流的分辨率,并分配给所述当前分辨率对应的最低码率,同时更新所述上行码率所剩余的码率,并跳转至步骤S311;若否,则转至步骤S315;
S315、判断支持发送的分辨率中是否存在分辨率低于所述当前分辨率的下一分辨率,若是,则将选取所述下一层分辨率作为当前分辨率并执行步骤S313,若否,则转至步骤S316;
S316、结束所述确定所述上行码率所能够支持的分辨率作为所述待发送的分辨率,并给每一所述待发送视频流的分辨率分配最低码率。
在一实施方式中,所述以满足所述待发送的分辨率的目标码率为目标,按照分辨率从高到低的顺序将所述第一剩余码率依次给每一所述待发送视频流的分辨率分配码率包括:
S341、判断是否已按照分辨率从高到低的顺序依次选取过所有确定的所述待发送视频流的分辨率,若是,则转至步骤S334,若否,则转至步骤S342;
S342、按照分辨率从高到低的顺序,从所有确定的所述待发送视频流的分辨率中选取出下一当前待发送的分辨率;
S343、判断所述第一剩余码率当前剩余的码率和所述当前待发送的分辨率的已分配到的最低码率的和是否大于所述当前待发送的分辨率的目标码率,若是,则将所述第一剩余码率中部分码率分配给所述当前待发送的分辨率,以使所述当前待发送的分辨率分配的码率达到目标码率,更新所述第一剩余码率当前剩余的码率,并转至步骤S341;若否,则将所述第一剩余码率当前剩余的码率的全部分配给所述当前待发送视频流的分辨率,更新所述第一剩余码率当前剩余的码率,并转至步骤S334;
S334、结束所述以满足所述待发送视频流的分辨率的目标码率为目标,按照分辨率从高到低的顺序将所述第一剩余码率依次给每一所述待发送的分辨率分配码率。
在一实施方式中,所述以满足所述待发送视频流的分辨率的最高码率为目标,按照分辨率从高到低的顺序将所述第二剩余码率依次给每一所述待发送视频流的分辨率分配码率包括:
S361、判断是否已按照分辨率从高到低的顺序依次选取过所有确定的所述待发送视频流的分辨率,若是,则转至步骤S364,若否,则转至步骤S362;
S362、按照分辨率从高到低的顺序,从确定的所有所述待发送视频流的分辨率中选取出下一当前待发送视频流的分辨率;
S363、判断所述第一剩余码率当前剩余的码率和所述当前待发送视频流的分辨率的当前分配到的码率的和是否大于所述当前待发送的分辨率的最大码率,若是,则将所述第二剩余码率中部分码率分配给所述当前待发送的分辨率,以使所述当前待发送视频流的分辨率分配的码率达到最大码率,更新所述第二剩余码率当前剩余的码率,并转至步骤S361;若否,则将所述第二剩余码率当前剩余的码率的全部分配给所述当前待发送的分辨率;
S364、结束所述以满足所述待发送视频流的分辨率的最高码率为目标,按照分辨率从高到低的顺序将所述第二剩余码率依次给每一所述待发送的分辨率分配码率。
在一实施方式中,所述接收来自接收端订阅信息包括:
接收由服务器汇总并转发的若干接收端的订阅信息;
则将所述待发送视频流发送给所述接收端包括:
将所述待发送视频流发送给所述服务器,以使所述服务器将每一分辨率的待发送视频流发送给对应的接收端。
相应的,本公开实施例还提供一种视频流码率分配装置,包括处理器、存储器以及存储在所述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现如上所述的视频流码率分配方法。
相应的,本公开实施例还提供一种计算机可读存储介质,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行如上所述的视频流码率分配方法。
附图说明
图1是本公开实施例中的视频流码率分配方法的流程图;
图2是本公开实施例中的视频流码率分配方法的时序图;
图3是本公开实施例中的步骤S3的流程图;
图4是本公开实施例中的步骤S31的实际应用流程图;
图5是本公开实施例中的步骤S33的实际应用流程图;
图6是本公开实施例中的步骤S35的实际应用流程图。
具体实施方式
下面结合附图和实施例,对本公开的具体实施方式作详细描述。以下实施例用于说明本公开,但不用来限制本公开的范围。
如图1所示,本公开实施例1提供的视频流码率分配方法,本实施例包括下述步骤:
S1、接收来自接收端的订阅信息;其中,所述订阅信息包括订阅视频流的分辨率;
S2、获取当前的上行码率;
S3、根据所述订阅信息与所述上行码率,确定待发送视频流的分辨率和对应的码率;
S4、根据已确定的码率,将所述待发送视频流发送给所述接收端。
本公开实施例提供的一种视频流码率分配方法,能够根据接收端的订阅请求和发送端自身的上行码率,确定当前需要发送到接收端的视频流的分辨率,以及分配适应的码率,从而只需生成所需分辨率的待发送视频流,以及根据确定的码率发送视频流,满足接收端的订阅需求的同时,解决了相关技术中需要生成以及发送所有分辨率的视频流,从而降低视频源端编码负担,避免上行带宽资源的浪费。
可以理解的是,此处上行码率上传视频流的码率。在一实施方式中,上行码率为结合丢包、延时、抖动等进行预估而获得的码率,基本能够反映上行的带宽状况。
在一实施方式中,所述接收端包括若干个,则:
步骤S1中所述订阅请求统计信息包括统计的若干接收端所请求订阅的分辨率的信息;
步骤S3中所述确定待发送视频流的分辨率包括:确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率。
本公开能够根据接收端的订阅请求和发送端自身的上行码率,为不同的接收端分配合理的视频流,从而在满足接收端的订阅需求的同时,避免造成上行码率的浪费。
在本公开实施例中,每一所述接收端所请求订阅的分辨率为每一所述接收端所能接收的最高分辨率的视频流;除此之外,每一所述接收端所请求订阅的分辨率还可以为用户设置的需要接受的分辨率。
本实施例适用于发送端,该发送端为视频流的来源处,在本公开中也称为视频源端。本领域人员可以理解的是,发送端和接收端可选择生成/请求的视频流的分辨率不是任意值,而是若干固定值,比如分辨率为180p、360p、720p和1080p的视频流。
例如,本实施例的工作环境中还包括服务器,在一实施方式中,由服务器统计来自于接收端的所请求订阅的分辨率的信息,对接收到的分辨率的信息进行统计,并将统计信息发送 至发送端,以获取到对应的分辨率的视频流;则步骤S1包括:
S1、接收由所述服务器发送的订阅请求统计信息,其中,所述订阅请求统计信息包括由服务器统计的若干接收端所请求订阅的分辨率的信息;
则步骤S4为:将所述待发送视频流发送给服务器;当服务器接收到所述待发送的分辨率的视频流后,根据所述接收端所请求订阅的分辨率的信息,将若干所述待发送的分辨率的视频流转发至对应的接收端。
如图2所示,例如,在本公开实施例中,由于服务器向发送端的订阅请求统计信息一般是统计了不同接收端所期望的最高分辨率的视频流信息。例如,接收端1的带宽能够支持源端180P的视频流,于是向服务器请求订阅发送端180P的视频,接收端2的带宽能够支持源端360P的视频流,于是向服务器请求订阅源端360P的视频流。服务器会统计接收方1和接收方2的订阅请求信息,然后向发送端订阅180P和360P的视频流,发送端根据服务器的订阅请求统计信息以及自身的上行码率的情况,给每一分辨率的视频流分配码率,如果上行码率充足,则会给180P和360P都分配码率,从而给服务器发送180P和360P的视频流,服务器会把发送端的180P转发给接收端1,把360P转发给接收端2,以为不同接收端分别合理码率的视频流。假如上行码率并不足以支持同时发送180P和360P的视频流,则向服务器发送180P的视频流,从而给服务器发送180P的视频流给接收端1和接收端2。
在一实施方式中,步骤S3包括:根据所述订阅信息和所述上行码率,并基于发送每一分辨率的视频流所需的最低码率确定、目标码率和最高码率,确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率。
其中,发送每一所述分辨率的视频流,如分辨率为180p、360p、720p和1080p的视频流,均预设有对应的最低码率、目标码率和最高码率;所述最低码率为所述待发送的分辨率所需要的最低码率,所述目标码率为所述待发送的分辨率所期望的理想码率,所述最大码率为所述待发送的分辨率所能接收的最大码率。
步骤S3中确定待发送视频流的若干分辨率包括:
S31、根据每一所述接收端订阅的视频流的分辨率的需求,并以满足待确定的若干分辨率的所述待发送视频流的最低码率为目标,确定所述上行码率所能够支持的若干分辨率作为所述待发送视频流的分辨率。
步骤S31中确定所述上行码率所能够支持的分辨率作为所述待发送视频流的分辨率包括:
按照从低到高的顺序,依次选取所述订阅信息中每一订阅视频流的分辨率,并对于每一选取的订阅视频流的分辨率,判断选取的订阅视频流的分辨率的最低码率是否不大于所述上行码率当前剩余的码率,若是,则将所述选取的请求订阅的分辨率确定为待发送订阅层,若 否,则在数值低于选取的订阅视频流分辨率的分辨率中,将最低码率满足所述上行码率当前剩余的码率的最高分辨率作为所述待发送视频流的分辨率。
步骤S3中分配给每一分辨率的待发送视频流的码率包括:
S32、给每一所述待发送的分辨率分配最低码率;
S33、获取所述上行码率给每一所述待发送的分辨率分配最低码率后剩余的码率为所述第一剩余码率;
S34、若所述第一剩余码率大于零,则以满足所述待发送的分辨率的目标码率为目标,按照预设顺序将所述第一剩余码率依次给每一所述待发送的分辨率分配码率;
S35、获取所述第一剩余码率以满足分辨率的目标码率为目标进行分配后剩余的码率为第二剩余码率;
S36、若所述第二剩余码率大于零,则以满足所述待发送的分辨率的最高码率为目标,按照预设顺序将所述第二剩余码率依次给每一所述待发送的分辨率分配码率。
在一实施方式中,出于保证高分辨率的视频流的质量,所述步骤S34和步骤S36中的预设顺序为分辨率从高到低的顺序。
为了给所述待发送视频流分配合理的最低码率,所述步骤S31和S32包括:
S311、判断是否已按照分辨率从低到高的顺序依次选取过所述订阅请求统计信息中的每一分辨率,若是,则跳转至步骤S316,若否,则转至步骤S312;
需要说明的是,当每次开始步骤S31和S32时,初始从步骤S311开始,且默认从未选取过所述订阅请求统计信息中的分辨率;
S312、按照分辨率从低到高的顺序,从所述订阅请求统计信息中选取出下一请求订阅的分辨率作为当前分辨率;
S313、判断所述当前分辨率是否已分配最低码率,若是,则返回步骤S311,若否,则转至步骤S314;
S314、判断所述上行码率所剩余的码率是否不小于所述当前分辨率的最低码率,若是,则确定所述当前分辨率为所述待发送的分辨率,并分配给所述当前分辨率对应的最低码率,同时更新所述上行码率所剩余的码率,并跳转至步骤S311;若否,则转至步骤S315;
S315、判断是否支持发送的分辨率存在分辨率低于所述当前分辨率的下一分辨率,若是,则将选取所述下一分辨率作为当前分辨率并执行步骤S313,若否,则转至步骤S316;
需要说明的是,本公开的步骤S315中所述的支持发送的分辨率为该视频源端/发送端中能够发送的分辨率,如常见的提供180p、360p、720p和1080p的分辨率。该步骤能保证当分辨率无法发送的时候,能够通过选低层的分辨率的视频流来满足订阅需求。
S316、结束所述确定所述上行码率所能够支持的分辨率作为所述待发送的分辨率,并给每一所述待发送的分辨率分配最低码率。
在本公开实施例中,所述步骤S31的主要目的是在尽可能满足所述待发送的分辨率的订阅需求的基础上,确认所述上行码率能够支持订阅哪些分辨率。其中,尽可能满足所述待发送的分辨率的订阅需求的原则是:首先考虑所述接收端请求订阅的分辨率,如果所述上行码率无法支持所述接收端请求订阅的分辨率,则优先考虑较所述接收端请求订阅的分辨率低一级分辨率的层,如果依然无法满足,则继续考虑更低一级分辨率的层,直到较低分辨率的层已经分配有码率或者没有较低级的层。此外,判断当前上行码率支持哪些分辨率时,从订阅列表的低分辨率开始,判断剩余码率是否大于等于该层的最低码率,如果满足,则给该层分配对应的最低码率,同时更新剩余码率,继续遍历订阅列表。如果不满足,则在尽可能满足订阅需求的基础上给较低的层分配码率。
为了给所述待发送的分辨率分配合理的目标码率,以优先保证高分辨的视频流发出的视频质量,所述步骤S34包括:
S341、判断是否已按照分辨率从高到低的顺序依次选取过所有确定的所述待发送的分辨率,若是,则转至步骤S334,若否,则转至步骤S342;
S342、按照分辨率从高到低的顺序,从所有确定的所述待发送的分辨率中选取出下一当前待发送的分辨率;
S343、判断所述第一剩余码率当前剩余的码率和所述当前待发送的分辨率的当前分配到的码率的和是否大于所述当前待发送的分辨率的目标码率,若是,则将所述第一剩余码率中部分码率分配给所述当前待发送的分辨率,以使所述当前待发送的分辨率分配的码率达到目标码率,更新所述第一剩余码率当前剩余的码率,并转至步骤S341;若否,则将所述第一剩余码率当前剩余的码率的全部分配给所述当前待发送的分辨率,更新所述第一剩余码率当前剩余的码率,并转至步骤S334;
S344、结束所述以满足所述待发送的分辨率的目标码率为目标,按照分辨率从高到低的顺序将所述第一剩余码率依次给每一所述待发送的分辨率分配码率。
为了给所述待发送的分辨率分配合理的最高码率,以优先保证高分辨订阅层发出的视频质量,所述步骤S36包括:
S361、判断是否已按照分辨率从高到低的顺序依次选取过所有确定的所述待发送的分辨率,若是,则转至步骤S364,若否,则转至步骤S362;
S362、按照分辨率从高到低的顺序,从确定的所有所述待发送的分辨率中选取出下一当前待发送的分辨率;
S363、判断所述第一剩余码率当前剩余的码率和所述当前待发送的分辨率的当前分配到的码率的和是否大于所述当前待发送的分辨率的最大码率,若是,则将所述第二剩余码率中部分码率分配给所述当前待发送的分辨率,以使所述当前待发送的分辨率分配的码率达到最大码率,更新所述第二剩余码率当前剩余的码率,并转至步骤S361;若否,则将所述第二剩余码率当前剩余的码率的全部分配给所述当前待发送的分辨率;
S364、结束所述以满足所述待发送的分辨率的最高码率为目标,按照分辨率从高到低的顺序将所述第二剩余码率依次给每一所述待发送的分辨率分配码率。
为更好地理解上述内容,以下述例子进一步说明:参见图4~图6,作为本公开的一个实际应用,假设分辨率包括有:180,360,720,1080;假设每一分辨率的最低码率、目标码率、最高码率设置如下:
//180,360,720,1080
constexpr uint32_t minBitrate[4]={30000,200000,600000,800000};//最低码率
constexpr uint32_t targetBitrate[4]={100000,300000,1000000,2000000};//目标码率
constexpr uint32_t maxBitrate[4]={200000,700000,1800000,3000000};//最高码率
示例1:当服务器向发送端订阅180P的视频流,即subscribeLayers=[180],发送端的上行码率为bitrate=40k。
第一轮:
从低分辨率开始遍历subscribeLayers,取layer=180。因为bitrate>minBitrate[180],所以isAllocated[layer]=true,即分辨率180P有足够的码率分配,分辨率180P确定为待发送的视频流的分辨率,bitrateAllocate[layer]=minBitrate[180]=30k,bitrate=bitrate-minBitrate[180]=10k。继续遍历subscribeLayers,发现遍历完成,返回。其中,subscribeLayers表示订阅请求中的若干分辨率,bitrate表示当前的上行码率。
第二轮:
simulcast支持的分辨率为supportedLayers=[180,360,720],从高分辨率开始遍历supportedLayers,发现只有layer=180时,isAllocated[layer]=true,于是给该层分配码率。由于bitrate+bitrateAllocated=10k+30k=40k,小于targetBitrate[layer]=100k,于是给该层分配40k的码率,剩余码率bitrate=0,直接返回。其中,simulcast支持的分辨率表示所确定的待发送的视频流的分辨率。
第三轮:
bitrate=0,直接返回。
示例2:服务器向发送端订阅180P+720P视频,即subscribeLayers=[180,720],发送端的上 行码率为bitrate=600k。
第一轮:
从低分辨率开始遍历subscribeLayers,首先取layer=180。因为bitrate>minBitrate[180],所以isAllocated[180]=true,bitrateAllocate[180]=30k,bitrate=600k-30k=570k。
为180P分辨率分配最低码率后,继续遍历subscribeLayers,取layer=720。因为bitrate=570k<minBitrate[720]=600k,因此不给720P订阅层分配码率。同时判断存在比720P低的订阅层lowerLayers=[180,360]。
从高往低遍历lowerLayers,取lowerLayer=360,因为bitrate=570>minBitrate[360]=200k,因此给360P分配码率,isAllocated[360]=true,bitrateAllocate[360]=200k,bitrate=570k-200k=370k。返回。
第二轮:
simulcast支持的订阅层为supportedLayers=[180,360,720,1080],从高分辨率开始遍历supportedLayers,1080P订阅层和720P订阅层的isAllocated为false,直接跳过。继续从高分辨率往低分辨率遍历,取layer=360时,发现isAllocated[360]=true,同时,由于bitrateAllocate[360]+bitrate=570k>targetBitrate[360]=300k,因此给360P分配bitrateAllocate[360]=300k,剩余码率bitrate=570k-300k=270k。
继续遍历,取layer=180P时,发现isAllocated[180]=true,由于bitrateAllocate[180]+bitrate=30k+270k=300k>targetBitrate[180]=100k,因此给180P订阅层分配bitrateAllocated[180]=100k,剩余码率bitrate=300k-100k=200k。
继续,发现遍历完成,返回。
第三轮:
重复第二轮的过程,取layer=360P时,发现isAllocated[360]=true,由于bitrateAllocate[360]+bitrate=500k<maxBitrate[360]=700k,因此给360P订阅层分配bitrateAllocate[360]=500k,剩余码率bitrate=0k。
结束,返回。
上述示例所示意的数据和程序语言仅为示例说明,并不对本公开的保护范围进行限制。
一种示例,本实施例可以适用于多人视频会议场景,一参与者在发送自己的场景视频时作为发送端,其它参与者则相对作为接收端,接收端和发送端均连接至同一服务器,通过本实施例,接收端可以将订阅请求通过服务器发送至接收端,接收端根据订阅请求和自身的上行码率情况确定场景视频需要生成哪些分辨率的视频流,以及分配到的码率。
本公开一实施例2还提供一种视频流码率分配装置,包括处理器、存储器以及存储在所 述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现如上所述的视频流码率分配方法。
该实施例的视频流码率分配装置包括:处理器、存储器以及存储在所述存储器中并可在所述处理器上运行的计算机程序。所述处理器执行所述计算机程序时实现上述各个视频流码率分配方法实施例中的步骤,例如图1所示的步骤。或者,所述处理器执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能。
示例性的,所述计算机程序可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器中,并由所述处理器执行,以完成本公开。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在所述视频流码率分配装置中的执行过程,例如:
统计信息接收单元,用于接收订阅请求统计信息;其中,所述订阅请求统计信息包括由服务器统计的若干接收端所请求订阅的分辨率的信息;
上行码率获取单元,用于获取当前的上行码率;
待发送的分辨率确定单元,用于根据所述订阅请求统计信息与所述上行码率,确定待发送的分辨率和分配给每一所述待发送的分辨率的码率;
发送单元,用于将分配有所述码率的所述待发送的分辨率的视频流发送给所述服务器。
所述视频流码率分配装置可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述视频流码率分配装置可包括,但不仅限于,处理器、存储器。本领域技术人员可以理解,上述说明仅仅是视频流码率分配装置的示例,并不构成对视频流码率分配装置的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述视频流码率分配装置还可以包括输入输出设备、网络接入设备、总线等。
所称处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述视频流码率分配装置的控制中心,利用各种接口和线路连接整个视频流码率分配装置的各个部分。
所述存储器可用于存储所述计算机程序和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现所述视频流码率分配装置的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等; 存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
其中,所述视频流码率分配装置集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
此外,为了解决相同的技术问题,本公开实施例3还提供一种计算机可读存储介质,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行如上所述的视频流码率分配方法。
综上,本公开实施例提供的一种视频流码率分配方法、装置及计算机可读存储介质,通过接收订阅请求统计信息;其中,所述订阅请求统计信息包括由服务器统计的若干接收端所请求订阅的分辨率的信息;获取当前的上行码率;根据所述订阅请求统计信息与所述上行码率,确定待发送的分辨率和分配给每一所述待发送的分辨率的码率;将分配有所述码率的所述待发送的分辨率的视频流发送给所述服务器。本公开能够根据接收端的订阅请求和发送端自身的上行码率,为不同的接收端分配合理的视频流,从而在满足接收端的订阅需求的同时,避免造成上行码率的浪费。

Claims (12)

  1. 一种视频流码率分配方法,包括:
    接收来自接收端的订阅信息;其中,所述订阅信息包括订阅视频流的分辨率;
    获取当前的上行码率;
    根据所述订阅信息与所述上行码率,确定待发送视频流的分辨率和对应的码率;
    根据已确定的码率,将所述待发送视频流发送给所述接收端。
  2. 如权利要求1所述的一种视频流码率分配方法,其中,所述接收端包括若干个,则所述确定待发送视频流的分辨率包括:
    确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率。
  3. 如权利要求2所述的视频流码率分配方法,其中,所述确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率包括:
    根据所述订阅信息和所述上行码率,并基于发送每一分辨率的视频流所需的最低码率确定、目标码率和最高码率,确定待发送视频流的若干分辨率和分配给每一分辨率的待发送视频流的码率。
  4. 如权利要求3所述的视频流码率分配方法,其中,所述确定待发送视频流的若干分辨率包括:
    根据每一所述接收端订阅的视频流的分辨率的需求,并以满足待确定的若干分辨率的所述待发送视频流的最低码率为目标,确定所述上行码率所能够支持的若干分辨率作为所述待发送视频流的分辨率。
  5. 如权利要求4所述的视频流码率分配方法,其中,所述确定所述上行码率所能够支持的分辨率作为所述待发送视频流的分辨率包括:
    按照从低到高的顺序,依次选取所述订阅信息中每一订阅视频流的分辨率,并
    对于每一选取的订阅视频流的分辨率,判断选取的订阅视频流的分辨率的最低码率是否不大于所述上行码率当前剩余的码率,若是,则将所述选取的请求订阅的分辨率确定为待发送订阅层,若否,则在数值低于选取的订阅视频流分辨率的分辨率中,将最低码率满足所述上行码率当前剩余的码率的最高分辨率作为所述待发送视频流的分辨率。
  6. 如权利要求4所述的视频流码率分配方法,其中,所述分配给每一分辨率的待发送视频流的码率包括:
    给所述每一分辨率的待发送视频流分配最低码率;
    获取所述上行码率给每一分辨率的待发送视频流分配最低码率后剩余的码率为所述第一剩余码率;
    若所述第一剩余码率大于零,则以满足所述待发送视频流的目标码率为目标,按照预设顺序将所述第一剩余码率依次给每一所述待发送视频流分配码率;
    获取所述第一剩余码率以满足所述待发送视频流的目标码率为目标进行分配后剩余的码率为第二剩余码率;
    若所述第二剩余码率大于零,则以满足所述待发送视频流的最高码率为目标,按照预设顺序将所述第二剩余码率依次给每一分辨率的所述待发送视频流分配码率。
  7. 如权利要求6所述的视频流码率分配方法,其中,所述确定所述上行码率所能够支持的分辨率作为所述待发送视频流的分辨率和给每一所述待发送的分辨率分配最低码率包括:
    S311、判断是否已按照分辨率从低到高的顺序依次选取过所述订阅信息中的每一分辨率,若是,则跳转至步骤S316,若否,则转至步骤S312;
    S312、按照分辨率从低到高的顺序,从所述订阅信息中选取出下一订阅视频流的分辨率作为当前分辨率;
    S313、判断所述当前分辨率是否已分配最低码率,若是,则返回步骤S311,若否,则转至步骤S314;
    S314、判断所述上行码率所剩余的码率是否不小于所述当前分辨率的最低码率,若是,则确定所述当前分辨率为所述待发送视频流的分辨率,并分配给所述当前分辨率对应的最低码率,同时更新所述上行码率所剩余的码率,并跳转至步骤S311;若否,则转至步骤S315;
    S315、判断支持发送的分辨率中是否存在分辨率低于所述当前分辨率的下一分辨率,若是,则将选取所述下一层分辨率作为当前分辨率并执行步骤S313,若否,则转至步骤S316;
    S316、结束所述确定所述上行码率所能够支持的分辨率作为所述待发送的分辨率,并给每一所述待发送视频流的分辨率分配最低码率。
  8. 如权利要求6所述的视频流码率分配方法,其中,所述以满足所述待发送的分辨率的目标码率为目标,按照分辨率从高到低的顺序将所述第一剩余码率依次给每一所述待发送视频流的分辨率分配码率包括:
    S341、判断是否已按照分辨率从高到低的顺序依次选取过所有确定的所述待发送视频流的分辨率,若是,则转至步骤S334,若否,则转至步骤S342;
    S342、按照分辨率从高到低的顺序,从所有确定的所述待发送视频流的分辨率中选取出下一当前待发送的分辨率;
    S343、判断所述第一剩余码率当前剩余的码率和所述当前待发送的分辨率的已分配到的最低码率的和是否大于所述当前待发送的分辨率的目标码率,若是,则将所述第一剩余码率中部分码率分配给所述当前待发送的分辨率,以使所述当前待发送的分辨率分配的码率达到 目标码率,更新所述第一剩余码率当前剩余的码率,并转至步骤S341;若否,则将所述第一剩余码率当前剩余的码率的全部分配给所述当前待发送视频流的分辨率,更新所述第一剩余码率当前剩余的码率,并转至步骤S334;
    S334、结束所述以满足所述待发送视频流的分辨率的目标码率为目标,按照分辨率从高到低的顺序将所述第一剩余码率依次给每一所述待发送的分辨率分配码率。
  9. 如权利要求6所述的视频流码率分配方法,其中,所述以满足所述待发送视频流的分辨率的最高码率为目标,按照分辨率从高到低的顺序将所述第二剩余码率依次给每一所述待发送视频流的分辨率分配码率包括:
    S361、判断是否已按照分辨率从高到低的顺序依次选取过所有确定的所述待发送视频流的分辨率,若是,则转至步骤S364,若否,则转至步骤S362;
    S362、按照分辨率从高到低的顺序,从确定的所有所述待发送视频流的分辨率中选取出下一当前待发送视频流的分辨率;
    S363、判断所述第一剩余码率当前剩余的码率和所述当前待发送视频流的分辨率的当前分配到的码率的和是否大于所述当前待发送的分辨率的最大码率,若是,则将所述第二剩余码率中部分码率分配给所述当前待发送的分辨率,以使所述当前待发送视频流的分辨率分配的码率达到最大码率,更新所述第二剩余码率当前剩余的码率,并转至步骤S361;若否,则将所述第二剩余码率当前剩余的码率的全部分配给所述当前待发送的分辨率;
    S364、结束所述以满足所述待发送视频流的分辨率的最高码率为目标,按照分辨率从高到低的顺序将所述第二剩余码率依次给每一所述待发送的分辨率分配码率。
  10. 如权利要求1所述的视频流码率分配方法,其中,所述接收来自接收端订阅信息包括:
    接收由服务器汇总并转发的若干接收端的订阅信息;
    则将所述待发送视频流发送给所述接收端包括:
    将所述待发送视频流发送给所述服务器,以使所述服务器将每一分辨率的待发送视频流发送给对应的接收端。
  11. 一种视频流码率分配装置,包括处理器、存储器以及存储在所述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至10中任意一项所述的视频流码率分配方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行如权利要求1至10中任意一项所述的视频流码率分配方法。
PCT/CN2019/126713 2019-01-10 2019-12-19 视频流码率分配方法、装置及计算机可读存储介质 WO2020143423A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910025892.3A CN109819333B (zh) 2019-01-10 2019-01-10 视频流码率分配方法、装置及计算机可读存储介质
CN201910025892.3 2019-01-10

Publications (1)

Publication Number Publication Date
WO2020143423A1 true WO2020143423A1 (zh) 2020-07-16

Family

ID=66603479

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/126713 WO2020143423A1 (zh) 2019-01-10 2019-12-19 视频流码率分配方法、装置及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN109819333B (zh)
WO (1) WO2020143423A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819333B (zh) * 2019-01-10 2021-05-07 广州视源电子科技股份有限公司 视频流码率分配方法、装置及计算机可读存储介质
CN111064960B (zh) * 2019-12-31 2023-06-02 广州市百果园网络科技有限公司 一种视频编码的方法、装置、服务器和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517137A (zh) * 2013-09-30 2014-01-15 广州华多网络科技有限公司 网络视频传输方法和系统、发送/接收端处理方法和装置
CN105025249A (zh) * 2014-04-22 2015-11-04 中国移动通信集团江苏有限公司 视频监控数据传输控制方法、装置及视频监控系统
WO2016000151A1 (zh) * 2014-06-30 2016-01-07 华为技术有限公司 视频分发方法、设备和系统
CN105491461A (zh) * 2014-10-11 2016-04-13 成都鼎桥通信技术有限公司 一种视频传输方法
CN106162233A (zh) * 2016-07-08 2016-11-23 合网络技术(北京)有限公司 码率推荐方法及装置
CN109819333A (zh) * 2019-01-10 2019-05-28 广州视源电子科技股份有限公司 视频流码率分配方法、装置及计算机可读存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100149301A1 (en) * 2008-12-15 2010-06-17 Microsoft Corporation Video Conferencing Subscription Using Multiple Bit Rate Streams
CN102883157B (zh) * 2011-07-12 2015-09-09 浙江大学 视频编码方法和视频编码器
CN103024460B (zh) * 2012-12-11 2015-12-23 广东威创视讯科技股份有限公司 多码流自适应的方法及系统
CN103051982B (zh) * 2012-12-28 2015-09-09 上海华为技术有限公司 一种视频流传输控制方法以及视频流传输控制装置
CN108400956A (zh) * 2017-02-07 2018-08-14 阿里巴巴集团控股有限公司 视频数据流的分配方法、装置和系统
WO2018184189A1 (zh) * 2017-04-07 2018-10-11 天彩电子(深圳)有限公司 码率自适应调节方法及其系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517137A (zh) * 2013-09-30 2014-01-15 广州华多网络科技有限公司 网络视频传输方法和系统、发送/接收端处理方法和装置
CN105025249A (zh) * 2014-04-22 2015-11-04 中国移动通信集团江苏有限公司 视频监控数据传输控制方法、装置及视频监控系统
WO2016000151A1 (zh) * 2014-06-30 2016-01-07 华为技术有限公司 视频分发方法、设备和系统
CN105491461A (zh) * 2014-10-11 2016-04-13 成都鼎桥通信技术有限公司 一种视频传输方法
CN106162233A (zh) * 2016-07-08 2016-11-23 合网络技术(北京)有限公司 码率推荐方法及装置
CN109819333A (zh) * 2019-01-10 2019-05-28 广州视源电子科技股份有限公司 视频流码率分配方法、装置及计算机可读存储介质

Also Published As

Publication number Publication date
CN109819333B (zh) 2021-05-07
CN109819333A (zh) 2019-05-28

Similar Documents

Publication Publication Date Title
US20240007517A1 (en) Situation-dependent dynamic bit rate encoding and distribution of content
US10958697B2 (en) Approach to live multi-camera streaming of events with hand-held cameras
JP5722366B2 (ja) リアルタイムマルチメディアストリーミング帯域幅管理
US8134587B2 (en) Aggregation of video receiving capabilities
CN108881972B (zh) 一种码率分配方法、装置、设备和存储介质
JP6442507B2 (ja) ネットワークのデバイスにより実行される進行中のトラフィックセッションの中でネットワークの利用可能な帯域幅を割り当てる方法、対応するデバイス
US20110310216A1 (en) Combining multiple bit rate and scalable video coding
US7970932B2 (en) View-upload decoupled peer-to-peer video distribution systems and methods
WO2020143423A1 (zh) 视频流码率分配方法、装置及计算机可读存储介质
JP6646264B2 (ja) ネットワークにおける帯域幅の分配のための方法および装置
US9270937B2 (en) Real time stream provisioning infrastructure
US20240031420A1 (en) Content delivery network (cdn) selection using performance metric
US9264662B2 (en) Chat preauthorization
CN111510743A (zh) 转码资源的调度方法、装置、系统、设备和存储介质
CN102957729B (zh) 一种多媒体会议音视频传输方法及设备
WO2020155913A1 (zh) 一种视频传输方法、装置、设备及存储介质
CN113726759A (zh) 一种码率自适应方法、装置、设备及可读存储介质
US10609111B2 (en) Client-driven, ABR flow rate shaping
EP4312417A1 (en) Content delivery network (cdn) selection using performance metric
CN115209189B (zh) 一种视频流传输方法、系统、服务器及存储介质
US9667683B2 (en) Scalable architecture for media mixing
JP5997439B2 (ja) オーディオ、ビデオ、及びコンピュータグラフィックスコンテンツの少なくとも一つをレンダリングするための方法及び入出力デバイス、及び、プリレンダリングされたオーディオ、プリレンダリングされたビデオ、及びプリレンダリングされたコンピュータグラフィックスコンテンツの少なくとも一つを配信するためのサービスを行うデバイス
CN114978935B (zh) 服务质量资源申请方法、设备及存储介质
JP2018082241A (ja) 動画再生装置、動画再生方法及びプログラム
CN113347472A (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: 19908386

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19908386

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.10.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19908386

Country of ref document: EP

Kind code of ref document: A1