WO2021143388A1 - 码率切换方法及设备 - Google Patents

码率切换方法及设备 Download PDF

Info

Publication number
WO2021143388A1
WO2021143388A1 PCT/CN2020/133863 CN2020133863W WO2021143388A1 WO 2021143388 A1 WO2021143388 A1 WO 2021143388A1 CN 2020133863 W CN2020133863 W CN 2020133863W WO 2021143388 A1 WO2021143388 A1 WO 2021143388A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
media
buffer amount
rate
threshold
Prior art date
Application number
PCT/CN2020/133863
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 EP20913592.0A priority Critical patent/EP3968651A4/en
Publication of WO2021143388A1 publication Critical patent/WO2021143388A1/zh
Priority to US17/544,160 priority patent/US20220095020A1/en

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/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2401Monitoring of the client buffer
    • 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/613Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for the control of the source by the destination
    • 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/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/23439Processing 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 for generating different versions
    • 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/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • 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
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
    • 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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/637Control signals issued by the client directed to the server or network components
    • H04N21/6373Control signals issued by the client directed to the server or network components for rate control, e.g. request to the server to modify its transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Definitions

  • the present disclosure relates to the field of media transmission technology, and in particular to a code rate switching method and device.
  • the embodiments of the present disclosure provide a code rate switching method and device.
  • the technical solutions are as follows:
  • a code rate switching method including: receiving a media frame in a media stream; acquiring playback status information of the media stream; responding to that the playback status information meets a code rate switching condition , Determine the target position according to the position of the media frame in the media stream; based on the target position, send a frame acquisition request to the server, and the frame acquisition request is used to instruct the server to return the The media frame starting from the target position in the media stream.
  • a code rate switching method which includes: sending a media frame in a media stream; acquiring a terminal's playback status information of the media stream; and responding to that the playback status information conforms to the code rate
  • the switching condition is to determine the target position according to the position of the media frame in the media stream; based on the target position and the target bit rate, send the media frame starting from the target position in the media stream to the terminal.
  • a code rate switching device including an acquiring module, a determining module, and a sending module; wherein the acquiring module is used to receive media frames in a media stream and acquire the playback status of the media stream Information; the determining module is used to respond to the playback status information meeting the code rate switching condition, and determine the target position according to the position of the media frame in the media stream; the sending module is used to send to the server based on the target position A frame acquisition request, where the frame acquisition request is used to instruct the server to return a media frame starting at the target position in the media stream based on a target bit rate.
  • a code rate switching device including an acquiring module, a determining module, and a sending module; wherein the acquiring module is used to send a media frame in a media stream, and acquire the terminal’s response to the media stream. Play status information; the determining module is used to determine the target position according to the position of the media frame in the media stream in response to the play status information meeting the code rate switching condition; the sending module is used to determine the target position based on the target position and the target Bit rate, sending a media frame starting at the target position in the media stream to the terminal.
  • an electronic device including: one or more processors; one or more memories for storing executable instructions of the one or more processors; wherein, the One or more processors are configured to execute the instructions to implement the following steps: receiving media frames in a media stream; acquiring playback status information of the media stream; responding to the playback status information meeting the code rate switching condition, Determine the target position according to the position of the media frame in the media stream; send a frame acquisition request to the server based on the target position, and the frame acquisition request is used to instruct the server to return the media based on the target bit rate The media frame starting at the target position in the stream.
  • an electronic device including: one or more processors; one or more memories for storing executable instructions of the one or more processors; wherein, the One or more processors are configured to execute the instructions to implement the following steps: sending media frames in the media stream; acquiring the playback status information of the media stream of the terminal; responding to the playback status information complying with code rate switching The condition is to determine the target position according to the position of the media frame in the media stream; based on the target position and the target bit rate, send the media frame starting from the target position in the media stream to the terminal.
  • a storage medium When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the following steps: receiving media frames in a media stream Obtain the play status information of the media stream; In response to the play status information meets the code rate switching condition, determine the target position according to the position of the media frame in the media stream; Based on the target position, send to the server Sending a frame acquisition request, where the frame acquisition request is used to instruct the server to return a media frame starting at the target position in the media stream based on a target bit rate.
  • a storage medium When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the following steps: sending a media frame in a media stream Acquire the terminal’s play status information of the media stream; in response to the play status information meeting the code rate switching condition, determine the target position according to the position of the media frame in the media stream; based on the target position and The target bit rate is to send the media frame starting at the target position in the media stream to the terminal.
  • a computer program product including one or more instructions, and when the one or more instructions are executed by a processor of an electronic device, the electronic device can execute the following steps: Receiving the media frame in the media stream; acquiring the playback status information of the media stream; in response to the playback status information meeting the code rate switching condition, determine the target location according to the location of the media frame in the media stream; based on The target location sends a frame acquisition request to a server, where the frame acquisition request is used to instruct the server to return a media frame starting at the target location in the media stream based on a target bit rate.
  • a computer program product including one or more instructions, and when the one or more instructions are executed by a processor of an electronic device, the electronic device can execute the following steps: Send the media frame in the media stream; obtain the terminal's playback status information of the media stream; in response to the playback status information meeting the code rate switching condition, determine the target position according to the position of the media frame in the media stream ; Based on the target position and the target bit rate, send the media frame starting at the target position in the media stream to the terminal.
  • Fig. 1 is a schematic diagram showing an implementation environment of a code rate switching method according to an exemplary embodiment
  • Fig. 2 is a flow chart showing a method for rate switching according to an exemplary embodiment
  • Fig. 3 is a flow chart showing a method for rate switching according to an exemplary embodiment
  • Fig. 4 is a flow chart showing a method for rate switching according to an exemplary embodiment
  • Fig. 5 is a schematic diagram showing a code rate switching method according to an exemplary embodiment
  • Fig. 6 is a flow chart showing a method for rate switching according to an exemplary embodiment
  • Fig. 7 is a block diagram showing a code rate switching device according to an exemplary embodiment
  • Fig. 8 is a block diagram showing a code rate switching device according to an exemplary embodiment
  • Fig. 9 is a block diagram showing a terminal according to an exemplary embodiment
  • Fig. 10 is a block diagram showing a server according to an exemplary embodiment.
  • the user information involved in the present disclosure may be information authorized by the user or fully authorized by all parties.
  • Streaming media uses a streaming transmission method, which refers to a technology and process that compresses a series of multimedia resources and sends resource packages through the network, thereby real-time transmission of multimedia resources on the Internet for viewing.
  • This technology makes the resource packages look like flowing water Send; if you don’t use this technology, you must download the entire media file before using it, so that you can only watch multimedia resources offline.
  • Streaming can transmit on-site multimedia resources or multimedia resources pre-stored on the server. When viewer users are watching these multimedia resources, the multimedia resources can be played by specific playback software after being delivered to the viewer terminal of the viewer user.
  • FAS FLV Adaptive Streaming, FLV-based adaptive streaming media transmission standard
  • FAS is a streaming resource transmission standard (or called a resource transmission protocol) proposed in this disclosure. Unlike the traditional fragment-based media transmission method, the FAS standard can achieve frame-level multimedia resource transmission, and the server does not need to wait for a complete The resource package can only be sent to the terminal after the video clip arrives. Instead, the target timestamp is determined after the terminal’s frame acquisition request is parsed. If the target timestamp is less than zero, all media frames that have been buffered starting from the target timestamp will be packaged and sent to The terminal (without fragmentation). After that, if the target timestamp is greater than or equal to zero, or there is a real-time stream in addition to the buffered media frames, the media frames of the multimedia resources are sent to the terminal frame by frame.
  • the target timestamp is determined after the terminal’s frame acquisition request is parsed. If the target timestamp is less than zero, all media frames that have been buffered starting from the target timestamp will be packaged and sent to The terminal (without fragmentation). After that,
  • the target code rate is specified in the frame acquisition request.
  • the code rate to be switched can be adjusted adaptively, and the frame acquisition request corresponding to the code rate to be switched can be resent to achieve The effect of adaptively adjusting the code rate of multimedia resources.
  • the FAS standard can realize frame-level transmission and reduce end-to-end delay. Only when the code rate is switched, a new frame acquisition request needs to be sent, which greatly reduces the number of requests and reduces the communication overhead of the resource transmission process.
  • Live broadcast Multimedia resources are recorded in real time.
  • the host user “pushes” the media stream (referring to push based on the streaming transmission method) to the server through the host terminal.
  • the media stream is "pulled” from the server (referring to pull based on the streaming transmission method) to the audience terminal, and the audience terminal decodes and plays multimedia resources, thereby real-time video playback.
  • On-demand also known as Video On Demand (VOD)
  • multimedia resources are pre-stored on the server, and the server can provide the multimedia resources specified by the audience user according to the requirements of the audience user.
  • the audience terminal sends an on-demand request to the server, and the server queries the on-demand After requesting the designated multimedia resource, the multimedia resource is sent to the audience terminal, that is, the audience user can selectively play a specific multimedia resource.
  • on-demand content can be arbitrarily controlled to play progress, while live broadcast is not.
  • the speed of live broadcast content depends on the real-time live broadcast progress of the host user.
  • Fig. 1 is a schematic diagram showing an implementation environment of a code rate switching method according to an exemplary embodiment.
  • the implementation environment includes: a terminal 101 and a server 102.
  • the terminal 101 is connected to the server 102 through a wired network or a wireless network.
  • the terminal 101 can be a smart phone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio layer 3) player or an MP4 (Moving Picture Experts) player Group Audio Layer IV, moving image experts compress standard audio layer 4) At least one of players and laptop computers.
  • the terminal 101 is a terminal used by a user, and the user can use the terminal 101 to obtain media streams with different bit rates from the server 102.
  • the server 102 may be at least one of one server, multiple servers, a cloud computing platform, and a virtualization center.
  • the server 102 is used to provide background services for applications supporting media transmission.
  • the server 102 and the terminal 101 may work together.
  • the server 102 is used to provide media streams of different code rates to the terminal 101
  • the terminal 101 is used to request media streams of different code rates from the server 102.
  • the terminal 101 may generally refer to one of multiple terminals, or a collection of multiple terminals; the server 102 may generally refer to one of multiple servers, or a collection of multiple servers. It should be understood that if the terminal 101 or the server 102 is a collection of multiple devices, although not shown in FIG. 1, at this time, the foregoing implementation environment also includes other terminals and other servers. This embodiment does not limit the quantity and type of each type of equipment.
  • Fig. 2 is a flow chart showing a method for rate switching according to an exemplary embodiment.
  • the method can be applied to an electronic device.
  • the electronic device is used as an example for description.
  • the method includes the following step.
  • the terminal receives the media frame in the media stream.
  • the terminal obtains the playing state information of the media stream.
  • the terminal determines the target position according to the position of the media frame in the media stream in response to that the playback status information meets the code rate switching condition.
  • the terminal sends a frame acquisition request to the server based on the target location, and the frame acquisition request is used to instruct the server to return based on the target bit rate to transmit the media frame starting at the target location in the media stream.
  • the playback status information includes a first buffer amount
  • the code rate switching condition includes that the first buffer amount is greater than a first buffer amount threshold or the first buffer amount is less than a second buffer amount threshold, wherein the first buffer amount is smaller than the second buffer amount threshold.
  • the buffer amount is the buffer amount that is currently buffered and not played for the media stream, and the second buffer amount threshold is less than the first buffer amount threshold.
  • the playback status information includes at least one of freeze information or frame loss rate during the playback of the media stream;
  • the freeze information includes the number of freezes in the target time period during which the media stream is played, and the last one. At least one of the time of one stall or the duration of the last stall;
  • the code rate switching condition includes any one of the following: the number of stalls is greater than the number threshold or the number of stalls is less than the number threshold; the last stall time is equal to The duration between the current moment is less than the interval threshold and the jam duration is greater than the duration threshold, or the duration between the last jam time and the current moment is greater than the interval threshold and the jam duration is less than the duration threshold; the last jam duration is greater than the duration threshold, Or, the last freeze duration is less than the duration threshold;
  • the frame loss rate is greater than the first frame loss rate threshold;
  • the frame loss rate is less than the second frame loss rate threshold, and the second frame loss rate threshold is less than the first frame loss rate threshold; target time period
  • the sending a frame acquisition request to the server based on the target location includes: in response to the target code rate being not equal to the current code rate, sending a frame acquisition request to the server based on the target location.
  • the response to the playback status information meeting the code rate switching condition, and determining the target location according to the position of the media frame in the media stream includes: responding to the playback status information meeting the code rate switching condition, according to The playback status information and the current bit rate determine the target bit rate; in response to the target bit rate being not equal to the current bit rate, the target position is determined according to the position of the media frame in the media stream.
  • the method further includes: in response to the target code rate being equal to the current code rate, discarding the playback state information.
  • determining the target position according to the position of the media frame in the media stream includes: responding to the target bit rate and the current bit rate If they are not equal, the location of the first media frame in the target media frame group is determined as the target location, and the target media frame group is the media frame group where the media frame is located.
  • determining the target code rate according to the playback status information and the current code rate includes: obtaining a plurality of candidate code rates; according to the relationship between the multiple candidate code rates and the current code rate, the playback The status information and the position of the media frame in the target media frame group in the media stream are used to obtain the second buffer amount corresponding to each candidate bit rate.
  • the target media frame group is the media frame group where the media frame is located;
  • the second buffer amount is the buffer amount that has been buffered but not played for the media stream at the end of the transmission of the target media frame group after the bit rate is switched to the candidate bit rate.
  • each candidate code is obtained according to the relationship between the multiple candidate code rates and the current code rate, the playback status information, and the position of the media frame in the media stream in the target media frame group
  • the second buffer amount corresponding to the rate includes: obtaining, according to the position of the media frame in the media stream in the target media frame group, the buffer increase amount for the media stream at the end of the target media frame group transmission;
  • the cache location corresponding to the relationship between the candidate code rate and the current code rate determines the playback volume of the media stream during the target cache process.
  • the cache location is the cache location when the target media frame group continues to be cached.
  • the target cache process is The process from now to the end of the transmission of the target media frame group based on the multiple candidate code rates; according to the first buffer amount, the buffer increase amount, and the playback amount included in the playback status information, the corresponding information for each candidate bit rate is obtained
  • the second buffer amount, the first buffer amount is the buffer amount that has been buffered and not played for the media stream currently.
  • the determining the amount of playback of the media stream during the target caching process according to the cache location corresponding to the relationship between the multiple candidate code rates and the current code rate includes: according to the multiple candidate code rates and The relationship between the current bit rate determines the cache location when continuing to cache the target media frame group; obtains current network state information; according to the current network state information, the cache location, the length of the target media frame group, and the multiple candidates The bit rate determines the playback volume of the media stream during the target caching process.
  • the buffer location in response to any candidate bit rate being equal to the current bit rate, is the position of the next media frame of the media frame; or, in response to any candidate bit rate being different from the current bit rate. If equal, the buffer location is the location of the first media frame of the target media frame group.
  • the first buffer amount that is currently buffered and not played for the media stream is greater than the first buffer amount threshold; the second buffer amount and the first buffer amount threshold corresponding to each candidate bit rate are either
  • the relationship between the second buffer amount threshold and determining the target code rate from the plurality of candidate code rates includes: responding to that at least one of the second buffer amounts corresponding to the plurality of candidate code rates is larger than the first buffer The amount threshold, the largest candidate code rate in the at least one second buffer amount is determined as the target code rate, and the target code rate is greater than or equal to the current code rate; or, in response to the second code rate corresponding to the plurality of candidate code rates
  • the buffer amount does not include a second buffer amount greater than the first buffer amount threshold, and the current bit rate is determined as the target bit rate, and the target bit rate is greater than or equal to the current bit rate.
  • the first buffer amount that is currently buffered and not played for the media stream is less than the second buffer amount threshold; the second buffer amount and the first buffer amount threshold corresponding to each candidate bit rate are either
  • the relationship between the second buffer amount threshold and the determination of the target code rate from the multiple candidate code rates includes: responding to that at least one of the second buffer amounts corresponding to the multiple candidate code rates is larger than the second buffer The amount threshold, the largest candidate code rate in the at least one second buffer amount is determined as the target code rate, and the target code rate is less than or equal to the current code rate; or, in response to the second code rate corresponding to the plurality of candidate code rates
  • the buffer amount does not include a second buffer amount greater than the second buffer amount threshold, and the candidate code rate corresponding to the largest second buffer amount among the second buffer amounts corresponding to the plurality of candidate code rates is determined as the target code rate,
  • the target bit rate is less than or equal to the current bit rate.
  • Fig. 3 is a flow chart showing a method for rate switching according to an exemplary embodiment. The method is applied to an electronic device.
  • the electronic device is used as an example of a server for description.
  • the method includes The following steps.
  • the server sends media frames in the media stream.
  • the server obtains the playback status information of the media stream of the terminal.
  • the server determines the target position according to the position of the media frame in the media stream in response to that the playback status information meets the code rate switching condition.
  • the server sends a media frame starting at the target position in the media stream to the terminal based on the target position and the target bit rate.
  • the playback status information includes a first buffer amount, the first buffer amount being the current buffer amount for the media stream that has been buffered and not being played; the code rate switching condition includes that the first buffer amount is greater than the first buffer amount.
  • the buffer amount threshold or the first buffer amount is smaller than the second buffer amount threshold, wherein the second buffer amount threshold is smaller than the first buffer amount threshold.
  • the playback status information includes at least one of freeze information or frame loss rate during the playback of the media stream;
  • the freeze information includes the number of freezes in the target time period during which the media stream is played, and the last one. At least one of the time of one stall or the duration of the last stall;
  • the code rate switching condition includes any one of the following: the number of stalls is greater than the number threshold or the number of stalls is less than the number threshold; the last stall time is equal to The duration between the current moment is less than the interval threshold and the jam duration is greater than the duration threshold, or the duration between the last jam time and the current moment is greater than the interval threshold and the jam duration is less than the duration threshold; the last jam duration is greater than the duration threshold, Or, the last freeze duration is less than the duration threshold;
  • the frame loss rate is greater than the first frame loss rate threshold;
  • the frame loss rate is less than the second frame loss rate threshold, and the second frame loss rate threshold is less than the first frame loss rate threshold; target time period
  • the response to the playback status information meeting the code rate switching condition, and determining the target location according to the position of the media frame in the media stream includes: responding to the playback status information meeting the code rate switching condition, according to The playback status information and the current bit rate determine the target bit rate; in response to the target bit rate being not equal to the current bit rate, the target position is determined according to the position of the media frame in the media stream.
  • the method further includes: in response to the target code rate being equal to the current code rate, continuing to transmit the next media frame of the media frame to the terminal based on the current code rate.
  • performing the determining the target position according to the position of the media frame in the media stream includes: responding to the target bit rate and the current bit rate.
  • the code rates are not equal, the location of the first media frame in the target media frame group is determined as the target location, and the target media frame group is the media frame group where the media frame is located.
  • determining the target code rate according to the playback status information and the current code rate includes: obtaining a plurality of candidate code rates; according to the relationship between the multiple candidate code rates and the current code rate, the playback The status information and the position of the media frame in the target media frame group in the media stream are used to obtain the second buffer amount corresponding to each candidate bit rate.
  • the target media frame group is the media frame group where the media frame is located;
  • the second buffer amount is the buffer amount that has been buffered but not played for the media stream at the end of the transmission of the target media frame group after the bit rate is switched to the candidate bit rate.
  • each candidate code is obtained according to the relationship between the multiple candidate code rates and the current code rate, the playback status information, and the position of the media frame in the media stream in the target media frame group
  • the second buffer amount corresponding to the rate includes: obtaining, according to the position of the media frame in the media stream in the target media frame group, the buffer increase amount for the media stream at the end of the target media frame group transmission;
  • the cache location corresponding to the relationship between the candidate code rate and the current code rate determines the playback volume of the media stream during the target cache process.
  • the cache location is the cache location when the target media frame group continues to be cached.
  • the target cache process is The process from now to the end of the transmission of the target media frame group based on the multiple candidate bitrates; according to the first buffer amount, the buffer increase amount, and the playback amount included in the playback status information, obtain the corresponding data for each candidate bitrate
  • the second buffer amount, the first buffer amount is the buffer amount that has been buffered and not played for the media stream currently.
  • the determining the amount of playback of the media stream during the target caching process according to the cache location corresponding to the relationship between the multiple candidate code rates and the current code rate includes: according to the multiple candidate code rates and The relationship between the current bit rate determines the cache location when continuing to cache the target media frame group; obtains current network state information; according to the current network state information, the cache location, the length of the target media frame group, and the multiple candidates The bit rate determines the playback volume of the media stream during the target caching process.
  • the buffer location in response to any candidate bit rate being equal to the current bit rate, is the position of the next media frame of the media frame; or, in response to any candidate bit rate being different from the current bit rate. If equal, the buffer location is the location of the first media frame of the target media frame group.
  • the first buffer amount that is currently buffered and not played for the media stream is greater than the first buffer amount threshold; the second buffer amount and the first buffer amount threshold corresponding to each candidate bit rate are either
  • the relationship between the second buffer amount threshold and determining the target code rate from the plurality of candidate code rates includes: responding to that at least one of the second buffer amounts corresponding to the plurality of candidate code rates is larger than the first buffer The amount threshold, the largest candidate code rate in the at least one second buffer amount is determined as the target code rate, and the target code rate is greater than or equal to the current code rate; or, in response to the second code rate corresponding to the plurality of candidate code rates
  • the buffer amount does not include a second buffer amount greater than the first buffer amount threshold, and the current bit rate is determined as the target bit rate, and the target bit rate is greater than or equal to the current bit rate.
  • the first buffer amount that is currently buffered and not played for the media stream is less than the second buffer amount threshold; the second buffer amount and the first buffer amount threshold corresponding to each candidate bit rate are either
  • the relationship between the second buffer amount threshold and the determination of the target code rate from the multiple candidate code rates includes: responding to that at least one of the second buffer amounts corresponding to the multiple candidate code rates is larger than the second buffer The amount threshold, the largest candidate code rate in the at least one second buffer amount is determined as the target code rate, and the target code rate is less than or equal to the current code rate; or, in response to the second code rate corresponding to the plurality of candidate code rates
  • the buffer amount does not include a second buffer amount greater than the second buffer amount threshold, and the candidate code rate corresponding to the largest second buffer amount among the second buffer amounts corresponding to the plurality of candidate code rates is determined as the target code rate,
  • the target bit rate is less than or equal to the current bit rate.
  • Fig. 4 is a flow chart showing a method for code rate switching according to an exemplary embodiment. Referring to Fig. 4, the method includes the following steps.
  • the server sends the media frame in the media stream.
  • the terminal receives the media frame in the media stream.
  • the terminal may be a terminal used by a user, and the terminal may be connected to a server through a wired network or a wireless network, and the server may be used to provide media streams with multiple bit rates.
  • the media stream may include several media frames, the media frames may be audio frames or image frames, and the several media frames may be obtained by sampling the original media resources.
  • the terminal receives the media stream, it can continuously obtain several media frames in the media stream from the server, and then play the obtained media frames to realize the transmission and playback of the media stream.
  • the terminal may be connected to a server through a wired network or a wireless network, and the server may be used to provide media streams with multiple code rates, and can send media streams to the terminal at multiple code rates.
  • the media stream may include several media frames, the media frames may be audio frames or image frames, and the several media frames may be obtained by sampling the original media resources.
  • the terminal can continuously obtain several media frames in the media stream from the server, and then play the obtained media frames to realize the transmission and playback of the media stream.
  • An application program may be installed on the terminal, and the application program is used to browse media streams.
  • the application program may include at least one of a short video application, a live broadcast application, a video-on-demand application, a social application, or a shopping application.
  • the embodiments of the present disclosure are not correct.
  • the type of application is specifically limited.
  • the media streams involved in the embodiments of the present disclosure include, but are not limited to: at least one of video resources, audio resources, image resources, or text resources.
  • the embodiments of the present disclosure do not specifically limit the types of media streams.
  • the media stream is a live video stream of a network host, or a historical on-demand video pre-stored on the server, or a live audio stream of a radio host, or a historical on-demand audio pre-stored on the server.
  • the user can start the application on the terminal, and the application displays the resource push interface.
  • the resource push interface can be the homepage or function interface of the application.
  • the embodiment of the present disclosure does not specifically limit the type of the resource push interface.
  • the resource pushing interface may include abbreviated information of at least one media stream, and the abbreviated information includes at least one of a title, a brief introduction, a poster, a trailer, or a highlight segment of the media stream.
  • the user can click on the abbreviated information of the media stream of interest.
  • the terminal can jump from the resource push interface to the resource play interface .
  • the terminal obtains the playing state information of the media stream.
  • the terminal receives the media frame in the media stream, and can obtain the playback status information of the media stream, and the playback status information can be used to determine whether the transmission bit rate of the media stream needs to be switched.
  • the media frame transmitted between the server and the terminal may be any media frame in the media stream.
  • the terminal can start to perform the procedure of code rate switching at any point in the transmission of the media stream. This arbitrary time point can be determined according to business needs, so that the terminal can automatically perform the code rate switching step at regular intervals, or a technician can manually control the terminal to perform the code rate switching step. Not limited.
  • the playback status information of the media stream can also be obtained by the server, and the server can acquire the playback status information of the media stream on the terminal during the process of sending the media stream, and then determine whether the terminal needs to provide bitrate Switch steps.
  • the code rate switching method provided by the present disclosure can be applied to a live broadcast scene or an on-demand scene, and the terminal can request a media stream from the server or the host through the server.
  • the terminal may determine the target bit rate according to the playing state information and the current bit rate in response to the playback state information meeting the code rate switching condition.
  • the playback status information can represent the media stream being played by the terminal.
  • the terminal can respond to this, determine and switch the bit rate to a target bit rate that can optimize the playback effect of the media stream. .
  • the code rate is adjusted to the code rate corresponding to the current network bandwidth information.
  • it can also be combined with the terminal’s playback status information to dynamically select The target bit rate with the best playback effect, so as to achieve a compromise between the stutter rate, definition and smoothness of the media stream.
  • the terminal after the terminal determines the target code rate, it can obtain the address information of the media stream corresponding to the target code rate, that is, the target address information. Accordingly, the terminal can trigger the frame acquisition instruction, which can be used to indicate The terminal determines the target address information of the media stream of the target code rate from the address information of the media stream of multiple code rates included in the media description file of the media stream, which provides a basis for subsequent transmission of the media stream according to the target address information.
  • the process of determining the code rate switching and obtaining the target code rate will be described in detail below.
  • the playing state information may include a first buffering amount, and the first buffering amount is a buffering amount of the media stream that has been buffered and not played currently.
  • the code rate switching condition includes that the first buffer amount is greater than a first buffer amount threshold or the first buffer amount is less than a second buffer amount threshold, wherein the second buffer amount threshold is less than the first buffer amount threshold . That is, in these embodiments, the code rate switching conditions include two types, the first is that the first buffer amount is greater than the first buffer amount threshold. The second type is that the first buffer amount is less than the second buffer amount threshold.
  • the terminal can determine the target code rate according to the playback status information and the current code rate. That is, the terminal may respond to the first buffer amount being greater than the first buffer amount threshold, and determine the target bit rate according to the playback status information and the current bit rate; or, the first buffer amount is less than the second buffer amount threshold, according to the playback status information As well as the current bit rate, determine the target bit rate.
  • the terminal after the terminal obtains the media frame of the media stream, it can store the obtained media frame in the buffer, and when the media frame needs to be played, the buffered media frame can be decoded and played in chronological order.
  • the first buffer amount may be measured by the duration of the buffered and unplayed media stream. For example, if the terminal has buffered for 1000 milliseconds (ms) and played for 400ms, the first buffer amount is 600ms.
  • the target code rate is determined according to the playback status information and the current code rate, which can include two situations:
  • Case 1 In response to the first buffer amount being greater than the first buffer amount threshold, the terminal may determine the target bit rate according to the playback status information and the current bit rate, and the target bit rate is greater than or equal to the current bit rate.
  • the first buffer amount is greater than the first buffer amount threshold, indicating that the current terminal has buffered the media stream and has not played the buffer amount to ensure the smooth playback of the media stream.
  • Case 2 In response to the first buffer amount being less than the second buffer amount threshold, the terminal may determine the target bit rate according to the playback status information and the current bit rate, and the target bit rate is less than or equal to the current bit rate.
  • the second cache amount threshold is less than the first cache amount threshold, and the first cache threshold and the second cache threshold may be a preset cache amount threshold, or may be a temporarily set cache amount threshold.
  • the first buffer amount when the first buffer amount is less than the second buffer amount threshold, it may represent that the current terminal has buffered the media stream and has not played the buffer amount that may not guarantee the smooth playback of the media stream, and the lower the bit rate of the media stream, In the same time, the more media streams the terminal can buffer, the more the buffering can make the media stream play more smoothly, so you can consider reducing the download bit rate of the media stream.
  • the first cache amount is less than or equal to the first cache
  • the amount threshold is greater than or equal to the second buffer amount threshold.
  • the first buffer amount threshold may be represented by q h
  • the second buffer amount threshold may be represented by q l
  • the first buffer amount may be represented by q c .
  • q c > q h the media stream playback has a very small probability of stalling. At this time, you can consider increasing the bit rate of the media stream.
  • q c ⁇ q h the media stream playback has a high probability of stalling. At this time, you can consider reducing the bit rate of the media stream.
  • the first buffer amount is compared with the first buffer threshold and the second buffer threshold to determine whether to switch the code rate of the media stream, which can quickly learn the media stream.
  • the current playback effect When the first buffer amount is greater than the first buffer amount threshold or smaller than the second buffer amount threshold, the terminal may perform the code rate switching step. However, considering that after the bit rate is switched, the terminal receiving the media stream at the target bit rate may not guarantee the normal playback of the media stream.
  • the second buffer amount can be compared with two thresholds to determine the target bit rate. Will the playback of the media stream be improved after the bit rate is switched?
  • the process of determining the target code rate may be to judge the playback effects corresponding to multiple candidate code rates, so as to obtain the candidate code rate with the best playback effect from the multiple candidate code rates as the target code rate.
  • the terminal can obtain multiple candidate code rates, and obtain each candidate code based on the relationship between the multiple candidate code rates and the current code rate, the playback status information, and the position of the media frame in the media stream in the target media frame group.
  • the target bit rate is determined from the multiple candidate bit rates.
  • the target media frame group is the media frame group where the media frame is located.
  • the server may cache media streams of multiple code rates, and the multiple candidate code rates are multiple code rates of the media stream that the server can provide.
  • the media stream may include multiple media frame groups, and the length of each media frame group may be preset according to service requirements, or may be temporarily set by a technician, which is not limited in the present disclosure.
  • Each media frame group may include multiple media frames, and the multiple media frames may be arranged in chronological order.
  • the position of the media frame in the target media frame group in the media stream may be represented by the time required for the terminal to play from the first frame of the target media frame group to the media frame.
  • the second buffer amount corresponding to each candidate bit rate may represent the length of time that the buffered but unplayed media stream can be played when the terminal transmits the target media frame group after the bit rate is switched to the candidate bit rate.
  • media streams of n types of code rates may be cached in the server, and multiple candidate code rates may include r 1 , r 2 ,...r n .
  • the length of the target media frame group may be D
  • the time required for playing from the first frame of the target media frame group to the media frame may be d
  • d may be used to represent the position of the media frame in the target media frame group.
  • q n can be used to represent the second buffer amount corresponding to the nth candidate code rate.
  • D and d are positive numbers
  • n is a positive integer.
  • the corresponding code rate of each candidate is obtained
  • the target bit rate is determined according to the second buffer amount corresponding to each bit rate and the relationship between the first buffer amount threshold and the second buffer amount threshold, providing a method for determining the target bit rate, It provides a basis for realizing the code rate switching of the terminal.
  • the process of obtaining the second buffer amount may be: the terminal may obtain the buffer increase amount for the media stream at the end of the target media frame group transmission according to the position of the media frame in the media stream in the target media frame group.
  • the terminal determines the playback volume of the media stream during the target caching process according to the cache location corresponding to the relationship between the multiple candidate code rates and the current code rate, where the cache location is to continue to cache the target media frame group
  • the target buffering process is a process from now to the end of the transmission of the target media frame group based on the multiple candidate code rates.
  • the terminal obtains the second buffer amount corresponding to each candidate bit rate according to the first buffer amount, buffer increase amount, and playback amount included in the playback status information.
  • the first buffer amount is the current buffered and unplayed media stream.
  • the amount of cache is the current buffered and unplayed media stream. The amount of cache.
  • the position of the media frame in the target media frame group may be represented by the time required for the terminal to play from the first frame of the target media frame group to the media frame, for example, the unit may be ms.
  • the terminal uses the playable time of the buffered media stream in the target time period as the buffer increase, and the target time period is the time period from the moment when the media frame is received to the moment when the target media frame group transmission ends. For example, after the terminal receives the media frame and buffers 10 media frames within the target time period, all the media frames of the target media frame group have been received and buffered. The time required to play the 10 media frames buffered in the target time period is the buffer increase.
  • the terminal can obtain the second buffer amount corresponding to each candidate bit rate according to the first buffer amount, buffer increase amount, and playback amount.
  • the second buffer amount corresponding to the multiple candidate code rates can indicate the length of time that the buffered and unplayed media stream can be played when the terminal switches to the multiple candidate code rates to complete the transmission of the target media frame group currently being transmitted. That is, the second buffer amount corresponding to each candidate bit rate is the amount of buffer that has been buffered but not played for the media stream at the end of the target media frame group transmission after the bit rate is switched to each candidate bit rate .
  • q c is the first buffer amount
  • q b is the playback amount
  • q n is the second buffer amount corresponding to the nth candidate code rate.
  • D is the length of the target media frame group
  • d is the time required for playing from the first frame of the target media frame group to the media frame.
  • Dd may represent the buffer increase.
  • the second buffer amount of each candidate bit rate can be obtained, and a method of obtaining the second buffer amount is provided, which is based on the second buffer amount.
  • the relationship with the first buffer amount threshold and the second buffer amount threshold provides a basis for determining the target bit rate.
  • the current network state information when acquiring the playback volume, can also be referred to to determine the time required to cache the target media frame group, and to determine how much buffer volume will be played during this period.
  • the terminal can determine the cache location when continuing to cache the target media frame group based on the relationship between the multiple candidate code rates and the current code rate, obtain current network state information, and obtain current network state information based on the current network state information, cache location, and target media frame. The length of the group and multiple candidate bit rates determine the amount of media stream played during the target caching process.
  • the above-mentioned playback volume is the duration of the media stream played during the target time period for the terminal to obtain the buffer increase. It can be seen that the playback volume is related to the speed at which the terminal acquires the media stream in the target time period, that is, it is related to the network status of the terminal.
  • the media stream acquired in the target time period is also the media stream corresponding to the increased amount of cache.
  • the terminal may obtain current network information, and the current network information may include the average bandwidth of the terminal within a period of time close to the current moment.
  • the buffer position when the terminal continues to buffer the target media frame group is related to the relationship between the candidate bit rate and the current bit rate.
  • the buffer location In response to any candidate bit rate being equal to the current bit rate, the buffer location is the location of the next media frame of the media frame. In response to any candidate code rate being not equal to the current code rate, the buffer location is the location of the first media frame of the target media frame group.
  • the terminal when the candidate code rate is the same as the current code rate, the terminal does not need to switch the code rate, and can continue to buffer the target media frame group from the next frame of the media frame.
  • the terminal may buffer the target media frame group starting from the first frame of the target media frame group. After determining the buffer position when the terminal continues to buffer the target media frame group, the terminal can combine the current network state information obtained, the length of the target media frame group, and multiple candidate bit rates to determine the playback volume during the target buffering process.
  • the caching process is a process from now until the end of the transmission of the target media frame group based on the multiple candidate code rates.
  • r c is the current code rate
  • r n is the nth candidate code rate
  • q n is the second buffer amount corresponding to the nth candidate code rate
  • q c is the first buffer amount
  • D is the target media frame group
  • the length of d is the time required to play from the first frame of the target media frame group to the media frame
  • B is the average bandwidth of the terminal within a period of time close to the current moment
  • Dd can represent the increase in buffering.
  • (Dd)*r c *8/B can represent Play volume.
  • the terminal can start from the first frame of the target media frame group and buffer the target media frame group. Accordingly, D*r n *8/B can represent the playback volume.
  • the following formula can also be used to obtain the average bandwidth B of the terminal within a period of time close to the current moment:
  • S is the data volume of the media stream downloaded by the terminal within a period of time close to the current moment
  • T is a period of time close to the current moment.
  • T can be 500 milliseconds.
  • the terminal may respond to that at least one second buffer amount among the second buffer amounts corresponding to the multiple candidate code rates is greater than the first buffer amount threshold, and correspond to the at least one second buffer amount.
  • the largest candidate code rate is determined as the target code rate.
  • the terminal may also determine that the current bit rate is the target bit rate in response to that the second buffer amount corresponding to the multiple candidate bit rates does not include a second buffer amount greater than the first buffer amount threshold.
  • the first buffer amount is greater than the first buffer amount threshold, that is to say, the current terminal has buffered the media stream and has not played the buffer amount to ensure the smooth playback of the media stream. At this time, consider increasing the media stream. The download bitrate of the stream.
  • the terminal may determine the largest candidate code rate among the candidate code rates corresponding to the at least one second buffer amount as the target code rate, and the candidate code rate may be greater than the current code rate.
  • the second buffer amount corresponding to multiple candidate bit rates does not include a second buffer amount greater than the first buffer amount threshold, it means that among multiple candidate bit rates, none of the multiple candidate bit rates can ensure the normal playback of the media stream and enhance the media at the same time.
  • the bit rate of the definition of the stream so the terminal can determine the current bit rate as the target bit rate, and continue to buffer the media stream at the current bit rate.
  • the current code rate can be represented by r c
  • the target code rate can be represented by r
  • the nth candidate code rate can be represented by r n
  • the second buffer amount corresponding to the nth candidate code rate can be represented by q n .
  • the largest candidate code rate is determined as the target code rate, or the current code rate is determined as the target code rate.
  • the terminal may correspond to the at least one second buffer amount Among the candidate code rates greater than the current code rate, the smallest candidate code rate is determined as the target code rate.
  • each of the candidate bit rates corresponding to the at least one second buffering amount that is greater than the current bit rate can enhance the clarity of the media stream while ensuring that the media stream can be played normally, and select the smallest code rate among them. Rate as the target bit rate.
  • the terminal may respond to at least one of the second buffer amounts corresponding to the multiple candidate code rates being greater than the second buffer amount threshold, and select the candidate corresponding to the at least one second buffer amount.
  • the largest candidate code rate is determined as the target code rate.
  • the terminal may also respond that the second buffer amount corresponding to the multiple candidate code rates does not include the second buffer amount greater than the second buffer amount threshold, and the largest second buffer amount among the second buffer amounts corresponding to the multiple candidate code rates The candidate code rate corresponding to the quantity is determined as the target code rate.
  • the first buffer amount is less than the second buffer amount threshold, that is to say, the current terminal has buffered the media stream and the unplayed buffer volume cannot guarantee the smooth playback of the media stream. In this case, you can consider reducing the media stream.
  • the download bitrate of the stream When at least one of the second buffer amounts corresponding to the multiple candidate bit rates is greater than the second buffer amount threshold, the at least one candidate bit rate corresponding to the at least one second buffer amount can ensure the normal playback of the media stream, and accordingly Yes, the terminal may determine the largest candidate code rate among the candidate code rates corresponding to the at least one second buffer amount as the target code rate.
  • the candidate code rate corresponding to the largest second buffer amount may be determined as the target code rate.
  • the current code rate can be represented by r c
  • the target code rate can be represented by r
  • the nth candidate code rate can be represented by r n
  • the second buffer amount corresponding to the nth candidate code rate can be represented by q n .
  • the cache amount threshold can be represented by q l . If for any r n , there is no q n ⁇ q l , then the r n corresponding to the largest q n is taken as the target code rate. If for any r n, q n ⁇ q l exists, then taken to satisfy q n ⁇ q l of r n, the largest target code rate r n.
  • the candidate code rate corresponding to the second buffer amount is determined as the target code rate.
  • the target code rate may also be a preset code rate, or the code rate indicated in the code rate selection instruction, for example, , The user can choose to switch the bit rate and specify the target bit rate.
  • the terminal may execute the following S44 according to the target code rate, and the present disclosure does not limit the manner of obtaining the target code rate.
  • the playback status information including the first buffer amount as an example.
  • the playback status information may include at least one of the freeze information or the frame loss rate during the media stream playback. Accordingly, the playback The status information meeting the code rate switching condition may be that any one of the freeze information or the frame loss rate meets the code rate switching condition.
  • the stall information may include at least one of the number of stalls in the target time period of playing the media stream, the time of the last stall, or the duration of the last stall.
  • the code rate switching conditions may include multiple situations, for example: the number of stalls is greater than the threshold, the duration between the last stalling time and the current moment is less than the interval threshold, and the stall duration is greater than the duration threshold, or the last stalling The length is greater than the duration threshold, etc. In these cases, the terminal may consider reducing the bit rate.
  • the code rate switching conditions can also include the number of stalls being less than the threshold, the duration between the last stalling time and the current time is greater than the interval threshold, the stall duration is less than the duration threshold, and the last stalling duration is less than the duration threshold.
  • the terminal can consider increasing the bit rate.
  • the code rate switching condition can include that the frame loss rate is greater than the first frame loss rate threshold, and the code rate switching condition can also be that the frame loss rate is less than the second frame loss rate threshold, and the second frame loss rate threshold is less than The first frame loss rate threshold.
  • the frame loss rate can also be the frame loss rate in the target time period, for example, the frame loss rate in the past minute, and the media stream transmission during this period is judged by the frame loss rate in a period of time. In order to determine whether the bit rate needs to be adjusted.
  • the terminal may determine the target position according to the position of the media frame in the media stream in response to the playback status information meeting the code rate switching condition.
  • the current code rate when the playback status information obtained by the terminal meets the code rate switching condition, the current code rate will be switched to the target code rate to optimize the playback effect of the media stream. Since the target bit rate may be different from the current bit rate, according to the reference relationship of the terminal when decoding the media frame, the position where the terminal starts to download the media frame after switching the bit rate may be different, that is, the target position will change when the bit rate is changed. .
  • the terminal can respond to the target bit rate being equal to the current bit rate, discarding the playback status information, and no longer determine the target location.
  • the terminal may also determine that the location of the first media frame in the target media frame group is the target location in response to that the target code rate is not equal to the current code rate.
  • the target bit rate is the same as the current bit rate
  • the bit rate of the media stream transmitted by the terminal has not changed. Therefore, it can continue to transmit based on the current bit rate from the position of the next media frame of the media frame in the target media frame group.
  • the media frame correspondingly, the terminal can discard the acquired playback status information. If the target bit rate is different from the current bit rate and the bit rate changes, the bit rate of the target media frame group needs to be consistent. Therefore, the media frames of the target media frame group can be transmitted again at the target bit rate.
  • the terminal may start to transmit the media frame from the position where the first media frame is located in the target media frame group.
  • the media stream currently being transmitted by the terminal may include two media frame groups, and each media frame group may include multiple media frames, and each media frame corresponds to a time stamp.
  • the order of the media frames in the first media frame group according to the timestamp can be [1000, 2000, 3000, 4000, 5000, 6000]
  • the order of the media frames in the second media frame group according to the timestamp can be [7000,8000,9000,10000,11000,12000].
  • the terminal receives the media frame with the time stamp of 8000 and the determined target bit rate is the same as the current bit rate, there is no need Switching the code rate does not need to send a frame acquisition request to the server, and can continue to receive media frames starting from the media frame with a timestamp of 9000. If the terminal receives a media frame with a timestamp of 8000 and the determined target bit rate is different from the current bit rate, it can switch the bit rate, send a frame acquisition request to the server, and in order to keep the bit rate of the media frame group consistent , The media frames in the media frame group can be retrieved starting from the media frame with a timestamp of 7000. According to the size relationship between the target bit rate and the current bit rate, the target position for starting the transmission of the media frame is determined again.
  • the terminal sends a frame acquisition request to the server based on the target bit rate and target location.
  • the terminal After the terminal determines the target bit rate and target location, it can send a frame acquisition request to the server.
  • the frame acquisition request is used to instruct the server to return the media frame starting at the target location in the media stream based on the target bit rate, and the terminal can obtain the target bit rate.
  • the terminal In the corresponding media stream, the media frame that starts at the target position for transmission.
  • the target code rate may be the same as the current code rate, or may be different from the current code rate. If the target bit rate is the same as the current bit rate, the terminal can keep the current bit rate and continue to receive media frames of the media stream from the server, that is, when the target bit rate is the same as the current bit rate, the terminal may not switch the bit rate. Alternatively, the terminal may not send a frame acquisition request to the server. If the target bit rate is different from the current bit rate, the terminal can switch the current bit rate to the target bit rate, and obtain the media frame from the server based on the target bit rate. That is to say, when the target bit rate is different from the current bit rate, the terminal can The code rate is switched, and accordingly, the terminal can send a frame acquisition request to the server.
  • the terminal when the target bit rate is equal to the current bit rate, the terminal can discard the playback status information and not send a frame acquisition request to the server, but keep the current bit rate and continue to receive media frames in the media stream until the next acquisition The playback status information of the media stream.
  • the terminal can disconnect from the server and re-send the frame acquisition request to the server to request the server to send the media frame starting at the target position at the target bit rate. .
  • the terminal can also re-send the frame acquisition request without disconnecting the link with the server.
  • the terminal may receive media streams with multiple bitrates. When playing media streams, it can play high-bitrate media streams first. The link is not disconnected to request the media frame of the code rate after the switch, which can ensure that the media frame of the code rate before the switch can be played when there is a problem with the media frame obtained at the target code rate.
  • the server sends the media frame starting from the target position in the media stream to the terminal based on the target bit rate and the target position.
  • the terminal After the terminal determines the target bit rate and target location, it can send a frame acquisition request to the server. Accordingly, the server can receive and parse the frame acquisition request. Furthermore, the server can send the frame to the terminal according to the parsed target bit rate and target location. In the media stream corresponding to the target bit rate, the media frame starting at the target position is used for the transmission of the media stream.
  • the terminal can continue to perform a check on the next media frame in the media stream based on the current bit rate. Media frames are transmitted.
  • the code rate switching method provided by the present disclosure adopts the streaming transmission method to transmit the media stream, which realizes frame-level transmission.
  • the code rate can be adjusted adaptively during the process of transmitting media frames, and the frame sent from the terminal to the server is obtained
  • the request can be a FAS request to request a media frame corresponding to the switched bit rate.
  • Fig. 6 is a flow chart showing a method for code rate switching according to an exemplary embodiment. Referring to Fig. 6, the method includes the following steps.
  • the server sends the media frame in the media stream.
  • the server obtains the playback status information of the media stream of the terminal.
  • the terminal may be a terminal used by a user, and the terminal may be connected to a server through a wired network or a wireless network, and the server may be used to provide media streams with multiple bit rates.
  • the media stream may include several media frames, the media frames may be audio frames or image frames, and the several media frames may be obtained by sampling the original media resources.
  • the terminal receives the media stream, it can continuously obtain several media frames in the media stream from the server, and then play the obtained media frames to realize the transmission and playback of the media stream.
  • the server can obtain the play status information of the media stream of the terminal, and the play status information can be used to determine whether the transmission code rate of the media stream needs to be switched.
  • the media frame sent by the server can be any media frame in the media stream. That is to say, the server can start to perform the step of bit rate switching at any point in the sending of the media stream. This arbitrary time point can be determined according to business needs, so that the server can automatically perform the code rate switching step at regular intervals, or a technician can manually control the server to perform the code rate switching step. Not limited.
  • the server may send a playback status information acquisition request to the terminal, so that the terminal sends the playback status information of the terminal to the server, and further, the server may determine whether the code rate switching step needs to be performed for the terminal.
  • the playback status information may also be actively sent by the terminal to the server, and this application does not limit the manner in which the server obtains the playback status information.
  • the server can determine the target bit rate based on the playback state information and the current bit rate in response to the playback status information meeting the code rate switching condition.
  • the foregoing S62 is similar to the foregoing S43, except that the execution subject can be changed from a terminal to a server, which is not repeated here.
  • the target code rate may also be a preset code rate, or the code rate indicated in the code rate selection instruction, for example, .
  • the server can choose to switch the bit rate and specify the target bit rate.
  • the server can execute the steps described in S63 below according to the target code rate, and the present disclosure does not limit the manner of obtaining the target code rate.
  • the server may determine the target position according to the position of the media frame in the media stream in response to the playback status information meeting the code rate switching condition.
  • the foregoing S63 is similar to the foregoing S44, and there is only the difference that the execution subject can be changed from a terminal to a server, which is not repeated here.
  • the server sends the media frame starting at the target position in the media stream to the terminal based on the target bit rate and the target position.
  • the above S64 is similar to the above S45.
  • the execution subject can be changed from a terminal to a server. Accordingly, after the server determines the target bit rate and target position, it can directly find the media stream corresponding to the target bit rate according to the target bit rate and target position.
  • the media frame starts at the target position, and the media stream is sent to the terminal from the media frame at the target bit rate for media stream transmission.
  • the steps performed by the server to determine the target bit rate and target location and to send the media stream to the terminal are similar to the embodiment shown in FIG. 4, and will not be repeated here.
  • Fig. 7 is a block diagram showing a code rate switching device according to an exemplary embodiment, and the device includes:
  • the obtaining module 701 is configured to receive media frames in a media stream; and obtain the playing state information of the media stream.
  • the determining module 702 is configured to determine the target position according to the position of the media frame in the media stream in response to that the playback status information meets the code rate switching condition.
  • the sending module 703 is configured to send a frame acquisition request to the server based on the target location, and the frame acquisition request is used to instruct the server to return the media frame starting at the target location in the media stream based on the target bit rate.
  • the playback status information includes a first buffer amount
  • the code rate switching condition includes that the first buffer amount is greater than a first buffer amount threshold or the first buffer amount is less than a second buffer amount threshold
  • the first buffer amount is a buffer amount that is currently buffered and not played for the media stream
  • the second buffer amount threshold is smaller than the first buffer amount threshold
  • the playback status information includes at least one of freeze information or frame loss rate during the playback of the media stream;
  • the freeze information includes the number of freezes in the target time period during which the media stream is played, and the last one. At least one of the time of one stall or the duration of the last stall;
  • the code rate switching condition includes any one of the following: the number of stalls is greater than the number threshold or the number of stalls is less than the number threshold; the last stall time is equal to The duration between the current moment is less than the interval threshold and the jam duration is greater than the duration threshold, or the duration between the last jam time and the current moment is greater than the interval threshold and the jam duration is less than the duration threshold; the last jam duration is greater than the duration threshold, Or, the last freeze duration is less than the duration threshold;
  • the frame loss rate is greater than the first frame loss rate threshold;
  • the frame loss rate is less than the second frame loss rate threshold, and the second frame loss rate threshold is less than the first frame loss rate threshold; target time period
  • the sending module 703 is configured to send a frame acquisition request to the server based on the target location in response to the target code rate being equal to the current code rate.
  • the determining module 702 is configured to: in response to the playback status information meeting the code rate switching condition, determine the target code rate according to the playback status information and the current code rate; in response to the target code rate and the current code rate If they are not equal, the target position is determined according to the position of the media frame in the media stream.
  • the determining module 702 is further configured to discard the playback state information in response to the target bit rate being equal to the current bit rate.
  • the determining module 702 is configured to determine the location of the first media frame in the target media frame group as the target location in response to the target bit rate being not equal to the current bit rate.
  • the target media frame group is the media frame group where the media frame is located.
  • the determining module 702 is configured to: obtain multiple candidate code rates; according to the relationship between the multiple candidate code rates and the current code rate, the playback status information, and the media stream The position of the media frame in the target media frame group is to obtain the second buffer amount corresponding to each candidate code rate, and the target media frame group is the media frame group where the media frame is located; according to each candidate code rate According to the relationship between the corresponding second buffer amount and the first buffer amount threshold or the second buffer amount threshold, the target bit rate is determined from the multiple candidate bit rates; wherein, the second buffer corresponding to each candidate bit rate The amount is the amount of buffering that has been buffered but not played for the media stream at the end of the transmission of the target media frame group after the bit rate is switched to the candidate bit rate.
  • the determining module 702 is configured to: according to the position of the media frame in the media stream in the target media frame group, obtain the information on the media stream at the end of the target media frame group transmission. Cache increase; according to the cache location corresponding to the relationship between the multiple candidate code rates and the current code rate, determine the playback volume of the media stream during the target cache process, where the cache location is to continue to cache the target.
  • the buffering position of the media frame group, the target buffering process is the process from now to the end of the transmission of the target media frame group based on the multiple candidate code rates; according to the first buffering amount included in the playback status information,
  • the buffer increase amount and the playback amount are used to obtain a second buffer amount corresponding to each candidate code rate, and the first buffer amount is a buffer amount that is currently buffered and not played for the media stream.
  • the determining module 702 is configured to: determine the cache position when continuing to cache the target media frame group according to the relationship between the multiple candidate code rates and the current code rate; and obtain the current network status Information; according to the current network state information, the cache location, the length of the target media frame group, and the multiple candidate code rates, determine the playback volume of the media stream during the target caching process.
  • the buffer location in response to any candidate bit rate being equal to the current bit rate, is the position of the next media frame of the media frame; or, in response to any candidate bit rate being equal to the current bit rate, The current bit rate is not equal, and the buffer location is the location of the first media frame of the target media frame group.
  • the first buffer amount that is currently buffered and not played for the media stream is greater than the first buffer amount threshold.
  • the determining module 702 is configured to: in response to that at least one second buffer amount among the second buffer amounts corresponding to the plurality of candidate bit rates is greater than the first buffer amount threshold, the largest candidate bit rate among the at least one second buffer amount Determined as the target code rate, and the target code rate is greater than or equal to the current code rate. Or, in response to the second buffer amount corresponding to the multiple candidate code rates not including a second buffer amount greater than the first buffer amount threshold, the current bit rate is determined as the target bit rate, and the target bit rate is greater than or equal to The current bit rate.
  • the first buffer amount that is currently buffered and not played for the media stream is less than the second buffer amount threshold.
  • the determining module 702 is configured to: in response to at least one of the second buffer amounts corresponding to the plurality of candidate code rates being greater than the second buffer amount threshold, the largest candidate code rate among the at least one second buffer amount Determined as the target code rate, the target code rate is less than or equal to the current code rate.
  • the largest second buffer amount among the second buffer amounts corresponding to the plurality of candidate code rates is determined as the target code rate, and the target code rate is less than or equal to the current code rate.
  • the code rate switching device when the code rate switching device provided in the above embodiment switches the code rate, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be allocated by different functional modules according to needs. , The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the code rate switching device provided in the foregoing embodiment and the code rate switching method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • Fig. 8 is a block diagram showing a code rate switching device according to an exemplary embodiment, and the device includes:
  • the obtaining module 801 is used to send media frames in a media stream; and obtain information about the playing state of the media stream of the terminal.
  • the determining module 802 is configured to determine the target position according to the position of the media frame in the media stream in response to the playback status information meeting the code rate switching condition.
  • the sending module 803 is configured to send a media frame starting at the target position in the media stream to the terminal based on the target position and the target bit rate.
  • the playback status information includes a first buffer amount, and the first buffer amount is a buffer amount that is currently buffered and not played for the media stream; and the code rate switching condition includes the first buffer amount.
  • the buffer amount is greater than a first buffer amount threshold or the first buffer amount is smaller than a second buffer amount threshold, wherein the second buffer amount threshold is smaller than the first buffer amount threshold.
  • the playback status information includes at least one of freeze information or frame loss rate during the playback of the media stream;
  • the freeze information includes the number of freezes in the target time period during which the media stream is played, and the last one. At least one of the time of one stall or the duration of the last stall;
  • the code rate switching condition includes any one of the following: the number of stalls is greater than the number threshold or the number of stalls is less than the number threshold; the last stall time is equal to The duration between the current moment is less than the interval threshold and the jam duration is greater than the duration threshold, or the duration between the last jam time and the current moment is greater than the interval threshold and the jam duration is less than the duration threshold; the last jam duration is greater than the duration threshold, Or, the last freeze duration is less than the duration threshold;
  • the frame loss rate is greater than the first frame loss rate threshold;
  • the frame loss rate is less than the second frame loss rate threshold, and the second frame loss rate threshold is less than the first frame loss rate threshold; target time period
  • the determining module 802 is configured to: in response to the playback status information meeting the code rate switching condition, determine the target code rate according to the playback status information and the current code rate; in response to the target code rate and the current code rate The rates are not equal, and the target position is determined according to the position of the media frame in the media stream.
  • the determining module 802 is further configured to continue to transmit the next media frame of the media frame to the terminal based on the current code rate in response to the target code rate being equal to the current code rate.
  • the determining module 802 is configured to determine the location of the first media frame in the target media frame group as the target location in response to the target bit rate being not equal to the current bit rate.
  • the target media frame group is the media frame group where the media frame is located.
  • the determining module 802 is configured to: obtain multiple candidate code rates; according to the relationship between the multiple candidate code rates and the current code rate, the playback status information, and the media stream The position of the media frame in the target media frame group is to obtain the second buffer amount corresponding to each candidate code rate, and the target media frame group is the media frame group where the media frame is located; according to each candidate code rate According to the relationship between the corresponding second buffer amount and the first buffer amount threshold or the second buffer amount threshold, the target bit rate is determined from the multiple candidate bit rates; wherein, the second buffer corresponding to each candidate bit rate The amount is the amount of buffering that has been buffered but not played for the media stream at the end of the transmission of the target media frame group after the bit rate is switched to the candidate bit rate.
  • the determining module 802 is configured to: according to the position of the media frame in the media stream in the target media frame group, obtain the information on the media stream at the end of the target media frame group transmission. Cache increase; according to the cache location corresponding to the relationship between the multiple candidate code rates and the current code rate, determine the playback volume of the media stream during the target cache process, where the cache location is to continue to cache the target.
  • the buffering position of the media frame group, the target buffering process is the process from now to the end of the transmission of the target media frame group based on the multiple candidate code rates; according to the first buffering amount included in the playback status information,
  • the buffer increase amount and the playback amount are used to obtain a second buffer amount corresponding to each candidate code rate, and the first buffer amount is a buffer amount that is currently buffered and not played for the media stream.
  • the determining module 802 is configured to: determine the cache position when continuing to cache the target media frame group according to the relationship between the multiple candidate code rates and the current code rate; and obtain the current network status Information; according to the current network state information, the cache location, the length of the target media frame group, and the multiple candidate code rates, determine the playback volume of the media stream during the target caching process.
  • the buffer location in response to any candidate bit rate being equal to the current bit rate, is the position of the next media frame of the media frame; or, in response to any candidate bit rate being equal to the current bit rate, The current bit rate is not equal, and the buffer location is the location of the first media frame of the target media frame group.
  • the first buffer amount that is currently buffered and not played for the media stream is greater than a first buffer amount threshold; the determining module 802 is configured to respond to the first buffer amount corresponding to the multiple candidate bit rates At least one of the second buffer amounts is greater than the first buffer amount threshold, the largest candidate code rate in the at least one second buffer amount is determined as the target code rate, and the target code rate is greater than or equal to The current bit rate; or, in response to the second buffer amount corresponding to the multiple candidate bit rates not including a second buffer amount greater than the first buffer amount threshold, the current bit rate is determined as the target code Rate, the target code rate is greater than or equal to the current code rate.
  • the first buffer amount that is currently buffered and not played for the media stream is less than a second buffer amount threshold.
  • the determining module 802 is configured to: in response to at least one of the second buffer amounts corresponding to the plurality of candidate code rates being greater than the second buffer amount threshold, determine the largest one among the at least one second buffer amount The candidate code rate is determined to be the target code rate, and the target code rate is less than or equal to the current code rate; The second buffer amount of the buffer amount threshold, the candidate bit rate corresponding to the largest second buffer amount among the second buffer amounts corresponding to the plurality of candidate bit rates is determined as the target bit rate, and the target bit rate is less than or Equal to the current bit rate.
  • the code rate switching device when the code rate switching device provided in the above embodiment switches the code rate, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be allocated by different functional modules according to needs. , The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the code rate switching device provided in the foregoing embodiment and the code rate switching method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • FIG. 9 shows a structural block diagram of a terminal 900 provided by an exemplary embodiment of the present disclosure.
  • the terminal 900 may be: a smartphone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III, moving picture expert compression standard audio layer 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, a moving picture expert compressing standard audio Level 4) Player, laptop or desktop computer.
  • the terminal 900 may also be called user equipment, portable terminal, laptop terminal, desktop terminal, and other names.
  • the terminal 900 includes: one or more processors 901 and one or more memories 902.
  • the processor 901 may include one or more processing cores, such as a 4-core processor, a 9-core processor, and so on.
  • the processor 901 can use at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). accomplish.
  • the processor 901 may also include a main processor and a coprocessor.
  • the main processor is a processor used to process data in the wake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
  • the processor 901 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used to render and draw content that needs to be displayed on the display screen.
  • the processor 901 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 902 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 901 to realize the bit rate provided by the method embodiment of the present disclosure. Switch method.
  • the terminal 900 may optionally further include: a peripheral device interface 903 and at least one peripheral device.
  • the processor 901, the memory 902, and the peripheral device interface 903 may be connected by a bus or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 903 through a bus, a signal line, or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 904, a touch display screen 905, a camera component 906, an audio circuit 907, a positioning component 908, and a power supply 909.
  • the peripheral device interface 903 can be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 901 and the memory 902.
  • the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 901, the memory 902, and the peripheral device interface 903 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 904 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 904 communicates with a communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on.
  • the radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G and 9G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network.
  • the radio frequency circuit 904 may also include a circuit related to NFC (Near Field Communication), which is not limited in the present disclosure.
  • the display screen 905 is used to display a UI (User Interface, user interface).
  • the UI can include graphics, text, icons, videos, and any combination thereof.
  • the display screen 905 also has the ability to collect touch signals on or above the surface of the display screen 905.
  • the touch signal may be input to the processor 901 as a control signal for processing.
  • the display screen 905 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 905 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 900.
  • the display screen 905 can also be configured as a non-rectangular irregular pattern, that is, a special-shaped screen.
  • the display screen 905 may be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
  • the camera assembly 906 is used to capture images or videos.
  • the camera assembly 906 includes a front camera and a rear camera.
  • the front camera is set on the front panel of the terminal 900
  • the rear camera is set on the back of the terminal 900.
  • there are at least two rear cameras each of which is a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera Integrate with the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions.
  • the camera assembly 906 may also include a flash.
  • the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
  • the audio circuit 907 may include a microphone and a speaker.
  • the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 901 for processing, or input to the radio frequency circuit 904 to implement voice communication.
  • the microphone can also be an array microphone or an omnidirectional collection microphone.
  • the speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves.
  • the speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker.
  • the speaker When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into human audible sound waves, but also convert the electrical signal into human inaudible sound waves for distance measurement and other purposes.
  • the audio circuit 907 may also include a headphone jack.
  • the positioning component 908 is used to locate the current geographic location of the terminal 900 to implement navigation or LBS (Location Based Service, location-based service).
  • the positioning component 908 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, or the Galileo system of Russia.
  • the power supply 909 is used to supply power to various components in the terminal 900.
  • the power source 909 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery.
  • the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery.
  • a wired rechargeable battery is a battery charged through a wired line
  • a wireless rechargeable battery is a battery charged through a wireless coil.
  • the rechargeable battery can also be used to support fast charging technology.
  • the terminal 900 further includes one or more sensors 910.
  • the one or more sensors 910 include, but are not limited to: an acceleration sensor 911, a gyroscope sensor 912, a pressure sensor 913, a fingerprint sensor 914, an optical sensor 915, and a proximity sensor 916.
  • the acceleration sensor 911 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 900.
  • the acceleration sensor 911 may be used to detect the components of gravitational acceleration on three coordinate axes.
  • the processor 901 may control the touch screen 905 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 911.
  • the acceleration sensor 911 may also be used for game or user movement data collection.
  • the gyroscope sensor 912 can detect the body direction and rotation angle of the terminal 900, and the gyroscope sensor 912 can cooperate with the acceleration sensor 911 to collect the user's 3D actions on the terminal 900.
  • the processor 901 can implement the following functions according to the data collected by the gyroscope sensor 912: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 913 may be provided on the side frame of the terminal 900 and/or the lower layer of the touch screen 905.
  • the processor 901 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 913.
  • the processor 901 implements control of the operability controls on the UI interface according to the user's pressure operation on the touch display screen 905.
  • the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • the fingerprint sensor 914 is used to collect the user's fingerprint, and the processor 901 can identify the user's identity according to the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 can identify the user's identity according to the collected fingerprint. When it is recognized that the user's identity is a trusted identity, the processor 901 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 914 may be provided on the front, back or side of the terminal 900. When a physical button or a manufacturer logo is provided on the terminal 900, the fingerprint sensor 914 can be integrated with the physical button or the manufacturer logo.
  • the optical sensor 915 is used to collect the ambient light intensity.
  • the processor 901 may control the display brightness of the touch screen 905 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 905 is decreased.
  • the processor 901 may also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 915.
  • the proximity sensor 916 also called a distance sensor, is usually arranged on the front panel of the terminal 900.
  • the proximity sensor 916 is used to collect the distance between the user and the front of the terminal 900.
  • the processor 901 controls the touch screen 905 to switch from the on-screen state to the off-screen state; when the proximity sensor 916 detects When the distance between the user and the front of the terminal 900 gradually increases, the processor 901 controls the touch display screen 905 to switch from the rest screen state to the bright screen state.
  • FIG. 9 does not constitute a limitation on the terminal 900, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
  • FIG. 10 is a block diagram of a server according to an exemplary embodiment.
  • the server 1000 may have relatively large differences due to different configurations or performances, and may include One or more processors (central processing units, CPU) 1001 and one or more memories 1002, where at least one instruction is stored in the memory 1002, and the at least one instruction is loaded and executed by the processor 1001 to realize the above The code rate switching method provided by each method embodiment.
  • the server may also have components such as a wired or wireless network interface and an input/output interface for input and output, and the server may also include other components for implementing device functions, which will not be repeated here.
  • the above-mentioned terminal and server are electronic devices that include one or more processors; one or more memories for storing executable instructions of the one or more processors; wherein, the one or more processors It is configured to execute the instructions to implement the method steps of the code rate switching method shown in the foregoing embodiments.
  • the features and applications described in each of the foregoing embodiments can all be executed by instructions stored in a storage medium recorded in the memory. When these instructions are executed by one or more processors, they can cause one or more processors to perform the actions indicated in the instructions.
  • a storage medium including instructions, such as a memory including instructions, which can be executed by a processor of an electronic device to perform the method operations of the code rate switching methods shown in each of the foregoing embodiments.
  • the features and applications described in the above embodiments can all be executed by instructions recorded in a storage medium.
  • these instructions are executed by one or more computing or processing units (for example, one or more processors, cores of the processors, or other processing units), they cause the processing units to perform the actions indicated in the instructions.
  • the storage medium may be a non-transitory computer-readable storage medium.
  • the non-transitory computer-readable storage medium may be a read-only memory (Read-Only Memory, ROM for short), random access memory ( Random Access Memory, RAM for short, Compact Disc Read-Only Memory, CD-ROM, magnetic tape, floppy disk and optical data storage devices, etc.
  • the embodiment of the present disclosure also provides a computer program product, including one or more instructions, when the one or more instructions are executed by the processor of the electronic device, the electronic device can execute the code rate shown in any one of the above embodiments. Switch method.

Landscapes

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

Abstract

本公开提供一种码率切换方法及设备,属于媒体传输技术领域。本公开实施例通过接收媒体流中的媒体帧,获取媒体流的播放状态信息,响应于播放状态信息符合码率切换条件,根据媒体帧在媒体流中的位置,确定目标位置,最后基于目标位置,向服务器发送帧获取请求,使得服务器基于目标码率返回媒体流中目标位置开始的媒体帧。

Description

码率切换方法及设备
本申请要求于2020年01月17日提交的申请号为202010055756.1、发明名称为“码率切换方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及媒体传输技术领域,特别涉及一种码率切换方法及设备。
背景技术
随着媒体传输技术的发展,媒体传输的应用场景越来越复杂,在用户的网络带宽发生波动的情况下,如何切换媒体资源的下载码率保证流式传输的正常进行也受到越来越多的关注。相关技术中,通常采用流式传输和片式传输实现媒体传输。但流式传输码率固定,片式传输则延迟较大。
发明内容
本公开实施例提供了一种码率切换方法及设备。技术方案如下:
根据本公开实施例的第一方面,提供一种码率切换方法,包括:接收媒体流中的媒体帧;获取所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第二方面,提供一种码率切换方法,包括:发送媒体流中的媒体帧;获取终端对所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第三方面,提供一种码率切换装置,包括获取模块、确定模块和发送模块;其中,获取模块用于接收媒体流中的媒体帧,获取所述媒体流的播放状态信息;确定模块用于响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;发送模块用于基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器,基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第四方面,提供一种码率切换装置,包括获取模块、确定模块和发送模块;其中,获取模块用于发送媒体流中的媒体帧,获取终端对所述媒体流的播放状态信息;确定模块用于响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;发送模块用于基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第五方面,提供一种电子设备,包括:一个或多个处理器;用于存储所述一个或多个处理器可执行指令的一个或多个存储器;其中,所述一个或多个处理器被配置为执行所述指令,以实现如下步骤:接收媒体流中的媒体帧;获取所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置, 确定目标位置;基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第六方面,提供一种电子设备,包括:一个或多个处理器;用于存储所述一个或多个处理器可执行指令的一个或多个存储器;其中,所述一个或多个处理器被配置为执行所述指令,以实现如下步骤:发送媒体流中的媒体帧;获取终端对所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第七方面,提供一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:接收媒体流中的媒体帧;获取所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第八方面,提供一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:发送媒体流中的媒体帧;获取终端对所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第九方面,提供一种计算机程序产品,包括一条或多条指令,所述一条或多条指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:接收媒体流中的媒体帧;获取所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
根据本公开实施例的第十方面,提供一种计算机程序产品,包括一条或多条指令,所述一条或多条指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:发送媒体流中的媒体帧;获取终端对所述媒体流的播放状态信息;响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
为了更清楚地说明本公开实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是根据一示例性实施例示出的一种码率切换方法的实施环境的示意图;
图2是根据一示例性实施例示出的一种码率切换方法的流程图;
图3是根据一示例性实施例示出的一种码率切换方法的流程图;
图4是根据一示例性实施例示出的一种码率切换方法的流程图;
图5是根据一示例性实施例示出的一种码率切换方法的示意图;
图6是根据一示例性实施例示出的一种码率切换方法的流程图;
图7是根据一示例性实施例示出的一种码率切换装置的框图;
图8是根据一示例性实施例示出的一种码率切换装置的框图;
图9是根据一示例性实施例示出的一种终端的框图;
图10是根据一示例性实施例示出的一种服务器的框图。
具体实施方式
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
本公开所涉及的用户信息可以为经用户授权或者经过各方充分授权的信息。
以下,对本公开所涉及的术语进行解释。
一、流媒体(Streaming Media)
流媒体采用流式传输方法,是指将一连串的多媒体资源压缩后,通过网络发送资源包,从而在网上即时传输多媒体资源以供观赏的一种技术与过程,此技术使得资源包得以像流水一样发送;如果不使用此技术,就必须在使用前下载整个媒体文件,从而仅能进行离线观看多媒体资源。流式传输可传送现场多媒体资源或预存于服务器上的多媒体资源,当观众用户在收看这些多媒体资源时,多媒体资源在送达观众用户的观众终端后可以由特定播放软件进行播放。
二、FAS(FLV Adaptive Streaming,基于FLV的自适应流媒体传输标准)
FAS是本公开所提出的流式资源传输标准(或称为资源传输协议),与传统的基于分片的媒体传输方式不同,FAS标准能够达到帧级别的多媒体资源传输,服务器无需等待一个完整的视频片段到达之后才能向终端发送资源包,而是在解析终端的帧获取请求之后,确定目标时间戳,若目标时间戳小于零,那么将从目标时间戳开始已缓存的所有媒体帧打包发送至终端(无需分片),此后,若目标时间戳大于或等于零,或者除了缓存的媒体帧之外还存在实时流,那么将多媒体资源的媒体帧逐帧发送至终端。需要说明的是,帧获取请求中指定目标码率,当终端自身的网络带宽情况发生变化时,可以适应性调整待切换码率,重新发送与待切换码率对应的帧获取请求,从而能够达到自适应调整多媒体资源码率的效果。FAS标准能够实现帧级传输、降低端到端延迟,只有码率发生切换时才需要发送新的帧获取请求,极大减小请求数量,降低资源传输过程的通信开销。
三、直播与点播
直播:多媒体资源是实时录制的,主播用户通过主播终端将媒体流“推流”(指基于流式传输方式推送)到服务器上,观众用户在观众终端上触发进入主播用户的直播界面之后,将 媒体流从服务器“拉流”(指基于流式传输方式拉取)到观众终端,观众终端解码并播放多媒体资源,从而实时地进行视频播放。
点播:也称为Video On Demand(VOD),多媒体资源预存在服务器上,服务器能够根据观众用户的要求来提供观众用户指定的多媒体资源,具体地,观众终端向服务器发送点播请求,服务器查询到点播请求所指定的多媒体资源之后,将多媒体资源发送至观众终端,也即是说,观众用户能够选择性地播放某个特定的多媒体资源。
直观地来讲,点播的内容可以任意控制播放进度,而直播则不然,直播的内容播放速度取决于主播用户的实时直播进度。
下面对本公开实施例提供的码率切换方法的实施环境进行介绍。
图1是根据一示例性实施例示出的一种码率切换方法的实施环境的示意图。参见图1,该实施环境包括:终端101和服务器102。终端101通过有线网络或无线网络与服务器102相连。
其中,终端101可以是智能手机、游戏主机、台式计算机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器或MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器和膝上型便携计算机中的至少一种。示例性的,终端101是用户使用的终端,用户可以使用该终端101从服务器102获取不同码率的媒体流。
服务器102可以是一台服务器、多台服务器、云计算平台和虚拟化中心中的至少一种。服务器102用于为支持媒体传输的应用程序提供后台服务。在一些实施例中,在媒体传输的过程中,服务器102和终端101可以协同工作。比如说,服务器102用于向终端101提供不同码率的媒体流,终端101用于向服务器102请求不同码率的媒体流。
终端101可以泛指多个终端中的一个,或者多个终端组成的集合;服务器102可以泛指多个服务器中的一个,或者多个服务器组成的集合。应理解,如果终端101或者服务器102是多台设备的集合,虽然图1未示出,此时上述实施环境还包括其他终端和其他服务器。本实施例对每种设备的数量和设备类型不做限定。
以上介绍了本公开实施例的硬件环境,以下对本公开实施例的方法流程进行示例性说明。
图2是根据一示例性实施例示出的一种码率切换方法的流程图,该方法可以应用于电子设备,在本实施例中,以该电子设备为终端为例进行说明,该方法包括以下步骤。
在S21中,终端接收媒体流中的媒体帧。
在S22中,终端获取该媒体流的播放状态信息。
在S23中,终端响应于该播放状态信息符合码率切换条件,根据该媒体帧在该媒体流中的位置,确定目标位置。
在S24中,终端基于该目标位置,向服务器发送帧获取请求,该帧获取请求用于指示该服务器基于目标码率返回对该媒体流中该目标位置开始的媒体帧进行传输。
在一些实施例中,该播放状态信息包括第一缓存量,该码率切换条件包括该第一缓存量大于第一缓存量阈值或者该第一缓存量小于第二缓存量阈值,其中该第一缓存量为当前对该媒体流已缓存且未播放的缓存量,该第二缓存量阈值小于该第一缓存量阈值。
在一些实施例中,该播放状态信息包括该媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;所述码率切换条件包括下述任一项:卡顿次数大于次数阈值或者 卡顿次数小于次数阈值;上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;丢帧率大于第一丢帧率阈值;丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;目标时间段内的丢帧率大于第一丢帧率阈值;目标时间段内的丢帧率小于第二丢帧率阈值。
在一些实施例中,该基于该目标位置,向服务器发送帧获取请求,包括:响应于该目标码率与当前码率不相等,基于该目标位置向服务器发送帧获取请求。
在一些实施例中,该响应于该播放状态信息符合码率切换条件,根据该媒体帧在该媒体流中的位置,确定目标位置,包括:响应于该播放状态信息符合码率切换条件,根据该播放状态信息以及当前码率,确定目标码率;响应于该目标码率与当前码率不相等,根据该媒体帧在该媒体流中的位置,确定目标位置。
在一些实施例中,该方法还包括:响应于该目标码率与该当前码率相等,丢弃该播放状态信息。
在一些实施例中,该响应于该目标码率与该当前码率不相等,根据该媒体帧在该媒体流中的位置,确定目标位置,包括:响应于该目标码率与该当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为该目标位置,该目标媒体帧组为所述媒体帧所在媒体帧组。
在一些实施例中,该根据该播放状态信息以及当前码率,确定目标码率,包括:获取多个候选码率;根据该多个候选码率与该当前码率之间的关系、该播放状态信息以及该媒体流中该媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,该目标媒体帧组为所述媒体帧所在媒体帧组;根据该每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从该多个候选码率中,确定目标码率;其中,该每个候选码率对应的第二缓存量为将码率切换至候选码率后,该目标媒体帧组传输结束时对该媒体流已缓存但未播放的缓存量。
在一些实施例中,该根据该多个候选码率与该当前码率之间的关系、该播放状态信息以及该媒体流中该媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,包括:根据该媒体流中该媒体帧在该目标媒体帧组中的位置,获取该目标媒体帧组传输结束时对该媒体流的缓存增加量;根据该多个候选码率与该当前码率之间的关系对应的缓存位置,确定目标缓存过程中该媒体流的播放量,该缓存位置为继续缓存该目标媒体帧组时的缓存位置,该目标缓存过程为当前到基于该多个候选码率对该目标媒体帧组传输结束时的过程;根据该播放状态信息包括的第一缓存量、该缓存增加量和该播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对该媒体流已缓存且未播放的缓存量。
在一些实施例中,该根据该多个候选码率与该当前码率之间的关系对应的缓存位置,确定目标缓存过程中该媒体流的播放量,包括:根据该多个候选码率与该当前码率之间的关系,确定继续缓存该目标媒体帧组时的缓存位置;获取当前网络状态信息;根据该当前网络状态信息、该缓存位置、目标媒体帧组的长度以及该多个候选码率,确定该目标缓存过程中该媒体流的播放量。
在一些实施例中,响应于任一候选码率与该当前码率相等,该缓存位置为该媒体帧的下一个媒体帧所在位置;或者,响应于任一候选码率与该当前码率不相等,该缓存位置为该目标媒体帧组的第一个媒体帧所在位置。
在一些实施例中,该当前对该媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值; 该根据该每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从该多个候选码率中,确定目标码率,包括:响应于该多个候选码率对应的第二缓存量中至少一个第二缓存量大于该第一缓存量阈值,将该至少一个第二缓存量中最大的候选码率确定为该目标码率,该目标码率大于或等于该当前码率;或,响应于该多个候选码率对应的第二缓存量中不包括大于该第一缓存量阈值的第二缓存量,将当前码率确定为该目标码率,该目标码率大于或等于该当前码率。
在一些实施例中,该当前对该媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值;该根据该每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从该多个候选码率中,确定目标码率,包括:响应于该多个候选码率对应的第二缓存量中至少一个第二缓存量大于该第二缓存量阈值,将该至少一个第二缓存量中最大的候选码率确定为该目标码率,该目标码率小于或等于该当前码率;或,响应于该多个候选码率对应的第二缓存量中不包括大于该第二缓存量阈值的第二缓存量,将该多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为该目标码率,该目标码率小于或等于该当前码率。
图3是根据一示例性实施例示出的一种码率切换方法的流程图,该方法应用于电子设备中,在本实施例中,以该电子设备为服务器为例进行了说明,该方法包括以下步骤。
在S31中,服务器发送媒体流中媒体帧。
在S32中,服务器获取终端对该媒体流的播放状态信息。
在S33中,服务器响应于该播放状态信息符合码率切换条件,根据该媒体帧在该媒体流中的位置,确定目标位置。
在S34中,服务器基于该目标位置和目标码率,向该终端发送该媒体流中该目标位置开始的媒体帧。
在一些实施例中,该播放状态信息包括第一缓存量,该第一缓存量为当前对该媒体流已缓存且未播放的缓存量;该码率切换条件包括该第一缓存量大于第一缓存量阈值或者该第一缓存量小于第二缓存量阈值,其中,该第二缓存量阈值小于该第一缓存量阈值。
在一些实施例中,该播放状态信息包括该媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;所述码率切换条件包括下述任一项:卡顿次数大于次数阈值或者卡顿次数小于次数阈值;上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;丢帧率大于第一丢帧率阈值;丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;目标时间段内的丢帧率大于第一丢帧率阈值;目标时间段内的丢帧率小于第二丢帧率阈值。
在一些实施例中,该响应于该播放状态信息符合码率切换条件,根据该媒体帧在该媒体流中的位置,确定目标位置,包括:响应于该播放状态信息符合码率切换条件,根据该播放状态信息以及当前码率,确定目标码率;响应于该目标码率与该当前码率不相等,执行该根据该媒体帧在该媒体流中的位置,确定目标位置。
在一些实施例中,该方法还包括:响应于该目标码率与当前码率相等,继续基于当前码率向该终端传输该媒体帧的下一个媒体帧。
在一些实施例中,该响应于该目标码率与该当前码率不相等,执行该根据该媒体帧在该媒体流中的位置,确定目标位置,包括:响应于该目标码率与该当前码率不相等,将目标媒 体帧组中的第一个媒体帧所在位置确定为该目标位置,该目标媒体帧组为所述媒体帧所在媒体帧组。
在一些实施例中,该根据该播放状态信息以及当前码率,确定目标码率,包括:获取多个候选码率;根据该多个候选码率与该当前码率之间的关系、该播放状态信息以及该媒体流中该媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,该目标媒体帧组为所述媒体帧所在媒体帧组;根据该每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从该多个候选码率中,确定目标码率;其中,该每个候选码率对应的第二缓存量为将码率切换至候选码率后,该目标媒体帧组传输结束时对该媒体流已缓存但未播放的缓存量。
在一些实施例中,该根据该多个候选码率与该当前码率之间的关系、该播放状态信息以及该媒体流中该媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,包括:根据该媒体流中该媒体帧在该目标媒体帧组中的位置,获取该目标媒体帧组传输结束时对该媒体流的缓存增加量;根据该多个候选码率与该当前码率之间的关系对应的缓存位置,确定目标缓存过程中该媒体流的播放量,该缓存位置为继续缓存该目标媒体帧组时的缓存位置,该目标缓存过程为当前到基于该多个候选码率对该目标媒体帧组传输结束时的过程;根据该播放状态信息包括的第一缓存量、该缓存增加量和该播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对该媒体流已缓存且未播放的缓存量。
在一些实施例中,该根据该多个候选码率与该当前码率之间的关系对应的缓存位置,确定目标缓存过程中该媒体流的播放量,包括:根据该多个候选码率与该当前码率之间的关系,确定继续缓存该目标媒体帧组时的缓存位置;获取当前网络状态信息;根据该当前网络状态信息、该缓存位置、目标媒体帧组的长度以及该多个候选码率,确定该目标缓存过程中该媒体流的播放量。
在一些实施例中,响应于任一候选码率与该当前码率相等,该缓存位置为该媒体帧的下一个媒体帧所在位置;或者,响应于任一候选码率与该当前码率不相等,该缓存位置为该目标媒体帧组的第一个媒体帧所在位置。
在一些实施例中,该当前对该媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值;该根据该每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从该多个候选码率中,确定目标码率,包括:响应于该多个候选码率对应的第二缓存量中至少一个第二缓存量大于该第一缓存量阈值,将该至少一个第二缓存量中最大的候选码率确定为该目标码率,该目标码率大于或等于该当前码率;或,响应于该多个候选码率对应的第二缓存量中不包括大于该第一缓存量阈值的第二缓存量,将当前码率确定为该目标码率,该目标码率大于或等于该当前码率。
在一些实施例中,该当前对该媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值;该根据该每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从该多个候选码率中,确定目标码率,包括:响应于该多个候选码率对应的第二缓存量中至少一个第二缓存量大于该第二缓存量阈值,将该至少一个第二缓存量中最大的候选码率确定为该目标码率,该目标码率小于或等于该当前码率;或,响应于该多个候选码率对应的第二缓存量中不包括大于该第二缓存量阈值的第二缓存量,将该多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为该目标码率,该目标码率小于或等于该当前码率。
以上从终端和服务器单侧介绍了本公开实施例提供的方法实施例,以下通过另一个方法 实施例从终端和服务器之间进行交互的角度出发,对本公开实施例进行示例性说明。
图4是根据一示例性实施例示出的一种码率切换方法的流程图,参见图4,该方法包括以下步骤。
在S40中,服务器发送媒体流中的媒体帧。
在S41中,终端接收媒体流中的媒体帧。
其中,终端可以为用户使用的终端,该终端可以与服务器通过有线网络或无线网络相连,该服务器可以用于提供多种码率的媒体流。媒体流可以包括若干媒体帧,该媒体帧可以为音频帧,也可以为图像帧,该若干媒体帧可以通过对原始媒体资源采样得到。终端在接收媒体流时,可以从服务器源源不断地获取的媒体流中的若干媒体帧,再播放获取的媒体帧,实现媒体流的传输和播放。
具体地,终端可以与服务器通过有线网络或无线网络相连,该服务器可以用于提供多种码率的媒体流,能够以多种码率向终端发送媒体流。媒体流可以包括若干媒体帧,该媒体帧可以为音频帧,也可以为图像帧,该若干媒体帧可以通过对原始媒体资源采样得到。终端可以从服务器源源不断地获取的媒体流中的若干媒体帧,再播放获取的媒体帧,实现媒体流的传输和播放。
终端上可以安装有应用程序,该应用程序用于浏览媒体流,例如,该应用程序可以包括短视频应用、直播应用、视频点播应用、社交应用或者购物应用中至少一项,本公开实施例不对应用程序的类型进行具体限定。
本公开实施例所涉及的媒体流,包括但不限于:视频资源、音频资源、图像资源或者文本资源中至少一项,本公开实施例不对媒体流的类型进行具体限定。比如,该媒体流为网络主播的直播视频流,或者为预存在服务器上的历史点播视频,或者为电台主播的直播音频流,或者为预存在服务器上的历史点播音频。
在上述过程中,用户可以在终端上启动应用程序,该应用程序显示资源推送界面,例如该资源推送界面可以是应用程序的首页或者功能界面,本公开实施例不对资源推送界面的类型进行具体限定。在该资源推送界面中可以包括至少一个媒体流的缩略信息,该缩略信息包括媒体流的标题、简介、海报、预告片或者精彩片段中至少一项。用户在浏览资源推送界面的过程中,可以点击感兴趣的媒体流的缩略信息,响应于用户对该媒体流的缩略信息的触控操作,终端可以从资源推送界面跳转至资源播放界面。
在S42中,终端获取媒体流的播放状态信息。
终端接收到该媒体流中的媒体帧,可以获取该媒体流的播放状态信息,该播放状态信息可以用于判断是否需要切换媒体流的传输码率。需要说明的是,上述S40和S41中,服务器和终端之间传输的媒体帧可以为该媒体流中的任一媒体帧。也就是说,终端在传输媒体流中的任意时间点,均可以开始执行码率切换的步骤。该任意时间点可以根据业务需要进行确定,使得终端可以每隔一段固定的时间,就开始自动执行码率切换的步骤,也可以由技术人员手动控制终端执行码率切换的步骤,本公开对此不做限定。
在另一些实施例中,该媒体流的播放状态信息还可以由服务器获取,服务器可以在发送媒体流的过程中,获取终端上媒体流的播放状态信息,进而为该终端确定是否需要提供码率切换步骤。
需要说明的是,本公开所提供的码率切换方法可以应用于直播场景或点播场景,终端可以向服务器或通过服务器向主播请求媒体流。
在S43中,终端可以响应于播放状态信息符合码率切换条件,根据播放状态信息以及当前码率,确定目标码率。
其中,播放状态信息能够代表终端播放媒体流的情况,当播放状态信息符合码率切换条件时,终端可以对此作出响应,确定并将码率切换为可优化媒体流的播放效果的目标码率。
通过自适应功能,将码率调整为与当前的网络带宽信息对应的码率,在进行自适应调整的过程中,除了当前的网络带宽信息之外,还可以结合终端的播放状态信息,动态选择播放效果最佳的目标码率,从而在媒体流的卡顿率、清晰度以及平滑性之间取得折中。
在一些实施例中,终端确定目标码率后,可以获取该目标码率对应的媒体流的地址信息,即目标地址信息,相应地,终端可以触发帧获取指令,该帧获取指令可以用于指示终端从媒体流的媒体描述文件包括的多种码率的媒体流的地址信息中,确定目标码率的媒体流的目标地址信息,为后续根据目标地址信息传输媒体流提供基础。下面对该码率切换判断和目标码率的获取过程进行详细说明。
在一些实施例中,播放状态信息可以包括第一缓存量,第一缓存量为当前对媒体流已缓存且未播放的缓存量。所述码率切换条件包括所述第一缓存量大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中,所述第二缓存量阈值小于所述第一缓存量阈值。也即是,在这些实施例中,码率切换条件包括两种,第一种为第一缓存量大于第一缓存量阈值。第二种为所述第一缓存量小于第二缓存量阈值。
在播放状态信息满足两种码率切换条件中的任一种时,终端均可以根据播放状态信息以及当前码率,确定目标码率。也即是,终端可以响应于第一缓存量大于第一缓存量阈值,根据播放状态信息以及当前码率,确定目标码率;或,第一缓存量小于第二缓存量阈值,根据播放状态信息以及当前码率,确定目标码率。
其中,终端在得到媒体流的媒体帧后,可以将得到的媒体帧存入缓存,等到需要播放媒体帧时,可以对缓存的媒体帧进行解码并按时间顺序播放。该第一缓存量可以通过已缓存且未播放的媒体流的时长来度量。例如,终端已缓存1000毫秒(ms),播放了400ms,则第一缓存量为600ms。
针对该码率切换条件的不同,上述播放状态信息符合码率切换条件时,根据播放状态信息以及当前码率,确定目标码率,可以包括两种情况:
情况一、响应于第一缓存量大于第一缓存量阈值,终端可以根据播放状态信息以及当前码率,确定目标码率,该目标码率大于或等于当前码率。
在情况一中,第一缓存量大于第一缓存量阈值,说明当前终端对媒体流已缓存且未播放的缓存量能够保证媒体流的流畅播放,而媒体流的码率越大,媒体流越清晰,因此可以考虑增大媒体流的下载码率。
情况二、响应于第一缓存量小于第二缓存量阈值,终端可以根据播放状态信息以及当前码率,确定目标码率,该目标码率小于或等于当前码率。
其中,第二缓存量阈值小于第一缓存量阈值,该第一缓存阈值和该第二缓存阈值可以是预先设定的缓存量阈值,也可以是临时设定的缓存量阈值。
在情况二中,第一缓存量小于第二缓存量阈值时,可以代表当前终端对媒体流已缓存且未播放的缓存量可能无法保证媒体流的流畅播放,而媒体流的码率越小,在相同时间内,终端能够缓存的媒体流越多,增加了缓存也就能够使媒体流的播放更加流畅,因此可以考虑减小媒体流的下载码率。
第一缓存量与第一缓存量阈值、第二缓存量阈值之间的关系除了上述两种情况中所示的关系外,还可以具有一种可能情况:第一缓存量小于或等于第一缓存量阈值,且大于或等于第二缓存量阈值。此时可以说明当前终端对媒体流已缓存且未播放的缓存量符合媒体流的播放要求,且可能刚好符合要求,此时可以不改变媒体流的下载码率。
例如,第一缓存量阈值可以用q h表示,第二缓存量阈值可以用q l表示,第一缓存量可以用q c表示。当q c>q h时,媒体流播放发生卡顿的概率很小,此时可以考虑增大媒体流的码率,当q c<q h时,媒体流播放发生卡顿的概率很大,此时可以考虑降低媒体流的码率。
在一些实施例中,通过两个阈值的设置,将第一缓存量与第一缓存阈值和第二缓存阈值进行对比,以此来判断是否对媒体流的码率进行切换,能够快速获知媒体流当前的播放效果。该第一缓存量大于第一缓存量阈值或小于第二缓存量阈值时,终端可以执行码率切换的步骤。但考虑到切换码率后,终端以目标码率接收媒体流不一定能够保证媒体流的正常播放,在确定目标码率时,可以通过第二缓存量与两个阈值进行对比,以此来判断码率切换后媒体流的播放情况是否会得到改善。
在一些实施例中,该目标码率的确定过程可以为对多个候选码率对应的播放效果进行判断,从而从多个候选码率中获取播放效果最好的候选码率作为目标码率。具体地,终端可以获取多个候选码率,根据多个候选码率与当前码率之间的关系、播放状态信息以及媒体流中媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,根据每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从多个候选码率中,确定目标码率。其中,所述目标媒体帧组为所述媒体帧所在媒体帧组。
其中,服务器中可以缓存有多种码率的媒体流,该多个候选码率即为服务器能够提供的媒体流的多种码率。媒体流可以包括多个媒体帧组,每个媒体帧组的长度可以根据业务需求进行预设,也可以由技术人员临时设置,本公开对此不做限定。每个媒体帧组可以包括多个媒体帧,多个媒体帧可以按时间顺序进行排列。媒体流中媒体帧在该目标媒体帧组中的位置可以通过终端从该目标媒体帧组的第一帧播放至该媒体帧所需的时长来表示。每个候选码率对应的第二缓存量可以代表将码率切换至该候选码率后,终端对目标媒体帧组传输结束时,已缓存但未播放的媒体流能够播放的时长。通过将每个候选码率对应的第二缓存量与第一缓存量阈值和第二缓存量阈值进行对比,能够判断码率切换后的播放效果,以此筛选出可以作为目标码率的候选码率。
例如,服务器中可以缓存有n种码率的媒体流,多个候选码率可以包括r 1,r 2,…r n。该目标媒体帧组的长度可以为D,从该目标媒体帧组的第一帧播放至该媒体帧所需的时长可以为d,可以用d表示该媒体帧在目标媒体帧组中的位置。另外,可以用q n表示第n个候选码率对应的第二缓存量。其中,D,d为正数,n为正整数。
通过获取多个候选码率,并根据多个候选码率与当前码率之间的关系、播放状态信息以及媒体流中媒体帧在该目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,再根据每个码率对应的第二缓存量与第一缓存量阈值和第二缓存量阈值之间的关系确定目标码率,提供了一种确定目标码率的方法,为实现终端的码率切换提供了基础。
在一些实施例中,该第二缓存量的获取过程可以为:终端可以根据媒体流中媒体帧在目标媒体帧组中的位置,获取目标媒体帧组传输结束时对媒体流的缓存增加量。终端根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为 当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程。然后终端根据播放状态信息包括的第一缓存量、缓存增加量和播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
其中,媒体帧在该目标媒体帧组中的位置可以通过终端从该目标媒体帧组的第一帧播放至该媒体帧所需的时长来表示,例如,单位可以为ms。终端将目标时间段内缓存的媒体流能够播放的时间作为缓存增加量,该目标时间段为接收到该媒体帧的时刻到目标媒体帧组传输结束的时刻之间的时间段。例如,终端接收到该媒体帧后,在目标时间段内缓存了10个媒体帧后,该目标媒体帧组的所有媒体帧均已接收到并缓存。在该目标时间段内缓存的这10个媒体帧播放时所需花费的时间就是缓存增加量。
终端获取该缓存增加量对应的媒体流是需要时间的,获取该缓存增加量对应的媒体流时,终端仍然在播放缓存的媒体流,在这段时间内,终端播放的媒体流的时长即为播放量。终端能够根据第一缓存量、缓存增加量和播放量,获取每个候选码率对应的第二缓存量。多个候选码率对应的第二缓存量能够表示终端切换至多个候选码率完成对当前正在传输的目标媒体帧组的传输时,已缓存且未播放的媒体流能够播放的时长。也即是每个候选码率对应的第二缓存量为将码率切换至该每个候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
例如,可以用以下公式表示第二数据缓存量:
q n=q c+D-d-q b
其中,q c为第一缓存量,q b为播放量,q n为第n个候选码率对应的第二缓存量。D为目标媒体帧组的长度,d为从该目标媒体帧组的第一帧播放至该媒体帧所需的时长,相应的,D-d可以表示缓存增加量。
通过获取缓存增加量和播放量,再结合获取的第一缓存量,能够得到每个候选码率的第二缓存量,提供了一种获得第二缓存量的方法,为后续根据第二缓存量与第一缓存量阈值和第二缓存量阈值的关系确定目标码率提供了基础。
在一些实施例中,在获取播放量时,还可以参考当前网络状态信息,来判断缓存完该目标媒体帧组所需时间,并判断这段时间会播放多少缓存量。具体地,终端可以根据多个候选码率与当前码率之间的关系,确定继续缓存目标媒体帧组时的缓存位置,获取当前网络状态信息,根据当前网络状态信息、缓存位置、目标媒体帧组的长度以及多个候选码率,确定目标缓存过程中媒体流的播放量。
其中,上述播放量为终端获取缓存增加量的目标时间段内,播放的媒体流的时长,可见该播放量与终端该目标时间段内获取媒体流的速度有关,即与终端的网络状态有关,该目标时间段内获取的媒体流也即是缓存增加量对应的媒体流。相应的,终端可以获取当前网络信息,该当前网络信息可以包括与当前时刻相近的一段时长内,终端的平均带宽。
终端继续缓存目标媒体帧组时的缓存位置与候选码率和当前码率之间的关系有关。响应于任一候选码率与所述当前码率相等,所述缓存位置为所述媒体帧的下一个媒体帧所在位置。响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
也即是,当候选码率与当前码率相同时,终端无需切换码率,可以从该媒体帧的下一帧开始继续缓存该目标媒体帧组。当候选码率与当前码率不同时,为了防止终端对媒体帧进行解码的过程中发生错误,终端可以从该目标媒体帧组的第一帧开始,缓存该目标媒体帧组。 确定了终端继续缓存该目标媒体帧组时的缓存位置后,终端能够结合获取的当前网络状态信息,目标媒体帧组的长度以及多个候选码率,确定目标缓存过程中的播放量,该目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程。
例如,可以用以下公式表示第二数据缓存量:
当r n=r c时,q n=q c+D-d-(D-d)*r c*8/B
当r n≠r c时,q n=q c+D-d-D*r n*8/B
其中,r c为当前码率,r n为第n个候选码率,q n为第n个候选码率对应的第二缓存量,q c为第一缓存量,D为该目标媒体帧组的长度,d为从该目标媒体帧组的第一帧播放至该媒体帧所需的时长,B为终端在与当前时刻相近的一段时长内的平均带宽,D-d可以表示缓存增加量。当候选码率与当前码率相同时,终端无需切换码率,可以从该媒体帧的下一帧开始继续缓存该目标媒体帧组,相应的,(D-d)*r c*8/B可以表示播放量。当候选码率与当前码率不同时,终端可以从该目标媒体帧组的第一帧开始,缓存该目标媒体帧组,相应的,D*r n*8/B可以表示播放量。
其中,对于平均带宽,还可以利用以下公式得到终端在与当前时刻相近的一段时长内的平均带宽B:
B=S*8/T
其中,S为终端在与当前时刻相近的一段时长内下载的媒体流的数据量,T为与当前时刻相近的一段时长,例如,T可以取500毫秒。
通过确定继续缓存目标媒体帧组时的缓存位置,获取当前网络状态信息,结合目标媒体帧组的长度和多个候选码率,确定目标缓存过程中媒体流的播放量,提供了一种得到播放量的方法。
在一些实施例中,对于上述情况一,终端可以响应于多个候选码率对应的第二缓存量中至少一个第二缓存量大于第一缓存量阈值,将该至少一个第二缓存量对应的候选码率中,最大的候选码率确定为目标码率。终端也可以响应于多个候选码率对应的第二缓存量中不包括大于第一缓存量阈值的第二缓存量,将当前码率确定为目标码率。
其中,对于上述情况一,第一缓存量大于第一缓存量阈值,也就是说,当前终端对媒体流已缓存且未播放的缓存量能够保证媒体流的流畅播放,此时可以考虑增大媒体流的下载码率。
当多个候选码率对应的第二缓存量中至少一个第二缓存量大于第一缓存量阈值时,该至少一个第二缓存量对应的至少一个候选码率能够保证媒体流的正常播放,相应的,终端可以将至少一个第二缓存量对应的候选码率中,最大的候选码率确定为目标码率,且该候选码率可以大于当前码率。
当多个候选码率对应的第二缓存量中不包括大于第一缓存量阈值的第二缓存量时,说明多个候选码率中,没有能够在保证媒体流的正常播放的同时,增强媒体流的清晰度的码率,因此终端可以将当前码率确定为目标码率,以当前码率继续缓存媒体流。
例如,当前码率可以用r c表示,目标码率用r表示,第n个候选码率可以用r n表示,第n个候选码率对应的第二缓存量可以用q n表示,第一缓存量阈值可以用q h表示。如果对于任意的r n>r c,不存在q n>q h,则取r=r c。如果对于任意的r n>r c,存在q n>q h,则取满足q n>q h的r n中,最大的r n作为目标码率。
通过将第二缓存量大于第一缓存量阈值的至少一个候选码率中,最大的候选码率确定为 目标码率,或将当前码率确定为目标码率。
在一些实施例中,对于上述情况一,当多个候选码率对应的第二缓存量中至少一个第二缓存量大于第一缓存量阈值时,终端可以将该至少一个第二缓存量对应的大于当前码率的候选码率中,最小的候选码率确定为目标码率。
其中,该至少一个第二缓存量对应的大于当前码率的候选码率中的每个候选码率均可以在保证媒体流能够正常播放的同时,增强媒体流的清晰度,选择其中最小的码率作为目标码率。
在一些实施例中,对于上述情况二,终端可以响应于多个候选码率对应的第二缓存量中至少一个第二缓存量大于第二缓存量阈值,将至少一个第二缓存量对应的候选码率中,最大的候选码率确定为目标码率。终端也可以响应于多个候选码率对应的第二缓存量中不包括大于第二缓存量阈值的第二缓存量,将多个候选码率对应的第二缓存量中,最大的第二缓存量对应的候选码率确定为目标码率。
其中,对于上述情况二,第一缓存量小于第二缓存量阈值,也就是说,当前终端对媒体流已缓存且未播放的缓存量不能保证媒体流的流畅播放,此时可以考虑减小媒体流的下载码率。当多个候选码率对应的第二缓存量中至少一个第二缓存量大于第二缓存量阈值时,该至少一个第二缓存量对应的至少一个候选码率能够保证媒体流的正常播放,相应的,终端可以将至少一个第二缓存量对应的候选码率中,最大的候选码率确定为目标码率。当多个候选码率对应的第二缓存量中不包括大于第二缓存量阈值的第二缓存量时,说明多个候选码率中,没有能够保证媒体流的正常播放的码率,因此终端可以将多个候选码率对应的第二缓存量中,最大的第二缓存量对应的候选码率确定为目标码率。
例如,当前码率可以用r c表示,目标码率用r表示,第n个候选码率可以用r n表示,第n个候选码率对应的第二缓存量可以用q n表示,第二缓存量阈值可以用q l表示。如果对于任意的r n,不存在q n≥q l,则取最大的q n对应的r n作为目标码率。如果对于任意的r n,存在q n≥q l,则取满足q n≥q l的r n中,最大的r n作为目标码率。
将至少一个大于第二缓存量阈值的第二缓存量对应的候选码率中,最大的候选码率确定为目标码率,或将多个候选码率对应的第二缓存量中,最大的第二缓存量对应的候选码率确定为目标码率。
需要说明的是,上述S43可以为本公开实施例的可选步骤,在一些实施例中,目标码率也可以为预设的码率,或者为码率选择指令中所指示的码率,例如,用户可以选择切换码率,并指定目标码率。相应地,终端可以根据该目标码率,执行下述S44,本公开对获取目标码率的方式不做限定。
上述均以播放状态信息包括第一缓存量为例进行说明,在另一些实施例中,播放状态信息可以包括媒体流播放过程中的卡顿信息或丢帧率中至少一项,相应地,播放状态信息符合码率切换条件可以为卡顿信息或丢帧率中任一项满足码率切换条件。
其中,卡顿信息可以包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项。相应地,码率切换条件可以包括多种情况,例如:卡顿次数大于次数阈值,上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时长大于时长阈值等,在这些情况下,终端可以考虑降低码率。当然,码率切换条件也可以包括卡顿次数小于次数阈值,上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值,上一次卡顿时长小于时长阈值,在这些情况下,终端 可以考虑提高码率。
对于丢帧率,相应地,码率切换条件可以包括丢帧率大于第一丢帧率阈值,码率切换条件也可以为丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值。在一些实施例中,该丢帧率还可以为目标时间段内的丢帧率,例如,过去一分钟内的丢帧率,通过一段时间内的丢帧率来判断这段时间的媒体流传输情况,从而来判断是否需要调整码率。
在S44中,终端可以响应于播放状态信息符合码率切换条件,根据媒体帧在媒体流中的位置,确定目标位置。
其中,终端获取的播放状态信息符合码率切换条件时,会将当前码率切换为目标码率,以优化媒体流的播放效果。由于目标码率可能与当前码率不同,根据终端对媒体帧解码时的参考关系,终端切换码率后开始下载媒体帧的位置可能不同,即在码率切换情况不同时,目标位置会发生变化。
在一些实施例中,终端能够响应于目标码率与当前码率相等,丢弃播放状态信息,而不再确定目标位置。终端也可以响应于目标码率与当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为目标位置。
其中,如果目标码率与当前码率相同,则终端传输媒体流的码率没有发生变化,因此可以继续基于当前码率,从该媒体帧的下一个媒体帧在目标媒体帧组中的位置传输媒体帧,相应地,终端可以丢弃获取的播放状态信息。如果目标码率与当前码率不相同,码率发生了变化,该目标媒体帧组的码率需要保持一致,因而,可以重新按照目标码率传输该目标媒体帧组的媒体帧。终端可以从该目标媒体帧组中,第一媒体帧所在的位置开始传输媒体帧。
例如,如图5所示,终端当前正在传输的媒体流可以包括两个媒体帧组,每个媒体帧组中可以包括多个媒体帧,每个媒体帧均对应于一个时间戳。第一个媒体帧组中的媒体帧按时间戳的排列顺序可以为[1000,2000,3000,4000,5000,6000],第二个媒体帧组中的媒体帧按时间戳的排列顺序可以为[7000,8000,9000,10000,11000,12000]。以终端正在接收第二媒体帧组中,时间戳为8000的媒体帧为例进行说明,如果终端接收到时间戳为8000的媒体帧后,确定出的目标码率与当前码率相同,则无需进行码率切换,也无需向服务器发送帧获取请求,可以继续接收从时间戳为9000的媒体帧开始的媒体帧。如果终端接收到时间戳为8000的媒体帧后,确定出的目标码率与当前码率不同,则可以进行码率切换,向服务器发送帧获取请求,并为了使媒体帧组的码率保持一致,可以从时间戳为7000的媒体帧开始重新获取该媒体帧组中的媒体帧。通过根据目标码率与当前码率的大小关系,重新确定开始传输媒体帧的目标位置。
在S45中,终端基于目标码率和目标位置,向服务器发送帧获取请求。
终端确定目标码率和目标位置后,可以向服务器发送帧获取请求,该帧获取请求用于指示服务器基于目标码率返回媒体流中目标位置开始的媒体帧,进而,终端能够获取该目标码率对应的媒体流中,目标位置开始的媒体帧,以进行传输。
需要说明的是,该目标码率可能与当前码率相同,也可能与当前码率不同。如果目标码率与当前码率相同,则终端可以保持当前码率继续从服务器接收媒体流的媒体帧,也就是说,目标码率与当前码率相同时,终端可以不对码率进行切换,相应地,终端可以不向服务器发送帧获取请求。如果目标码率与当前码率不同,则终端可以将当前码率切换为目标码率,基于目标码率从服务器获取媒体帧,也就是说,目标码率与当前码率不同时,终端可以对码率进行切换,相应地,终端可以向服务器发送帧获取请求。
在一些实施例中,目标码率与当前码率相等时,终端可以丢弃播放状态信息,不向服务器发送帧获取请求,而是保持当前码率继续接收媒体流中的媒体帧,直至下一次获取媒体流的播放状态信息。
在一些实施例中,如果目标码率与当前码率不同,则终端可以断开与服务器的链接,重新向服务器发送帧获取请求,以请求该服务器以目标码率发送该目标位置开始的媒体帧。该终端也可以不断开与服务器的链接,而重新发送帧获取请求,则终端可能会接收到多个码率的媒体流,在播放媒体流时,可以优先播放高码率的媒体流。不断开链接以请求切换后的码率的媒体帧,能够保证以目标码率获取的媒体帧存在问题时,能够播放切换前码率的媒体帧。
在S46中,服务器基于目标码率和目标位置,向终端发送媒体流中目标位置开始的媒体帧。
终端确定目标码率和目标位置后,可以向服务器发送帧获取请求,相应地,服务器可以接收并解析该帧获取请求,进而,服务器能够根据解析得到的目标码率和目标位置,向终端发送该目标码率对应的媒体流中,目标位置开始的媒体帧,以进行媒体流的传输。
上述对播放状态信息符合码率切换条件的情况进行了说明,在一些实施例中,当播放状态信息不符合码率切换条件时,终端可以继续基于当前码率对媒体流中媒体帧的下一个媒体帧进行传输。
需要说明的是,本公开所提供的码率切换方法,采用流式传输方法传输媒体流,实现了帧级传输,在传输媒体帧的过程能够自适应调整码率,终端向服务器发送的帧获取请求可以为FAS请求,以请求切换后的码率对应的媒体帧。
以上介绍了以终端为主要执行主体的方法实施例,以下以服务器为主要执行主体,对本公开实施例进行示例性说明。
图6是根据一示例性实施例示出的一种码率切换方法的流程图,参见图6,该方法包括以下步骤。
在S60中,服务器发送媒体流中的媒体帧。
在S61中,服务器获取终端对媒体流的播放状态信息。
其中,终端可以为用户使用的终端,该终端可以与服务器通过有线网络或无线网络相连,该服务器可以用于提供多种码率的媒体流。媒体流可以包括若干媒体帧,该媒体帧可以为音频帧,也可以为图像帧,该若干媒体帧可以通过对原始媒体资源采样得到。终端在接收媒体流时,可以从服务器源源不断地获取的媒体流中的若干媒体帧,再播放获取的媒体帧,实现媒体流的传输和播放。
服务器可以获取终端对该媒体流的播放状态信息,该播放状态信息可以用于判断是否需要切换媒体流的传输码率。服务器发送的媒体帧可以为该媒体流中的任一媒体帧。也就是说,服务器在发送媒体流中的任意时间点,均可以开始执行码率切换的步骤。该任意时间点可以根据业务需要进行确定,使得服务器可以每隔一段固定的时间,就开始自动执行码率切换的步骤,也可以由技术人员手动控制服务器执行码率切换的步骤,本公开对此不做限定。
在一些实施例中,服务器可以向终端发送播放状态信息获取请求,以使终端将终端的播放状态信息发送给服务器,进而,服务器可以为终端确定是否需要执行码率切换步骤。该播放状态信息也可以是由终端主动发送给服务器的,本申请对服务器获取播放状态信息的方式不做限定。
在S62中,服务器可以响应于播放状态信息符合码率切换条件,根据播放状态信息以及 当前码率,确定目标码率。
上述S62与上述S43类似,仅存在执行主体可以由终端变为服务器的区别,这里不做赘述。
需要说明的是,上述S62可以为本公开实施例的可选步骤,在一些实施例中,目标码率也可以为预设的码率,或者为码率选择指令中所指示的码率,例如,服务器可以选择切换码率,并指定目标码率。相应地,服务器可以根据该目标码率,执行下述S63所述的步骤,本公开对获取目标码率的方式不做限定。
在S63中,服务器可以响应于播放状态信息符合码率切换条件,根据媒体帧在媒体流中的位置,确定目标位置。
上述S63与上述S44类似,仅存在执行主体可以由终端变为服务器的区别,这里不做赘述。
在S64中,服务器基于目标码率和目标位置,向终端发送媒体流中目标位置开始的媒体帧。
上述S64与上述S45类似,执行主体可以由终端变为服务器,相应地,当服务器确定目标码率和目标位置后,可以直接根据目标码率和目标位置,找到目标码率对应的媒体流中,目标位置开始的媒体帧,并以目标码率从该媒体帧开始向终端发送媒体流,以进行媒体流的传输。服务器确定目标码率和目标位置以及向终端发送媒体流所执行的步骤与图4所示的实施例类似,这里不做赘述。
以上介绍了本公开实施例提供的方法实施例,以下对本公开实施例提供的虚拟装置进行示例性说明。
图7是根据一示例性实施例示出的一种码率切换装置的框图,该装置包括:
获取模块701,用于接收媒体流中的媒体帧;获取该媒体流的播放状态信息。
确定模块702,用于响应于该播放状态信息符合码率切换条件,根据该媒体帧在该媒体流中的位置,确定目标位置。
发送模块703,用于基于该目标位置,向服务器发送帧获取请求,该帧获取请求用于指示该服务器,基于目标码率返回该媒体流中该目标位置开始的媒体帧。
在一些实施例中,所述播放状态信息包括第一缓存量,所述码率切换条件包括所述第一缓存量大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中所述第一缓存量为当前对所述媒体流已缓存且未播放的缓存量,所述第二缓存量阈值小于所述第一缓存量阈值。
在一些实施例中,该播放状态信息包括该媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;所述码率切换条件包括下述任一项:卡顿次数大于次数阈值或者卡顿次数小于次数阈值;上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;丢帧率大于第一丢帧率阈值;丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;目标时间段内的丢帧率大于第一丢帧率阈值;目标时间段内的丢帧率小于第二丢帧率阈值。
在一些实施例中,该发送模块703用于响应于该目标码率与当前码率相等,基于该目标位置向服务器发送帧获取请求。
在一些实施例中,该确定模块702用于:响应于该播放状态信息符合码率切换条件,根据该播放状态信息以及当前码率,确定目标码率;响应于该目标码率与当前码率不相等,根据该媒体帧在该媒体流中的位置,确定目标位置。
在一些实施例中,该确定模块702还用于响应于该目标码率与该当前码率相等,丢弃该播放状态信息。
在一些实施例中,该确定模块702用于响应于所述目标码率与所述当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为所述目标位置,所述目标媒体帧组为所述媒体帧所在媒体帧组。
在一些实施例中,该确定模块702用于:获取多个候选码率;根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,所述目标媒体帧组为所述媒体帧所在媒体帧组;根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率;其中,所述每个候选码率对应的第二缓存量为将码率切换至候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
在一些实施例中,该确定模块702用于:根据所述媒体流中所述媒体帧在所述目标媒体帧组中的位置,获取所述目标媒体帧组传输结束时对所述媒体流的缓存增加量;根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程;根据所述播放状态信息包括的第一缓存量、所述缓存增加量和所述播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
在一些实施例中,该确定模块702用于:根据所述多个候选码率与所述当前码率之间的关系,确定继续缓存所述目标媒体帧组时的缓存位置;获取当前网络状态信息;根据所述当前网络状态信息、所述缓存位置、目标媒体帧组的长度以及所述多个候选码率,确定所述目标缓存过程中所述媒体流的播放量。
在一些实施例中,响应于任一候选码率与所述当前码率相等,所述缓存位置为所述媒体帧的下一个媒体帧所在位置;或者,响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
在一些实施例中,该当前对该媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值。该确定模块702用于:响应于该多个候选码率对应的第二缓存量中至少一个第二缓存量大于该第一缓存量阈值,将该至少一个第二缓存量中最大的候选码率确定为该目标码率,该目标码率大于或等于该当前码率。或,响应于该多个候选码率对应的第二缓存量中不包括大于该第一缓存量阈值的第二缓存量,将当前码率确定为该目标码率,该目标码率大于或等于该当前码率。
在一些实施例中,该当前对该媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值。该确定模块702用于:响应于该多个候选码率对应的第二缓存量中至少一个第二缓存量大于该第二缓存量阈值,将该至少一个第二缓存量中最大的候选码率确定为该目标码率,该目标码率小于或等于该当前码率。或,响应于该多个候选码率对应的第二缓存量中不包括大于该第二缓存量阈值的第二缓存量,将该多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为该目标码率,该目标码率小于或等于该当前码率。
需要说明的是:上述实施例提供的码率切换装置在切换码率时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的码率切换装置与码率切换方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图8是根据一示例性实施例示出的一种码率切换装置的框图,该装置包括:
获取模块801,用于发送媒体流中媒体帧;获取终端对该媒体流的播放状态信息。
确定模块802,用于响应于该播放状态信息符合码率切换条件,根据该媒体帧在该媒体流中的位置,确定目标位置。
发送模块803,用于基于该目标位置和目标码率,向该终端发送该媒体流中该目标位置开始的媒体帧。
在一些实施例中,所述播放状态信息包括第一缓存量,所述第一缓存量为当前对所述媒体流已缓存且未播放的缓存量;所述码率切换条件包括所述第一缓存量大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中,所述第二缓存量阈值小于所述第一缓存量阈值。
在一些实施例中,该播放状态信息包括该媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;所述码率切换条件包括下述任一项:卡顿次数大于次数阈值或者卡顿次数小于次数阈值;上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;丢帧率大于第一丢帧率阈值;丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;目标时间段内的丢帧率大于第一丢帧率阈值;目标时间段内的丢帧率小于第二丢帧率阈值。
在一些实施例中,该确定模块802用于:响应于该播放状态信息符合码率切换条件,根据该播放状态信息以及当前码率,确定目标码率;响应于该目标码率与该当前码率不相等,根据该媒体帧在该媒体流中的位置,确定目标位置。
在一些实施例中,该确定模块802还用于响应于该目标码率与当前码率相等,继续基于当前码率向该终端传输该媒体帧的下一个媒体帧。
在一些实施例中,该确定模块802用于响应于所述目标码率与所述当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为所述目标位置,所述目标媒体帧组为所述媒体帧所在媒体帧组。
在一些实施例中,该确定模块802用于:获取多个候选码率;根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,所述目标媒体帧组为所述媒体帧所在媒体帧组;根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率;其中,所述每个候选码率对应的第二缓存量为将码率切换至候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
在一些实施例中,该确定模块802用于:根据所述媒体流中所述媒体帧在所述目标媒体帧组中的位置,获取所述目标媒体帧组传输结束时对所述媒体流的缓存增加量;根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的 播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程;根据所述播放状态信息包括的第一缓存量、所述缓存增加量和所述播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
在一些实施例中,该确定模块802用于:根据所述多个候选码率与所述当前码率之间的关系,确定继续缓存所述目标媒体帧组时的缓存位置;获取当前网络状态信息;根据所述当前网络状态信息、所述缓存位置、目标媒体帧组的长度以及所述多个候选码率,确定所述目标缓存过程中所述媒体流的播放量。
在一些实施例中,响应于任一候选码率与所述当前码率相等,所述缓存位置为所述媒体帧的下一个媒体帧所在位置;或者,响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
在一些实施例中,所述当前对所述媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值;该确定模块802用于:响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第一缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率大于或等于所述当前码率;或,响应于所述多个候选码率对应的第二缓存量中不包括大于所述第一缓存量阈值的第二缓存量,将当前码率确定为所述目标码率,所述目标码率大于或等于所述当前码率。
在一些实施例中,所述当前对所述媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值。该确定模块802用于:响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第二缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率;或,响应于所述多个候选码率对应的第二缓存量中不包括大于所述第二缓存量阈值的第二缓存量,将所述多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率。
需要说明的是:上述实施例提供的码率切换装置在切换码率时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的码率切换装置与码率切换方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
以上介绍了本公开实施例提供的虚拟装置,以下对本公开实施例提供的硬件装置进行示例性说明。
上述方法实施例中的终端可以实现为如下终端,例如,图9示出了本公开一个示例性实施例提供的终端900的结构框图。该终端900可以是:智能手机、平板电脑、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。终端900还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。
通常,终端900包括有:一个或多个处理器901和一个或多个存储器902。
处理器901可以包括一个或多个处理核心,比如4核心处理器、9核心处理器等。处理器901可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field- Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器901也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器901可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器901还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器902可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器902还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器902中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器901所执行以实现本公开中方法实施例提供的码率切换方法。
在一些实施例中,终端900还可选包括有:外围设备接口903和至少一个外围设备。处理器901、存储器902和外围设备接口903之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口903相连。具体地,外围设备包括:射频电路904、触摸显示屏905、摄像头组件906、音频电路907、定位组件908和电源909中的至少一种。
外围设备接口903可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器901和存储器902。在一些实施例中,处理器901、存储器902和外围设备接口903被集成在同一芯片或电路板上;在一些其他实施例中,处理器901、存储器902和外围设备接口903中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
射频电路904用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路904通过电磁信号与通信网络以及其他通信设备进行通信。射频电路904将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。在一些实施例中,射频电路904包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路904可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及9G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路904还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本公开对此不加以限定。
显示屏905用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏905是触摸显示屏时,显示屏905还具有采集在显示屏905的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器901进行处理。此时,显示屏905还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏905可以为一个,设置终端900的前面板;在另一些实施例中,显示屏905可以为至少两个,分别设置在终端900的不同表面或呈折叠设计;在再一些实施例中,显示屏905可以是柔性显示屏,设置在终端900的弯曲表面上或折叠面上。甚至,显示屏905还可以设置成非矩形的不规则图形,也即异形屏。显示屏905可以采用 LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
摄像头组件906用于采集图像或视频。在一些实施例中,摄像头组件906包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端900的前面板,后置摄像头设置在终端900的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件906还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。
音频电路907可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器901进行处理,或者输入至射频电路904以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端900的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器901或射频电路904的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路907还可以包括耳机插孔。
定位组件908用于定位终端900的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件908可以是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。
电源909用于为终端900中的各个组件进行供电。电源909可以是交流电、直流电、一次性电池或可充电电池。当电源909包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。
在一些实施例中,终端900还包括有一个或多个传感器910。该一个或多个传感器910包括但不限于:加速度传感器911、陀螺仪传感器912、压力传感器913、指纹传感器914、光学传感器915以及接近传感器916。
加速度传感器911可以检测以终端900建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器911可以用于检测重力加速度在三个坐标轴上的分量。处理器901可以根据加速度传感器911采集的重力加速度信号,控制触摸显示屏905以横向视图或纵向视图进行用户界面的显示。加速度传感器911还可以用于游戏或者用户的运动数据的采集。
陀螺仪传感器912可以检测终端900的机体方向及转动角度,陀螺仪传感器912可以与加速度传感器911协同采集用户对终端900的3D动作。处理器901根据陀螺仪传感器912采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。
压力传感器913可以设置在终端900的侧边框和/或触摸显示屏905的下层。当压力传感器913设置在终端900的侧边框时,可以检测用户对终端900的握持信号,由处理器901根据压力传感器913采集的握持信号进行左右手识别或快捷操作。当压力传感器913设置在触摸显示屏905的下层时,由处理器901根据用户对触摸显示屏905的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单 控件中的至少一种。
指纹传感器914用于采集用户的指纹,由处理器901根据指纹传感器914采集到的指纹识别用户的身份,或者,由指纹传感器914根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器901授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器914可以被设置终端900的正面、背面或侧面。当终端900上设置有物理按键或厂商Logo时,指纹传感器914可以与物理按键或厂商Logo集成在一起。
光学传感器915用于采集环境光强度。在一个实施例中,处理器901可以根据光学传感器915采集的环境光强度,控制触摸显示屏905的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏905的显示亮度;当环境光强度较低时,调低触摸显示屏905的显示亮度。在另一个实施例中,处理器901还可以根据光学传感器915采集的环境光强度,动态调整摄像头组件906的拍摄参数。
接近传感器916,也称距离传感器,通常设置在终端900的前面板。接近传感器916用于采集用户与终端900的正面之间的距离。在一个实施例中,当接近传感器916检测到用户与终端900的正面之间的距离逐渐变小时,由处理器901控制触摸显示屏905从亮屏状态切换为息屏状态;当接近传感器916检测到用户与终端900的正面之间的距离逐渐变大时,由处理器901控制触摸显示屏905从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图9中示出的结构并不构成对终端900的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
上述方法实施例中的服务器可以实现为如下服务器,例如,图10是根据一示例性实施例示出的一种服务器的框图,该服务器1000可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)1001和一个或一个以上的存储器1002,其中,该存储器1002中存储有至少一条指令,该至少一条指令由该处理器1001加载并执行以实现上述各个方法实施例提供的码率切换方法。当然,该服务器还可以具有有线或无线网络接口以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。
上述终端和服务器为电子设备,该电子设备包括一个或多个处理器;用于存储所述一个或多个处理器可执行指令的一个或多个存储器;其中,所述一个或多个处理器被配置为执行所述指令,以实现上述各个实施例中所示的码率切换方法的方法步骤。在一些实施例中,上述各个实施例中所描述的特征和应用都可以由记录在一种该存储器中的存储介质中存储的指令执行操作。这些指令被一个或多个处理器执行时,能够使得一个或多个处理器执行指令中所指示的动作。
在示例性实施例中,还提供了一种包括指令的存储介质,例如包括指令的存储器,上述指令可由电子设备的处理器执行上述各个实施例中所示的码率切换方法的方法操作。在一些实施例中,上述各个实施例所描述的特征和应用都可以由记录在一种存储介质中的指令执行操作。当这些指令被一个或多个计算或处理单元(例如,一个或多个处理器、处理器的内核或其他处理单元)执行时,它们导致处理单元执行指令中指示的动作。在一些实施例中,存储介质可以是非临时性计算机可读存储介质,例如,该非临时性计算机可读存储介质可以是只读存储器(Read-Only Memory,简称:ROM)、随机存取存储器(Random Access Memory,简称:RAM)、只读光盘(Compact Disc Read-Only Memory,简称:CD-ROM)、磁带、软盘和光数据 存储设备等。
本公开实施例还提供一种计算机程序产品,包括一条或多条指令,该一条或多条指令由电子设备的处理器执行时,使得电子设备能够执行上述任一实施例所示出的码率切换方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (52)

  1. 一种码率切换方法,应用于电子设备,包括:
    接收媒体流中的媒体帧;
    获取所述媒体流的播放状态信息;
    响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;
    基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
  2. 根据权利要求1所述的方法,所述播放状态信息包括第一缓存量,所述码率切换条件包括所述第一缓存量大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中所述第一缓存量为当前对所述媒体流已缓存且未播放的缓存量,所述第二缓存量阈值小于所述第一缓存量阈值。
  3. 根据权利要求1所述的方法,所述播放状态信息包括所述媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;
    所述码率切换条件包括下述任一项:
    卡顿次数大于次数阈值或者卡顿次数小于次数阈值;
    上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;
    上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;
    丢帧率大于第一丢帧率阈值;
    丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;
    目标时间段内的丢帧率大于第一丢帧率阈值;
    目标时间段内的丢帧率小于第二丢帧率阈值。
  4. 根据权利要求1所述的方法,所述基于所述目标位置,向服务器发送帧获取请求,包括:
    响应于所述目标码率与当前码率不相等,基于所述目标位置向服务器发送帧获取请求。
  5. 根据权利要求1所述的方法,所述响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置,包括:
    响应于所述播放状态信息符合码率切换条件,根据所述播放状态信息以及当前码率,确定目标码率;
    响应于所述目标码率与当前码率不相等,根据所述媒体帧在所述媒体流中的位置,确定目标位置。
  6. 根据权利要求5所述的方法,所述方法还包括:
    响应于所述目标码率与所述当前码率相等,丢弃所述播放状态信息。
  7. 根据权利要求5所述的方法,所述响应于所述目标码率与所述当前码率不相等,根据所述媒体帧在所述媒体流中的位置,确定目标位置,包括:
    响应于所述目标码率与所述当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为所述目标位置,所述目标媒体帧组为所述媒体帧所在媒体帧组。
  8. 根据权利要求5所述的方法,所述根据所述播放状态信息以及当前码率,确定目标码率,包括:
    获取多个候选码率;
    根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,所述目标媒体帧组为所述媒体帧所在媒体帧组;
    根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率;
    其中,所述每个候选码率对应的第二缓存量为将码率切换至候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
  9. 根据权利要求8所述的方法,所述根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,包括:
    根据所述媒体流中所述媒体帧在所述目标媒体帧组中的位置,获取所述目标媒体帧组传输结束时对所述媒体流的缓存增加量;
    根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程;
    根据所述播放状态信息包括的第一缓存量、所述缓存增加量和所述播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
  10. 根据权利要求9所述的方法,所述根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,包括:
    根据所述多个候选码率与所述当前码率之间的关系,确定继续缓存所述目标媒体帧组时的缓存位置;
    获取当前网络状态信息;
    根据所述当前网络状态信息、所述缓存位置、目标媒体帧组的长度以及所述多个候选码率,确定所述目标缓存过程中所述媒体流的播放量。
  11. 根据权利要求10所述的方法,响应于任一候选码率与所述当前码率相等,所述缓存 位置为所述媒体帧的下一个媒体帧所在位置;或者,
    响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
  12. 根据权利要求8所述的方法,所述当前对所述媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值;所述根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率,包括:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第一缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率大于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第一缓存量阈值的第二缓存量,将当前码率确定为所述目标码率,所述目标码率大于或等于所述当前码率。
  13. 根据权利要求8所述的方法,所述当前对所述媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值;所述根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率,包括:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第二缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第二缓存量阈值的第二缓存量,将所述多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率。
  14. 一种码率切换方法,应用于电子设备,包括:
    发送媒体流中的媒体帧;
    获取终端对所述媒体流的播放状态信息;
    响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;
    基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
  15. 根据权利要求14所述的方法,所述播放状态信息包括第一缓存量,所述第一缓存量为当前对所述媒体流已缓存且未播放的缓存量;所述码率切换条件包括所述第一缓存量大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中,所述第二缓存量阈值小于所述第一缓存量阈值。
  16. 根据权利要求14所述的方法,所述播放状态信息包括所述媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;
    所述码率切换条件包括下述任一项:
    卡顿次数大于次数阈值或者卡顿次数小于次数阈值;
    上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;
    上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;
    丢帧率大于第一丢帧率阈值;
    丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;
    目标时间段内的丢帧率大于第一丢帧率阈值;
    目标时间段内的丢帧率小于第二丢帧率阈值。
  17. 根据权利要求14所述的方法,所述响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置,包括:
    响应于所述播放状态信息符合码率切换条件,根据所述播放状态信息以及当前码率,确定目标码率;
    响应于所述目标码率与所述当前码率不相等,根据所述媒体帧在所述媒体流中的位置,确定目标位置。
  18. 根据权利要求17所述的方法,所述方法还包括:
    响应于所述目标码率与所述当前码率相等,继续基于当前码率向所述终端传输所述媒体帧的下一个媒体帧。
  19. 根据权利要求17所述的方法,所述响应于所述目标码率与所述当前码率不相等,执行所述根据所述媒体帧在所述媒体流中的位置,确定目标位置,包括:
    响应于所述目标码率与所述当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为所述目标位置,所述目标媒体帧组为所述媒体帧所在媒体帧组。
  20. 根据权利要求17所述的方法,所述根据所述播放状态信息以及当前码率,确定目标码率,包括:
    获取多个候选码率;
    根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,所述目标媒体帧组为所述媒体帧所在媒体帧组;
    根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率;
    其中,所述每个候选码率对应的第二缓存量为将码率切换至候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
  21. 根据权利要求20所述的方法,所述根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候 选码率对应的第二缓存量,包括:
    根据所述媒体流中所述媒体帧在所述目标媒体帧组中的位置,获取所述目标媒体帧组传输结束时对所述媒体流的缓存增加量;
    根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程;
    根据所述播放状态信息包括的第一缓存量、所述缓存增加量和所述播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
  22. 根据权利要求21所述的方法,所述根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,包括:
    根据所述多个候选码率与所述当前码率之间的关系,确定继续缓存所述目标媒体帧组时的缓存位置;
    获取当前网络状态信息;
    根据所述当前网络状态信息、所述缓存位置、目标媒体帧组的长度以及所述多个候选码率,确定所述目标缓存过程中所述媒体流的播放量。
  23. 根据权利要求22所述的方法,响应于任一候选码率与所述当前码率相等,所述缓存位置为所述媒体帧的下一个媒体帧所在位置;或者,
    响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
  24. 根据权利要求20所述的方法,所述当前对所述媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值;所述根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率,包括:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第一缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率大于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第一缓存量阈值的第二缓存量,将当前码率确定为所述目标码率,所述目标码率大于或等于所述当前码率。
  25. 根据权利要求20所述的方法,所述当前对所述媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值;所述根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率,包括:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第二缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第二缓存量阈值的第二缓存量,将所述多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为所 述目标码率,所述目标码率小于或等于所述当前码率。
  26. 一种电子设备,包括:
    一个或多个处理器;
    用于存储所述一个或多个处理器可执行指令的一个或多个存储器;
    其中,所述一个或多个处理器被配置为执行所述指令,以实现如下步骤:
    接收媒体流中的媒体帧;
    获取所述媒体流的播放状态信息;
    响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;
    基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
  27. 根据权利要求26所述的电子设备,所述播放状态信息包括第一缓存量,所述码率切换条件包括所述第一缓存量大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中所述第一缓存量为当前对所述媒体流已缓存且未播放的缓存量,所述第二缓存量阈值小于所述第一缓存量阈值。
  28. 根据权利要求26所述的电子设备,所述播放状态信息包括所述媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;
    所述码率切换条件包括下述任一项:
    卡顿次数大于次数阈值或者卡顿次数小于次数阈值;
    上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;
    上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;
    丢帧率大于第一丢帧率阈值;
    丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;
    目标时间段内的丢帧率大于第一丢帧率阈值;
    目标时间段内的丢帧率小于第二丢帧率阈值。
  29. 根据权利要求26所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述目标码率与当前码率不相等,基于所述目标位置向服务器发送帧获取请求。
  30. 根据权利要求26所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述播放状态信息符合码率切换条件,根据所述播放状态信息以及当前码率,确定目标码率;
    响应于所述目标码率与当前码率不相等,根据所述媒体帧在所述媒体流中的位置,确定目标位置。
  31. 根据权利要求30所述的电子设备,所述一个或多个处理器还被配置为执行所述指令,以实现如下步骤:
    响应于所述目标码率与所述当前码率相等,丢弃所述播放状态信息。
  32. 根据权利要求30所述的电子设备,所述一个或多个处理器还被配置为执行所述指令,以实现如下步骤:
    响应于所述目标码率与所述当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为所述目标位置,所述目标媒体帧组为所述媒体帧所在媒体帧组。
  33. 根据权利要求30所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    获取多个候选码率;
    根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,所述目标媒体帧组为所述媒体帧所在媒体帧组;
    根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率;
    其中,所述每个候选码率对应的第二缓存量为将码率切换至候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
  34. 根据权利要求33所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    根据所述媒体流中所述媒体帧在所述目标媒体帧组中的位置,获取所述目标媒体帧组传输结束时对所述媒体流的缓存增加量;
    根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程;
    根据所述播放状态信息包括的第一缓存量、所述缓存增加量和所述播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
  35. 根据权利要求34所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    根据所述多个候选码率与所述当前码率之间的关系,确定继续缓存所述目标媒体帧组时的缓存位置;
    获取当前网络状态信息;
    根据所述当前网络状态信息、所述缓存位置、目标媒体帧组的长度以及所述多个候选码 率,确定所述目标缓存过程中所述媒体流的播放量。
  36. 根据权利要求35所述的电子设备,响应于任一候选码率与所述当前码率相等,所述缓存位置为所述媒体帧的下一个媒体帧所在位置;或者,
    响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
  37. 根据权利要求33所述的电子设备,所述当前对所述媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值;
    所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第一缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率大于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第一缓存量阈值的第二缓存量,将当前码率确定为所述目标码率,所述目标码率大于或等于所述当前码率。
  38. 根据权利要求33所述的电子设备,所述当前对所述媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值;
    所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第二缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第二缓存量阈值的第二缓存量,将所述多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率。
  39. 一种电子设备,包括:
    一个或多个处理器;
    用于存储所述一个或多个处理器可执行指令的一个或多个存储器;
    其中,所述一个或多个处理器被配置为执行所述指令,以实现如下步骤:
    发送媒体流中的媒体帧;
    获取终端对所述媒体流的播放状态信息;
    响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;
    基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
  40. 根据权利要求39所述的电子设备,所述播放状态信息包括第一缓存量,所述第一缓存量为当前对所述媒体流已缓存且未播放的缓存量;所述码率切换条件包括所述第一缓存量 大于第一缓存量阈值或者所述第一缓存量小于第二缓存量阈值,其中,所述第二缓存量阈值小于所述第一缓存量阈值。
  41. 根据权利要求39所述的电子设备,所述播放状态信息包括所述媒体流播放过程中的卡顿信息或丢帧率中至少一项;所述卡顿信息包括播放媒体流的目标时间段内的卡顿次数、上一次卡顿的时间或上一次的卡顿时长中至少一项;
    所述码率切换条件包括下述任一项:
    卡顿次数大于次数阈值或者卡顿次数小于次数阈值;
    上一次卡顿时间与当前时刻之间的时长小于间隔阈值和卡顿时长大于时长阈值,或者上一次卡顿时间与当前时刻之间的时长大于间隔阈值和卡顿时长小于时长阈值;
    上一次卡顿时长大于时长阈值,或者,上一次卡顿时长小于时长阈值;
    丢帧率大于第一丢帧率阈值;
    丢帧率小于第二丢帧率阈值,第二丢帧率阈值小于第一丢帧率阈值;
    目标时间段内的丢帧率大于第一丢帧率阈值;
    目标时间段内的丢帧率小于第二丢帧率阈值。
  42. 根据权利要求39所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述播放状态信息符合码率切换条件,根据所述播放状态信息以及当前码率,确定目标码率;
    响应于所述目标码率与所述当前码率不相等,根据所述媒体帧在所述媒体流中的位置,确定目标位置。
  43. 根据权利要求42所述的电子设备,所述一个或多个处理器还被配置为执行所述指令,以实现如下步骤:
    响应于所述目标码率与所述当前码率相等,继续基于当前码率向所述终端传输所述媒体帧的下一个媒体帧。
  44. 根据权利要求42所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述目标码率与所述当前码率不相等,将目标媒体帧组中的第一个媒体帧所在位置确定为所述目标位置,所述目标媒体帧组为所述媒体帧所在媒体帧组。
  45. 根据权利要求42所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    获取多个候选码率;
    根据所述多个候选码率与所述当前码率之间的关系、所述播放状态信息以及所述媒体流中所述媒体帧在目标媒体帧组中的位置,获取每个候选码率对应的第二缓存量,所述目标媒体帧组为所述媒体帧所在媒体帧组;
    根据所述每个候选码率对应的第二缓存量与第一缓存量阈值或第二缓存量阈值的关系,从所述多个候选码率中,确定目标码率;
    其中,所述每个候选码率对应的第二缓存量为将码率切换至候选码率后,所述目标媒体帧组传输结束时对所述媒体流已缓存但未播放的缓存量。
  46. 根据权利要求45所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    根据所述媒体流中所述媒体帧在所述目标媒体帧组中的位置,获取所述目标媒体帧组传输结束时对所述媒体流的缓存增加量;
    根据所述多个候选码率与所述当前码率之间的关系对应的缓存位置,确定目标缓存过程中所述媒体流的播放量,所述缓存位置为继续缓存所述目标媒体帧组时的缓存位置,所述目标缓存过程为当前到基于所述多个候选码率对所述目标媒体帧组传输结束时的过程;
    根据所述播放状态信息包括的第一缓存量、所述缓存增加量和所述播放量,获取每个候选码率对应的第二缓存量,第一缓存量为当前对所述媒体流已缓存且未播放的缓存量。
  47. 根据权利要求46所述的电子设备,所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    根据所述多个候选码率与所述当前码率之间的关系,确定继续缓存所述目标媒体帧组时的缓存位置;
    获取当前网络状态信息;
    根据所述当前网络状态信息、所述缓存位置、目标媒体帧组的长度以及所述多个候选码率,确定所述目标缓存过程中所述媒体流的播放量。
  48. 根据权利要求47所述的电子设备,响应于任一候选码率与所述当前码率相等,所述缓存位置为所述媒体帧的下一个媒体帧所在位置;或者,
    响应于任一候选码率与所述当前码率不相等,所述缓存位置为所述目标媒体帧组的第一个媒体帧所在位置。
  49. 根据权利要求45所述的电子设备,所述当前对所述媒体流已缓存且未播放的第一缓存量大于第一缓存量阈值;
    所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第一缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率大于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第一缓存量阈值的第二缓存量,将当前码率确定为所述目标码率,所述目标码率大于或等于所述当前码率。
  50. 根据权利要求45所述的电子设备,所述当前对所述媒体流已缓存且未播放的第一缓存量小于第二缓存量阈值;
    所述一个或多个处理器具体被配置为执行所述指令,以实现如下步骤:
    响应于所述多个候选码率对应的第二缓存量中至少一个第二缓存量大于所述第二缓存量阈值,将所述至少一个第二缓存量中最大的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率;或,
    响应于所述多个候选码率对应的第二缓存量中不包括大于所述第二缓存量阈值的第二缓存量,将所述多个候选码率对应的第二缓存量中最大的第二缓存量对应的候选码率确定为所述目标码率,所述目标码率小于或等于所述当前码率。
  51. 一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:
    接收媒体流中的媒体帧;
    获取所述媒体流的播放状态信息;
    响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;
    基于所述目标位置,向服务器发送帧获取请求,所述帧获取请求用于指示所述服务器基于目标码率返回所述媒体流中所述目标位置开始的媒体帧。
  52. 一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:
    发送媒体流中的媒体帧;
    获取终端对所述媒体流的播放状态信息;
    响应于所述播放状态信息符合码率切换条件,根据所述媒体帧在所述媒体流中的位置,确定目标位置;
    基于所述目标位置和目标码率,向所述终端发送所述媒体流中所述目标位置开始的媒体帧。
PCT/CN2020/133863 2020-01-17 2020-12-04 码率切换方法及设备 WO2021143388A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20913592.0A EP3968651A4 (en) 2020-01-17 2020-12-04 BIT RATE SWITCHING METHOD AND DEVICE
US17/544,160 US20220095020A1 (en) 2020-01-17 2021-12-07 Method for switching a bit rate, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010055756.1 2020-01-17
CN202010055756.1A CN113141541B (zh) 2020-01-17 2020-01-17 码率切换方法、装置、设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/544,160 Continuation US20220095020A1 (en) 2020-01-17 2021-12-07 Method for switching a bit rate, and electronic device

Publications (1)

Publication Number Publication Date
WO2021143388A1 true WO2021143388A1 (zh) 2021-07-22

Family

ID=76808705

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/133863 WO2021143388A1 (zh) 2020-01-17 2020-12-04 码率切换方法及设备

Country Status (4)

Country Link
US (1) US20220095020A1 (zh)
EP (1) EP3968651A4 (zh)
CN (1) CN113141541B (zh)
WO (1) WO2021143388A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905257A (zh) * 2021-09-29 2022-01-07 北京字节跳动网络技术有限公司 视频码率切换方法、装置、电子设备及存储介质
CN117156147A (zh) * 2022-05-24 2023-12-01 北京字跳网络技术有限公司 一种视频转码方法、装置、设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070076816A1 (en) * 1999-03-05 2007-04-05 Ipr Licensing, Inc. Maximizing data rate by adjusting codes and code rates in CDMA system
CN108769826A (zh) * 2018-06-22 2018-11-06 广州酷狗计算机科技有限公司 直播媒体流获取方法、装置、终端及存储介质
CN110267100A (zh) * 2019-07-12 2019-09-20 北京达佳互联信息技术有限公司 Flv视频的码率切换方法、装置、电子设备及存储介质
CN110290402A (zh) * 2019-07-31 2019-09-27 腾讯科技(深圳)有限公司 一种视频码率调整方法、装置、服务器及存储介质
CN110636346A (zh) * 2019-09-19 2019-12-31 北京达佳互联信息技术有限公司 一种码率自适应切换方法、装置、电子设备及存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5351040B2 (ja) * 2006-12-12 2013-11-27 ヴァントリックス コーポレーション 映像符号化規格に対応した映像レート制御の改善
CN101242359B (zh) * 2008-02-27 2010-08-18 华为技术有限公司 动态码率分配方法、分组域流媒体服务器
US9100288B1 (en) * 2009-07-20 2015-08-04 Conviva Inc. Augmenting the functionality of a content player
CN102957672A (zh) * 2011-08-25 2013-03-06 中国电信股份有限公司 自适应播放flv媒体流的方法、客户端和系统
CN103856806B (zh) * 2012-11-28 2018-05-01 腾讯科技(北京)有限公司 视频流切换方法、装置及系统
US9319678B2 (en) * 2012-12-20 2016-04-19 Hulu, LLC Keyframe alignment for encoding video at multiple bitrates
CN103826121B (zh) * 2013-12-20 2017-05-10 电子科技大学 低延迟视频编码基于场景切换检测的码率控制方法
US10856046B2 (en) * 2015-12-18 2020-12-01 Telefonaktiebolaget Lm Ericsson (Publ) Video playback buffer control
CA2997355A1 (en) * 2016-12-30 2019-06-14 Tivo Solutions Inc. Advanced trick-play modes for streaming video
WO2018184189A1 (zh) * 2017-04-07 2018-10-11 天彩电子(深圳)有限公司 码率自适应调节方法及其系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070076816A1 (en) * 1999-03-05 2007-04-05 Ipr Licensing, Inc. Maximizing data rate by adjusting codes and code rates in CDMA system
CN108769826A (zh) * 2018-06-22 2018-11-06 广州酷狗计算机科技有限公司 直播媒体流获取方法、装置、终端及存储介质
CN110267100A (zh) * 2019-07-12 2019-09-20 北京达佳互联信息技术有限公司 Flv视频的码率切换方法、装置、电子设备及存储介质
CN110290402A (zh) * 2019-07-31 2019-09-27 腾讯科技(深圳)有限公司 一种视频码率调整方法、装置、服务器及存储介质
CN110636346A (zh) * 2019-09-19 2019-12-31 北京达佳互联信息技术有限公司 一种码率自适应切换方法、装置、电子设备及存储介质

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
CN113141541A (zh) 2021-07-20
US20220095020A1 (en) 2022-03-24
EP3968651A1 (en) 2022-03-16
CN113141541B (zh) 2022-06-10
EP3968651A4 (en) 2022-08-31

Similar Documents

Publication Publication Date Title
CN110881136B (zh) 视频帧率控制方法、装置、计算机设备及存储介质
WO2021143479A1 (zh) 媒体流传输方法及系统
WO2021143386A1 (zh) 资源传输方法及终端
CN108769726B (zh) 多媒体数据推送方法、装置、存储介质及设备
CN110213616B (zh) 视频提供方法、获取方法、装置及设备
WO2018059352A1 (zh) 直播视频流远程控制方法及装置
CN108259945B (zh) 处理播放多媒体数据的播放请求的方法和装置
WO2021143362A1 (zh) 资源传输方法及终端
CN109788303B (zh) 直播视频流的推送方法、装置、电子设备及存储介质
EP2326136A2 (en) Method and apparatus for remote controlling bluetooth device
CN111586431B (zh) 进行直播处理的方法、装置、设备及存储介质
CN110996117B (zh) 视频转码方法、装置、电子设备和存储介质
WO2021143388A1 (zh) 码率切换方法及设备
CN108900921A (zh) 连麦直播方法、装置及存储介质
CN111010588A (zh) 直播处理方法、装置、存储介质及设备
CN111131272B (zh) 流服务器的调度方法、装置及系统、计算设备、存储介质
US20220174356A1 (en) Method for determining bandwidth, terminal, and storage medium
CN112153404B (zh) 码率调整方法、检测方法、装置、设备及存储介质
CN114071224B (zh) 视频数据处理方法、装置、计算机设备及存储介质
CN111083162B (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: 20913592

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020913592

Country of ref document: EP

Effective date: 20211209

NENP Non-entry into the national phase

Ref country code: DE