WO2021143386A1 - 资源传输方法及终端 - Google Patents
资源传输方法及终端 Download PDFInfo
- Publication number
- WO2021143386A1 WO2021143386A1 PCT/CN2020/133755 CN2020133755W WO2021143386A1 WO 2021143386 A1 WO2021143386 A1 WO 2021143386A1 CN 2020133755 W CN2020133755 W CN 2020133755W WO 2021143386 A1 WO2021143386 A1 WO 2021143386A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- code rate
- multimedia resource
- terminal
- media
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 73
- 230000005540 biological transmission Effects 0.000 title claims abstract description 61
- 230000004044 response Effects 0.000 claims abstract description 30
- 230000008569 process Effects 0.000 claims description 29
- 238000003860 storage Methods 0.000 claims description 20
- 230000015654 memory Effects 0.000 claims description 17
- 238000004891 communication Methods 0.000 abstract description 9
- 230000003044 adaptive effect Effects 0.000 description 20
- 230000003139 buffering effect Effects 0.000 description 15
- 230000006870 function Effects 0.000 description 14
- 238000005070 sampling Methods 0.000 description 11
- 230000002093 peripheral effect Effects 0.000 description 10
- 238000012545 processing Methods 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 239000000203 mixture Substances 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 239000012634 fragment Substances 0.000 description 3
- 238000013467 fragmentation Methods 0.000 description 3
- 238000006062 fragmentation reaction Methods 0.000 description 3
- 230000033001 locomotion Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 108091026890 Coding region Proteins 0.000 description 1
- 102100037812 Medium-wave-sensitive opsin 1 Human genes 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000013441 quality evaluation Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 239000010409 thin film Substances 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/80—Responding to QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
- H04N21/23805—Controlling the feeding rate to the network, e.g. by controlling the video pump
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/38—Flow control; Congestion control by adapting coding or compression rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/61—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
- H04L65/612—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for unicast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/61—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
- H04L65/613—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for the control of the source by the destination
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/70—Media network packetisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
- H04L65/762—Media network packet handling at the source
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing 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/23439—Processing 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
- H04N21/2387—Stream processing in response to a playback request from an end-user, e.g. for trick-play
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management 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/266—Channel 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/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/44004—Processing 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring 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/44209—Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/45—Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
- H04N21/462—Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
- H04N21/4621—Controlling the complexity of the content stream or additional data, e.g. lowering the resolution or bit-rate of the video stream for a mobile client with a small screen
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-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/47217—End-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 controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network 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/63—Control 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/64—Addressing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network 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/63—Control 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/647—Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
- H04N21/64723—Monitoring of network processes or resources, e.g. monitoring of network load
- H04N21/64738—Monitoring network characteristics, e.g. bandwidth, congestion level
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network 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/65—Transmission of management data between client and server
- H04N21/658—Transmission by the client directed to the server
- H04N21/6581—Reference data, e.g. a movie identifier for ordering a movie or a product identifier in a home shopping application
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network 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/65—Transmission of management data between client and server
- H04N21/658—Transmission by the client directed to the server
- H04N21/6587—Control parameters, e.g. trick play commands, viewpoint selection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8455—Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Definitions
- the present disclosure relates to the field of communication technology, and in particular to a resource transmission method and terminal.
- Fragmentation-based media transmission methods include the common DASH (Dynamic Adaptive Streaming over HTTP, an HTTP-based adaptive streaming media transmission standard formulated by MPEG.
- MPEG is called Moving Picture Experts Group in English, and Dynamic Picture Experts Group in Chinese.
- HLS HTTP Live Streaming, an adaptive streaming media transmission standard based on HTTP developed by Apple
- the server divides audio and video resources into segments of audio and video fragments, and each audio and video fragment can be transcoded into a different Bit rate:
- the terminal accesses the URLs of each audio and video segment divided into the audio and video resources.
- Different audio and video segments can correspond to the same or different bit rates, so that the terminal can conveniently log in Switching between audio and video resources with different bit rates is also called adaptive adjustment of the bit rate based on the terminal's own bandwidth.
- the present disclosure provides a resource transmission method and terminal.
- the technical solutions of the present disclosure are as follows:
- a resource transmission method including: determining a target code rate at a target time, the target code rate being the code rate that has the highest degree of matching with the playback state at the target time; If the target code rate is inconsistent with the current code rate, obtain the target address information of the multimedia resource with the target code rate; send a frame acquisition request carrying the target address information to the server, and the frame acquisition request is used to instruct the server Return the media frame of the multimedia resource at the target code rate.
- a resource transmission device including: a first determining unit configured to perform determination of a target bit rate at a target moment, where the target bit rate corresponds to a playback state at the target moment The code rate with the highest matching degree; the acquiring unit is configured to execute in response to the target code rate being inconsistent with the current code rate, obtaining the target address information of the multimedia resource with the target code rate; the sending unit is configured to execute The server sends a frame acquisition request carrying the target address information, where the frame acquisition request is used to instruct the server to return the media frame of the multimedia resource at the target code rate.
- a terminal including: one or more processors; one or more memories for storing executable instructions of the one or more processors; wherein, the one Or multiple processors are configured to execute the instruction to implement the following operations: determine a target bit rate at a target moment, where the target bit rate has the highest matching degree with the playback state at the target moment; in response to the The target code rate is inconsistent with the current code rate, obtain the target address information of the multimedia resource with the target code rate; send a frame acquisition request carrying the target address information to the server, and the frame acquisition request is used to instruct the server to The target code rate returns the media frame of the multimedia resource.
- a storage medium When at least one instruction in the storage medium is executed by one or more processors of a terminal, the terminal can perform the following operations: Determine the target at the target moment The code rate, the target code rate is the code rate that matches the playback state of the target moment the most; in response to the target code rate being inconsistent with the current code rate, the target address of the multimedia resource with the target code rate is acquired Information; sending a frame acquisition request carrying the target address information to the server, where the frame acquisition request is used to instruct the server to return the media frame of the multimedia resource at the target code rate.
- a computer program product including one or more instructions, and the one or more instructions can be executed by one or more processors of a terminal, so that the terminal can perform the above-mentioned resource transmission method.
- Fig. 1 is a schematic diagram showing an implementation environment of a resource transmission method according to an embodiment
- FIG. 2 is a schematic diagram of a FAS framework provided by an embodiment of the present disclosure
- Fig. 3 is a flow chart showing a method for resource transmission according to an embodiment
- Fig. 4 is an interaction flowchart of a resource transmission method according to an embodiment
- Fig. 5 is a block diagram showing a logical structure of a resource transmission device according to an embodiment
- Fig. 6 shows a structural block diagram of a terminal provided by an embodiment of the present disclosure.
- the user information involved in the present disclosure may be information authorized by the user or fully authorized by all parties.
- FLV is a streaming media format
- FLV streaming media format is a video format developed with the introduction of Flash MX (an animation production software). Due to the extremely small file size and fast loading speed, it makes it possible to watch video files online (that is, to browse videos online). Its emergence effectively solves the problem of SWF (a special file for Flash) that is exported after video files are imported into Flash. Format) The file is so large that it cannot be used well on the Internet.
- 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. It is different from the traditional fragment-based media transmission method.
- the terminal sends a certain start broadcast to the server at the start time.
- the server responds to the frame acquisition request and transmits the media frame corresponding to the multimedia resource to the terminal according to the start code rate.
- frame-level multimedia transmission is carried out between the server and the terminal, and the server does not need to wait for a complete
- the resource package can be sent to the terminal. Instead, the real-time media frame can be sent to the terminal frame by frame.
- the terminal After the terminal receives the media frame, it can perform operations such as buffering, decoding, and rendering to play the media frame on the terminal. If you need to switch the code rate during playback, only re-send the frame acquisition request corresponding to a certain code rate to be switched at the time when the code rate needs to be switched.
- the server performs similar processing logic and can correspond to the multimedia resource according to the code rate to be switched.
- the media frame is transmitted to the terminal, thereby realizing dynamic code rate switching.
- the above-mentioned starting code rate and the code rate to be switched can be regarded as examples of the target code rate.
- the terminal may specify the target location information in the frame acquisition request to ensure that the media stream is pulled from the target location information, or the terminal may not specify the target location information in the frame acquisition request, and the server will The target location information is configured as a default value, so that the terminal starts to pull the media stream from the default value of the target location information.
- the server in response to the target location information being less than zero, the server may package all the buffered media frames starting from the target location information and send them to the terminal (without fragmentation).
- the server in response to the target location information being greater than Or equal to zero or there is a real-time stream in addition to the buffered media frames, and the server may send the media frames of the real-time buffered multimedia resources to the terminal frame by frame.
- the above code rate to be switched can be determined based on the terminal's own bandwidth information and the amount of media buffering.
- the terminal can adaptively adjust the code rate to be switched, resending and waiting to be switched.
- the frame acquisition request corresponding to the bit rate.
- 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. After the multimedia resource specified by the on-demand request is inquired, 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 resource transmission method according to an embodiment.
- the implementation environment may include at least one terminal 101 and a server 102, which will be described in detail below:
- the terminal 101 is used for multimedia resource transmission, and each terminal may be equipped with a media codec component and a media playback component.
- the media codec component is used to receive multimedia resources (such as fragmented transmission resources).
- the multimedia resource is decoded after the package, frame-level transmission of the media frame, and the media playback component is used to play the multimedia resource after the multimedia resource is decoded.
- the terminal 101 can be divided into a host terminal and a viewer terminal.
- the host terminal corresponds to the host user
- the viewer terminal corresponds to the viewer user.
- the terminal can be the host terminal.
- It can also be a viewer terminal for example, the terminal is the host terminal when the user is recording a live broadcast, and the terminal is the viewer terminal when the user is watching the live broadcast.
- the terminal 101 and the server 102 may be connected through a wired network or a wireless network.
- the server 102 is used to provide multimedia resources to be transmitted, and the server 102 may include at least one of a server, multiple servers, a cloud computing platform, or a virtualization center.
- the server 102 is responsible for the main calculation work, and the terminal 101 is responsible for the secondary calculation work; or, the server 102 is responsible for the secondary calculation work, and the terminal 101 is responsible for the main calculation work; or, between the terminal 101 and the server 102 Distributed computing architecture for collaborative computing.
- the server 102 may be a clustered CDN (Content Delivery Network, Content Delivery Network) server.
- the CDN server includes a central platform and edge servers deployed in various places.
- the central platform performs load balancing, content distribution, scheduling, etc.
- the functional module enables the terminal where the user is located to rely on the local edge server to obtain the required content (ie, multimedia resources) nearby.
- the CDN server adds a caching mechanism between the terminal and the central platform.
- the caching mechanism is also an edge server (such as a WEB server) deployed in different geographic locations.
- the central platform will be based on the distance between the terminal and the edge server. Near and far, dispatch the edge server closest to the terminal to provide services to the terminal.
- the multimedia resources 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 multimedia resources.
- the multimedia resource 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 device types of the terminal 101 include, but are not limited to: TVs, smart phones, smart speakers, vehicle-mounted terminals, tablet computers, e-book readers, 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, moving picture expert compression standard audio layer 4) player, laptop portable computer or desktop computer at least one.
- the terminal 101 includes a smart phone as an example.
- the number of the foregoing terminal 101 may be only one, or the number of the terminal 101 may be tens or hundreds, or more.
- the embodiments of the present disclosure do not limit the number of terminals 101 and device types.
- FIG. 2 is a schematic diagram of a FAS framework provided by an embodiment of the present disclosure. Please refer to FIG. 2.
- An embodiment of the present disclosure provides a FAS (Streaming-based Multi-rate Adaptive) framework in which the terminal The multimedia resource transmission is carried out between 101 and the server 102 through the FAS protocol.
- FAS Streaming-based Multi-rate Adaptive
- an application also known as FAS client
- the application is used to browse multimedia resources.
- the application can be a short video application, a live broadcast application, or a video On-demand applications, social applications, shopping applications, etc., the embodiments of the present disclosure do not specifically limit the types of applications.
- the user can start the application on the terminal and display the resource push interface (such as the home page or function interface of the application).
- the resource push interface includes at least one multimedia resource's abbreviated information.
- the abbreviated information includes title, introduction, and release.
- the terminal can jump from the resource pushing interface to the resource playing interface, and in response to at least one of a poster, a poster, a trailer, or a highlight clip,
- the playback option of the multimedia resource is included, and in response to the user's touch operation on the playback option, the terminal downloads the media presentation description (MPD) file of the multimedia resource from the server.
- MPD media presentation description
- the server determines the target address information of the multimedia resource with the start code rate (or the default play code rate, which refers to the target code rate at the start time), and send the start code rate (or the default play code rate) to the server
- the frame acquisition request (or FAS request) corresponding to the code rate) enables the server to process the frame acquisition request based on a certain specification (the processing specification of the FAS request), and the server locates the media frame (continuous media frame) of the multimedia resource After the media stream can be formed), the media frame of the multimedia resource is returned to the terminal at the start code rate (or the default play code rate) (that is, the media stream is returned to the terminal at the target code rate).
- the terminal calls the media codec component to decode the media stream to obtain the decoded media stream, and calls the media playback component to play the decoded media stream.
- the server may form multimedia resources with multiple code rates.
- the server can allocate different address information for multimedia resources with different code rates, and combine various code rates.
- the address information of the multimedia resources are all recorded in the MPD.
- the terminal downloads the MPD it can send frame acquisition requests carrying different address information to the server at different times, and the server will return the media frames of the corresponding multimedia resources at different code rates.
- a mechanism for adaptively adjusting the bit rate is provided.
- the playback status of the multimedia resources on the terminal will also change, and the terminal can adapt to the current playback.
- the code rate to be switched with the highest state matching degree that is, the target code rate during playback.
- the FAS standard provides a type of target location information in the frame acquisition request. Different target location information can specify different initial pull locations of the multimedia resources. Then the target location information is specified in the frame acquisition request (if By default, the server will configure the default value) and code rate.
- the terminal only needs to send a new frame acquisition request again, and the server can start from the target location information at any time according to another code Send the media stream to the terminal at a rate, that is, the terminal can dynamically pull a media stream of another bit rate from any initial media frame.
- the terminal when the code rate needs to be switched, can disconnect the media stream transmission link of the current code rate, and send a frame acquisition request carrying the target address information corresponding to the code rate to be switched to the server, and the establishment is based on the code rate to be switched.
- the terminal may not disconnect the media stream transmission link of the current bit rate, but directly re-initiate the frame acquisition request carrying the target address information corresponding to the bit rate to be switched, and establish the media based on the bit rate to be switched.
- the streaming link (used to transmit a new media stream) uses the original media stream as a backup stream. Once the transmission of the new media stream is abnormal, the backup stream can continue to be played.
- the MPD file may include a version number (@version) and a media description set (@adaptationSet), and may also include a service type (@type) and a function option (@hideAuto) to indicate whether to turn on the adaptive function.
- the version number may include at least one of the version number of the media description file or the version number of the resource transmission standard (FAS standard).
- FAS standard resource transmission standard
- the media description set is used to represent the meta-information of the multimedia resource.
- the media description set may include multiple media description meta-information.
- Each media description meta-information corresponds to a multimedia resource with a bit rate, and each media description meta-information It may include the length of the group of pictures (@gopDuration) and the attribute information (@representation) of the multimedia resource of the code rate corresponding to the media description meta-information.
- the length of a group of pictures refers to the distance between two key frames, and a key frame refers to an intra-coded picture (also called an "I frame") in a video coding sequence.
- I frame intra-coded picture
- P frame Predictive-coded picture, predictive coded picture frame
- B frame Bidirectionally predicted picture, bidirectionally predictive coded picture
- Each attribute information can include the identification information of the multimedia resource (@id, a unique identifier), the encoding method of the multimedia resource (@codec, the codec standard to be complied with), and the bit rate supported by the multimedia resource (@bitrate, resource transmission The number of data bits transmitted in a unit of time) and the address information of the multimedia resource of the bit rate (@url, the URL or domain name provided by the multimedia resource of a certain bit rate.
- each attribute information can also include the quality type of the multimedia resource (@qualityType, including quality evaluation indicators such as resolution and frame rate), and the hidden option of the multimedia resource (@hiden, used to indicate a code Whether the multimedia resource of the rate is visible, that is, whether the user can manually the multimedia resource of the bit rate), the function option used to indicate whether the multimedia resource is visible relative to the adaptive function (@enableAdaptive, refers to whether the adaptive function can select a certain At least one of the multimedia resources with a bit rate) or the default playback function option (@defaultSelect, refers to whether to play a multimedia resource with a certain bit rate by default when the broadcast is started).
- qualityType including quality evaluation indicators such as resolution and frame rate
- hidden option of the multimedia resource @hiden, used to indicate a code Whether the multimedia resource of the rate is visible, that is, whether the user can manually the multimedia resource of the bit rate
- the function option used to indicate whether the multimedia resource is visible relative to the adaptive function (@enableAdaptive, refers to whether the adaptive function can
- the service type is used to specify the service type of the multimedia resource, including at least one of live broadcast or on-demand.
- the MPD file format may be JSON (JavaScript Object Notation, JS object notation) or other script formats.
- JSON JavaScript Object Notation, JS object notation
- the embodiment of the present disclosure does not specifically limit the MPD file format.
- Fig. 3 is a flow chart showing a method for resource transmission according to an embodiment. The method for resource transmission is applied to a terminal in the FAS framework involved in the foregoing implementation environment, which will be described in detail below.
- the target code rate at that time is determined, and the target code rate is the code rate that has the highest degree of matching with the playback state at that time.
- the above 301 is that the terminal determines the target code rate at the target time, and the target code rate is the code rate that has the highest degree of matching with the playback state at the target time.
- the terminal obtains the target address information of the multimedia resource of the target code rate.
- the above 302 is that, in response to the target code rate being inconsistent with the current code rate, the terminal obtains the target address information of the multimedia resource with the target code rate.
- the terminal sends a frame acquisition request carrying the target address information to the server, and the frame acquisition request is used to instruct the server to return the media frame of the multimedia resource at the target code rate.
- the target time is the start time of the multimedia resource; or, the target time is the download completion time of any picture group in the multimedia resource; or, the target time is any media in the multimedia resource The playback moment of the frame.
- determining the target bit rate at the target time includes: determining the target bit rate based on the bandwidth information at the target time and the amount of media buffer at the target time.
- determining the target code rate based on the bandwidth information at the target time and the amount of media cache at the target time includes: determining an estimated cache amount of at least one candidate code rate based on the bandwidth information and the media cache amount ,
- the estimated cache amount refers to the estimated amount of media cache that continues to download the current group of pictures according to the corresponding code rate from the target moment until the end of the download; the estimated cache amount based on the at least one candidate code rate, from the At least one candidate code rate or the current code rate determines the target code rate.
- determining the target code rate at the target moment includes: determining the start code rate specified by the playback service or the default playback code rate of the media description file as the start time of the multimedia resource based on the target time being the start time of the multimedia resource. Target bit rate.
- the method further includes: in response to the target bit rate being inconsistent with the current bit rate, determining target position information, where the target position information is used to indicate the initial pull position of the media frame of the multimedia resource;
- the target location information is embedded in the frame acquisition request carrying the target address information.
- determining the target location information includes: determining the target location information based on the start time of the multimedia resource based on the target moment, and determining the target location information based on the buffer duration specified by the playback service; or, based on the target moment being the multimedia resource
- the time when the download of any one of the picture groups is completed, the time stamp of the first frame in the next picture group of the picture group is determined as the target location information; or, based on the target time, it is the playback of any media frame in the multimedia resource
- the time stamp of the first frame in the currently downloaded picture group is determined as the target location information.
- the method further includes: in response to the target code rate being consistent with the current code rate, ignoring the target code rate, and continuing to perform multimedia resource transmission at the current code rate.
- the method further includes: in the process of playing the multimedia resource, based on the same media frame with multiple code rates in the buffer area, playing the media frame with the largest code rate among the multiple code rates.
- Fig. 4 is an interaction flow chart of a method for resource transmission according to an embodiment.
- the method for resource transmission can be used in the FAS framework involved in the foregoing implementation environment.
- the embodiment includes the following content.
- the terminal plays the multimedia resource in the resource play interface.
- an application program may be installed on the terminal, and the application program is used to browse multimedia resources.
- 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 example does not specifically limit the type of application.
- the multimedia resources 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 multimedia resources.
- the multimedia resource 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 multimedia resource, and the abbreviated information includes at least one of a title, a brief introduction, a poster, a trailer, or a highlight segment of the multimedia resource.
- the user can click on the abbreviated information of the multimedia resource of interest.
- the terminal can jump from the resource push interface to the resource play interface .
- the resource play interface may include a play area and a comment area, the play area may include the play options of the multimedia resource, and the comment area may include other users' viewing comments on the multimedia resource.
- detailed information of the multimedia resource may also be included in the play area.
- the detailed information may include at least one of the title, brief introduction, keyword, publisher information, or current popularity of the multimedia resource.
- the publisher information may include the nickname of the publisher, the avatar of the publisher, the number of followers of the publisher, etc. The embodiment of the present disclosure does not specifically limit the content of the detailed information or the publisher information.
- the play area may also include a barrage input area and barrage setting options.
- the user can use the barrage setting options to control whether to display the barrage, the movement speed of the barrage, the barrage display area, or the barrage display mode. At least one of (transparency, font size, etc.), the user can also input the content that he wants to comment by clicking on the barrage input area.
- the form of barrage is not limited to text or emoticon images. The embodiment of the present disclosure does not set options for barrage.
- the content or the form of the barrage input by the user is specifically limited.
- the play area may also include a favorite option and a follow option. If the user clicks on the favorite option, the terminal can be triggered to send a favorite request to the server. The server responds to the favorite request and adds the multimedia resource to the user's site. In the corresponding favorites, if the user clicks the follow option, the terminal can be triggered to send a follow request to the server, and the server responds to the follow request and adds the publisher of the multimedia resource to the follow list corresponding to the user.
- the virtual gift gift option may also be included in the playing area. If the user clicks on the gift option, the gift category of the virtual gift and the selection column of the gift amount can be displayed. The user has selected a certain category and a certain amount. After the virtual gift, you can click the confirm button to trigger the terminal to send a virtual gift gift request to the server. The server settles the gift request, deducts a certain value from the user’s account, and distributes a certain value to the host’s account. After the settlement is completed, the terminal can display the special effect animation of the virtual gift in a floating layer in the play area.
- the resource playback interface may have more or fewer layout modes.
- the embodiment of the present disclosure does not specifically limit the layout of the resource playback interface.
- the terminal After displaying the resource play interface, when the user wants to watch the multimedia resource, he can click on the play option in the play area.
- the terminal responds to the user’s touch operation on the play option at the start of the play process (referring to the start of play). ,
- the terminal can obtain the media stream of the multimedia resource with a certain bitrate through the following operations 402-407, call the media codec component to decode the media stream, and call the media playback component to play the decoded media stream .
- the terminal can still retrieve the media stream of the multimedia resource with another bitrate (new Media stream), so as to switch from the original media stream to playing the new media stream, and realize the seamless switching of multiple bit rates.
- new Media stream another bitrate
- the embodiment of the present disclosure does not determine whether the following 402-407 are executed at the start time or are playing It is specifically limited for execution at any playback time in the process.
- the target code rate at that time is determined, and the target code rate is the code rate with the highest degree of matching with the playback state at that time.
- the above 402 is also that the terminal determines the target code rate at the target time, and the target code rate is the code rate that has the highest degree of matching with the playback state at the target time.
- the target time can be the start time of the multimedia resource; or, the target time can also be the download completion time of any group of pictures (GOP) in the multimedia resource; or, the target time can also be It is the playback moment of any media frame in the multimedia resource, and the embodiment of the present disclosure does not specifically limit the target moment as the moment in the playback process.
- GOP group of pictures
- the terminal may also provide a code rate selection list to the user.
- the user clicks on any value in the code rate selection list it triggers the generation of a code rate selection instruction carrying the value, and the terminal responds to the code rate selection instruction to The value carried by the code rate selection instruction is determined as the target code rate.
- the playback service itself will specify a start code rate, or there may be a default play code rate in the MPD of the multimedia resource, so ,
- the terminal can determine the target code rate as the target code rate, which is the start code rate specified by the play service or the default play code rate of the media description file.
- the above-mentioned default playback code rate refers to the code rate of the multimedia resource whose @defaultSelect field is set to true in the media description meta information of the MPD file. Because the media player component cannot play multimedia resources with two code rates by default (there is a play conflict) Therefore, in all media description meta-information, there can only be at most one bit rate of the multimedia resource whose @defaultSelect field is true.
- the terminal may first traverse the media description meta information of the MPD. If there is a unique multimedia resource whose @defaultSelect field is true, the @bitrate field of the multimedia resource is determined as the target bitrate; otherwise, if there is no unique For multimedia resources whose @defaultSelect field is true (for example, there are at least two multimedia resources whose @defaultSelect field is true, or there are no multimedia resources whose @defaultSelect field is true), the terminal can determine whether the playback service specifies a start code If the play service specifies the start code rate, the start code rate is determined as the target code rate. If the play service does not specify the start code rate, the terminal can also adopt the following adaptive strategy based on bandwidth information and media cache The volume automatically determines the target bit rate.
- the terminal may adjust the target bitrate through the following adaptive strategy: the terminal determines the target bitrate based on the bandwidth information at the target time and the amount of media buffer at the target time.
- the bandwidth information may be obtained by sampling at the first sampling interval by the terminal
- the amount of media buffer may be obtained by sampling at the second sampling interval by the terminal.
- the first sampling interval and the second sampling interval may be the same, or Can be different, for example, the two use the same timer to trigger the execution of their own sampling logic.
- the bandwidth information may refer to the transmission rate of multimedia resources.
- T unit: ms, milliseconds
- S unit: bytes, bytes
- the media buffer volume may refer to the data volume of all media frames of the multimedia resource in the buffer area.
- the terminal may determine the estimated buffering amount of at least one candidate bit rate based on the bandwidth information and the media buffering amount.
- the predicted buffering amount refers to continuing the current picture group at the corresponding bit rate from the target moment.
- the download is performed until the estimated media cache amount at the end of the download; based on the estimated cache amount of the at least one candidate code rate, the target code rate is determined from the at least one candidate code rate or the current code rate.
- the terminal can configure two thresholds for the amount of media buffer, including a first threshold and a second threshold, where the first threshold is greater than the second threshold, that is, the first threshold is a higher threshold. If the amount is greater than the first threshold, it indicates that the amount of media buffer is sufficient. At this time, you can try to increase the code rate of the multimedia resource. Therefore, at least one code rate in the set of code rates supported by the multimedia resource that is greater than the current code rate can be determined as At least one candidate bit rate; on the contrary, the second threshold is a lower threshold. If the amount of media cache is less than the second threshold, it means that the amount of media cache is very scarce. At this time, it is necessary to appropriately reduce the code rate of multimedia resources. All code rates in the code rate set supported by the multimedia resource are determined to be at least one candidate code rate.
- the amount of media buffer is greater than the first threshold.
- at least one code rate in the code rate set that is greater than the current code rate is determined as at least one candidate code rate, and the candidate code rate is calculated for any candidate code rate
- the estimated buffer volume of the candidate bit rate can be expressed as the following formula:
- q is the estimated amount of cache
- q c is the amount of media cache at that moment (current cache amount)
- D is the length of the GOP (unit: ms, milliseconds)
- d is the length of the current GOP that has been downloaded ( Unit: ms, milliseconds)
- r is any estimated bit rate
- Best is the bandwidth information at that moment.
- the terminal calculates the estimated buffer amount q of each candidate code rate r (r>r c ), if there is no expected buffer amount greater than the first threshold (q>q h ), then the current bit rate r c can be determined as the target bit rate; otherwise, if there is a multimedia resource with an estimated buffer amount greater than the first threshold (q>q h ), then a candidate that satisfies q>q h
- the maximum candidate code rate among the code rates is determined as the target code rate.
- the amount of media buffer is less than the second threshold.
- all code rates in the code rate set are determined as at least one candidate code rate, and any candidate code rate is performed according to the similar operation as in the above example 1) Obtain the estimated buffering amount of the candidate bit rate, which will not be repeated here.
- the terminal calculates the estimated buffering amount q of each candidate bit rate r, if there are multimedia resources with the estimated buffering amount greater than or equal to the second threshold (q ⁇ q l) , Then the maximum candidate code rate among the candidate code rates that satisfies q ⁇ q l is determined as the target code rate; on the contrary, if there is no multimedia resource with an estimated buffering amount greater than or equal to the second threshold (q ⁇ q l ), then this The terminal also needs to calculate a comparison cache amount.
- the comparison cache amount refers to the estimated cache amount when downloading at the current bit rate until the current GOP is downloaded.
- the comparison cache amount of the current bit rate can be expressed as the following formula:
- r c represents the current code rate
- the meanings of q, q c , D, d, and Best are all consistent with the meanings represented by the same characters in the previous formula, and will not be repeated here.
- a mechanism is provided to determine the target code rate based on bandwidth information and the amount of media buffer, that is, an adaptive adjustment strategy for the target code rate is provided.
- the terminal can call the adaptive adjustment strategy to determine the target bit rate at the start time; or, when each GOP download is completed, the terminal can call the adaptive strategy to determine the download.
- the target bit rate of a GOP this strategy is also called "GOP boundary decision"; or, at the playback moment of any media frame, the terminal can call an adaptive strategy to determine the target bit rate at the next moment, this strategy is also called For "decision at any point.”
- the terminal in addition to determining the target bitrate based on the bandwidth information and the amount of media buffering, the terminal may also determine the target bitrate based on the bandwidth information and the playback status information, where the playback status information may include the amount of video buffering, audio At least one of the amount of buffering, the last stalling time, the last stalling duration, or the frame loss rate within the sampling duration.
- the playback status information may include the amount of video buffering, audio At least one of the amount of buffering, the last stalling time, the last stalling duration, or the frame loss rate within the sampling duration.
- the embodiment of the present disclosure does not specifically limit the content contained in the playback status information. Among them, the amount of video buffering and audio
- the amount of cache can be collectively referred to as the above-mentioned "media cache amount".
- the terminal in response to the target code rate being inconsistent with the current code rate, the terminal obtains the target address information and target location information of the multimedia resource with the target code rate.
- the target location information is used to indicate the start of the media frame of the multimedia resource. Begin to pull the position.
- the terminal in response to the inconsistency between the target code rate and the current code rate, code rate switching is required at this time.
- the terminal can use the target code rate to index and query the MPD to obtain the media description corresponding to the multimedia resource with the target code rate.
- Meta information extract the target address information stored in the @url field from the media description meta information.
- the target location information (@fasSpts) is used to indicate the specific frame from which the server sends the media stream.
- the data type of the target location information can be int64_t, and of course, it can also be other data types. Implementation of the present disclosure The example does not specifically limit the data type of the target location information.
- the target position information represents a relative position parameter relative to the current time. If the target position information is less than 0, the terminal will pull the cached data in a historical period of time. If the target position information is equal to 0, the terminal The real-time media stream will be pulled from the current moment. If the target location information is greater than 0, the terminal will start to pull the real-time media stream at a certain point in the future.
- the terminal determines the target location information based on the buffer duration specified by the playback service.
- the buffer duration specified by the playback service is determined by the business party according to the business requirements. For example, for some short videos, the buffer duration can be set to 8 seconds, and for some long videos, the buffer duration can be set to 1. Minutes, the embodiment of the present disclosure does not specifically limit the value of the cache duration.
- the playback service may not specify the cache duration, but directly specify a target location information.
- the target location information specified by the service party may be recorded as "fasSptsInit".
- the embodiment of the present disclosure does not specify the cache duration or the specified value for the service party.
- the target location information is specifically limited.
- the terminal Based on the target time being the download completion time of any group of pictures (GOP) in the multimedia resource, the terminal determines the time stamp of the first frame in the next group of pictures of the group of pictures as the target location information.
- the target time being the download completion time of any group of pictures (GOP) in the multimedia resource
- the terminal calls the adaptive strategy of GOP boundary decision to determine the target code rate of the next GOP.
- the first frame of the next GOP can be PTS (Presentation Time Stamp) is determined as the target location information, where, if the buffer area includes video resources, then the first frame refers to the first I frame in the video resources, if the buffer area does not include video resources, Then the first frame refers to the first audio frame in the audio resource.
- PTS Presentation Time Stamp
- the terminal Based on the target moment being the playback moment of any media frame in the multimedia resource, the terminal determines the time stamp of the first frame in the currently downloaded picture group as the target location information.
- the terminal calls the adaptive strategy of decision at any point to determine the target bit rate at any time of playback.
- the bit rate of the I frame and the P frame (or B frame) in the GOP is Different, then it will not be able to decode, so the code rate can only be switched between GOPs, not within the GOP, and any playback time cannot be guaranteed to be exactly at the download completion time of a GOP. Therefore, when determining the target After the bit rate, the terminal can choose to pull the current entire GOP once again, so the PTS of the first frame in the currently downloaded GOP is determined as the target location information.
- the buffer area includes video resources
- the first frame refers to The first I frame in the video resource. If the video resource is not included in the buffer area, then the first frame refers to the first audio frame in the audio resource.
- both are the scenes when the code rate is switched during the playback process, and not belong to the start scene in 1).
- the target address information determined in the code rate switching scene can be recorded as "UrlSwitch”, the determined target location information can be recorded as "fasSptsSwitch”.
- the above 403 refers to the processing logic of how the terminal determines the target address information and target location information when the target code rate is inconsistent with the current code rate.
- the terminal in response to the target code rate being consistent with the current code rate, , can ignore the target code rate and continue to perform multimedia resource transmission at the current code rate. At this time, the code rate remains unchanged, and the address information of the stream is unchanged. The terminal does not need to generate a new frame acquisition request, and does not need to send redundant For the remaining frame acquisition requests, just continue to perform media streaming according to the FAS standard at the current bit rate.
- the terminal embeds the target location information into the frame acquisition request carrying the target address information.
- the aforementioned frame acquisition request may include an address information field (@url) and an extension field.
- the terminal may write target address information into the address information field of the frame acquisition request, and write target location information into the extension field of the frame acquisition request.
- the viewer user enters the live broadcast room of a certain anchor user in the application program (a live broadcast interface, which belongs to a resource playback interface).
- a live broadcast interface which belongs to a resource playback interface.
- the terminal needs to pull a certain buffered media stream and start it. Play.
- the terminal obtains the corresponding media stream corresponding to the requested media stream according to the initial media stream specified by the service (media stream with the start bit rate) or the default initial media stream in the MPD (media stream with the default playback bit rate).
- Target address information (@url). At this time, the target address information at the start time can be recorded as "urlStart".
- the start time The target address information and the target location information are encapsulated in the frame acquisition request.
- the target bit rate output by the adaptive strategy is inconsistent with the current bit rate.
- the terminal needs to switch the bit rate. Mark the target address information in the code rate switching process as "urlSwitch”, mark the target location information in the code rate switching process as "fasSptsSwitch”, and encapsulate the target address information and target position information during the code rate switching in the frame acquisition request,
- the terminal sends a frame acquisition request carrying the target address information and target location information to the server, and the frame acquisition request is used to instruct the server to return the media frame of the multimedia resource at the target code rate starting from the target location information.
- the terminal encapsulates both the target address information and the target location information in the frame acquisition request.
- the terminal may only encapsulate the target address information in the frame acquisition request, that is, the frame The target location information is defaulted in the acquisition situation.
- the server will configure the default value of the target location information in accordance with the FAS specification, so that the media streaming starts from the default value of the target location information.
- the extension field of the frame acquisition request may also carry audio parameters, which are used to indicate whether the requested media frame is an audio frame. If set to true, it means that the media frame pulled by the terminal is audio. Frame, that is, only the pure audio stream is pulled, otherwise, if it is set to false, it means that the media frame pulled by the terminal is an audio and video frame, that is, the audio stream and the video picture stream are pulled. "False" is used as the default value.
- the terminal when configuring audio parameters, can obtain the type of multimedia resource. If the type of multimedia resource is video, the first extended parameter can be set to "false" or a default value. If the type of multimedia resource is audio , You can set the first extended parameter to "true”.
- the terminal when configuring audio parameters, can also detect the type of application. If the type of the application is a video application, the first extended parameter can be set to "false" or a default value. If the type of the application is For audio applications, the first extended parameter can be set to "true”.
- the frame acquisition request may not carry audio parameters, or target location information, or neither audio parameters nor target location information.
- the embodiment of the present disclosure does not specifically limit the content of the extension field.
- the server in response to the frame acquisition request, returns the media frame of the multimedia resource to the terminal at the target bit rate starting from the target location information.
- the server can parse the frame acquisition request to obtain the target address information and target location information. Based on the target address information, the server locates the media of the multimedia resource with the target code rate from the resource library. Frames, starting from the target location information and sending the media frames of the multimedia resources to the terminal at the target bit rate (consecutive media frames form a media stream) in the order of the timestamp from small to large.
- the server can configure the default value of the target location information. Whether it is parsed from the frame acquisition request or configured by itself, the server can determine The target location information, further, based on the target location information to determine from which timestamp to start pulling the media frame, so that the server can start from the timestamp indicated by the target location information and return the media in the form indicated by the audio parameters to the terminal at the target bit rate frame.
- the target address information can be a domain name
- the terminal can send a frame acquisition request to the central platform of the CDN server, and the central platform calls DNS (Domain Name System, domain name system), which is essentially A domain name resolution library) parses the domain name to obtain the CNAME (alias) record corresponding to the domain name. Based on the geographic location information of the terminal, the CNAME record is parsed again to obtain the IP (Internet Protocol, Internet Protocol) of the edge server closest to the terminal. Interconnection protocol) address.
- DNS Domain Name System, domain name system
- IP Internet Protocol, Internet Protocol
- the central platform directs the frame acquisition request to the above-mentioned edge server, and the edge server responds to the frame acquisition request to provide the terminal with the media frame of the multimedia resource at the target bit rate, so that the terminal can access the target code nearby Rate of multimedia resources.
- the terminal in response to receiving the media frame of the multimedia resource of the target code rate, switches to play the media frame of the multimedia resource of the target code rate.
- the terminal can store the media frame in the buffer area and call the media codec component to The media frame is decoded to obtain the decoded media frame, and the media playback component is called to play the media frames in the buffer area according to the time stamp (PTS) from small to large.
- PTS time stamp
- the terminal can determine the encoding method of the multimedia resource from the @codec field of the media description file, and determine the corresponding decoding method according to the encoding method, so as to decode the media frame according to the determined decoding method.
- the terminal when the terminal sends the frame acquisition request corresponding to the bit rate to be switched, it can choose to disconnect the existing media stream transmission link, or it can choose not to disconnect the existing media stream transmission link. In the case of some media stream transmission links, it is equivalent to the establishment of two media stream transmission links.
- the terminal is based on a primary and secondary stream for playback. The original media stream is used as a backup stream, and the new media stream is played first. , Once the transmission of the new media stream is abnormal, you can continue to play the backup stream.
- the terminal plays the media frame with the largest code rate among the multiple code rates.
- this streaming-based media transmission method can achieve frame-level transmission of multimedia resources, and since the frame acquisition request carries target location information, it can achieve seamless between media streams of different bit rates.
- Switching achieves the purpose of multi-rate adaptation. If the network condition changes and the code rate needs to be switched, the code rate can be seamlessly switched through the FAS framework.
- Fig. 5 is a block diagram showing a logical structure of a resource transmission device according to an embodiment. 5, the device includes a first determining unit 501, an acquiring unit 502, and a sending unit 503:
- the first determining unit 501 is configured to perform, at any moment when the multimedia resource is played, a target bit rate at that moment is determined, and the target bit rate is a bit rate that has the highest degree of matching with the playback state at that moment;
- the first determining unit 501 is configured to determine the target code rate at the target time, and the target code rate is the code rate that has the highest degree of matching with the playback state at the target time;
- the obtaining unit 502 is configured to perform, if the target code rate is inconsistent with the current code rate, obtain the target address information of the multimedia resource of the target code rate;
- the obtaining unit 502 is configured to perform, in response to the target code rate being inconsistent with the current code rate, obtaining the target address information of the multimedia resource with the target code rate;
- the sending unit 503 is configured to send a frame acquisition request carrying the target address information to the server, where the frame acquisition request is used to instruct the server to return the media frame of the multimedia resource at the target code rate.
- the target time is the start time of the multimedia resource; or, the target time is the download completion time of any picture group in the multimedia resource; or, the target time is any media in the multimedia resource The playback moment of the frame.
- the first determining unit 501 includes: a determining subunit configured to determine the target bitrate based on the bandwidth information at the target time and the amount of media buffering at the target time .
- the determining subunit is configured to execute: based on the bandwidth information and the media buffer amount, determine an estimated buffer amount of at least one candidate bit rate, and the estimated buffer amount refers to a corresponding amount from the target moment.
- the bit rate continues to download the current group of pictures until the estimated amount of media cache at the end of the download; based on the estimated cache amount of the at least one candidate bit rate, the at least one candidate bit rate or the current bit rate is determined Target bit rate.
- the first determining unit 501 is configured to perform: based on the target moment being the start time of the multimedia resource, the start code rate specified by the play service or the default play code rate of the media description file is determined Is the target bit rate.
- the device further includes: a second determining unit configured to determine target location information in response to the target code rate being inconsistent with the current code rate, and the target location information is used for Represents the initial pull position of the media frame of the multimedia resource; the embedding unit is configured to embed the target position information into the frame acquisition request carrying the target address information.
- the second determining unit is configured to perform: determine the target location information based on the target time being the start time of the multimedia resource, and based on the buffer duration specified by the playback service; or, based on the target time Is the download completion time of any picture group in the multimedia resource, and the timestamp of the first frame in the next picture group of the picture group is determined as the target location information; or, based on the target time as any one of the multimedia resources At the playback time of the media frame, the time stamp of the first frame in the currently downloaded picture group is determined as the target location information.
- the apparatus further includes: a transmission unit configured to perform response to the target code rate being consistent with the current code rate, ignore the target code rate, and continue execution at the current code rate Multimedia resource transmission.
- the device further includes: a playback unit configured to perform, during the process of playing multimedia resources, to play the same media frame with multiple bit rates in the buffer area.
- Fig. 6 shows a structural block diagram of a terminal provided by an embodiment of the present disclosure.
- the terminal 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, moving picture experts compressing standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, moving picture experts compressing standard audio Level 4) Player, laptop or desktop computer.
- the terminal 600 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
- the terminal 600 includes a processor 601 and a memory 602.
- the processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
- the processor 601 can adopt 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 601 may also include a main processor and a coprocessor.
- the main processor is a processor used to process data in the awake 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 601 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing content that needs to be displayed on the display screen.
- the processor 601 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 602 may include one or more computer-readable storage media, which may be non-transitory.
- the memory 602 may also include a high-speed random access memory and a 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 602 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 601 to implement the resource transmission provided by the various embodiments of the present disclosure. method.
- the terminal 600 may optionally further include: a peripheral device interface 603 and at least one peripheral device.
- the processor 601, the memory 602, and the peripheral device interface 603 may be connected by a bus or a signal line.
- Each peripheral device can be connected to the peripheral device interface 603 through a bus, a signal line, or a circuit board.
- the peripheral device includes at least one of a radio frequency circuit 604, a touch display screen 605, a camera component 606, an audio circuit 607, a positioning component 608, and a power supply 609.
- the peripheral device interface 603 can be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 601 and the memory 602.
- the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 601, the memory 602, and the peripheral device interface 603 or The two can be implemented on separate chips or circuit boards, which are not limited in the embodiments of the present disclosure.
- the radio frequency circuit 604 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
- the radio frequency circuit 604 communicates with a communication network and other communication devices through electromagnetic signals.
- the radio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
- the radio frequency circuit 604 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 604 can communicate with other terminals through at least one wireless communication protocol.
- the wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity, wireless fidelity) networks.
- the radio frequency circuit 604 may also include a circuit related to NFC (Near Field Communication), which is not limited in the present disclosure.
- the display screen 605 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 605 also has the ability to collect touch signals on or above the surface of the display screen 605.
- the touch signal can be input to the processor 601 as a control signal for processing.
- the display screen 605 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
- the display screen 605 may be one display screen 605, which is provided with the front panel of the terminal 600; in other embodiments, there may be at least two display screens 605, which are respectively provided on different surfaces of the terminal 600 or in a folded design; In still other embodiments, the display screen 605 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 600. Furthermore, the display screen 605 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen.
- the display screen 605 may be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
- the camera assembly 606 is used to capture images or videos.
- the camera assembly 606 includes a front camera and a rear camera.
- the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
- the camera assembly 606 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 607 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 601 for processing, or input to the radio frequency circuit 604 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively set in different parts of the terminal 600.
- 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 601 or the radio frequency circuit 604 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 607 may also include a headphone jack.
- the positioning component 608 is used to locate the current geographic location of the terminal 600 to implement navigation or LBS (Location Based Service, location-based service).
- the positioning component 608 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, the Granus system of Russia, or the Galileo system of the European Union.
- the power supply 609 is used to supply power to various components in the terminal 600.
- the power source 609 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
- the rechargeable battery may support wired charging or wireless charging.
- the rechargeable battery can also be used to support fast charging technology.
- the terminal 600 further includes one or more sensors 610.
- the one or more sensors 610 include, but are not limited to: an acceleration sensor 611, a gyroscope sensor 612, a pressure sensor 613, a fingerprint sensor 614, an optical sensor 615, and a proximity sensor 616.
- the acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 600.
- the acceleration sensor 611 can be used to detect the components of the gravitational acceleration on three coordinate axes.
- the processor 601 may control the touch screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611.
- the acceleration sensor 611 may also be used for the collection of game or user motion data.
- the gyroscope sensor 612 can detect the body direction and rotation angle of the terminal 600, and the gyroscope sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the terminal 600.
- the processor 601 can implement the following functions according to the data collected by the gyroscope sensor 612: motion sensing (for example, changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
- the pressure sensor 613 may be disposed on the side frame of the terminal 600 and/or the lower layer of the touch screen 605.
- the processor 601 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 613.
- the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 605.
- 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 614 is used to collect the user's fingerprint.
- the processor 601 can identify the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 can identify the user's identity based on the collected fingerprints. When it is recognized that the user's identity is a trusted identity, the processor 601 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
- the fingerprint sensor 614 may be provided on the front, back or side of the terminal 600. When a physical button or a manufacturer logo is provided on the terminal 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.
- the optical sensor 615 is used to collect the ambient light intensity.
- the processor 601 may control the display brightness of the touch screen 605 according to the ambient light intensity collected by the optical sensor 615. In some embodiments, when the ambient light intensity is high, the display brightness of the touch display screen 605 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 605 is decreased. In another embodiment, the processor 601 may also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
- the proximity sensor 616 also called a distance sensor, is usually arranged on the front panel of the terminal 600.
- the proximity sensor 616 is used to collect the distance between the user and the front of the terminal 600.
- the processor 601 controls the touch screen 605 to switch from the on-screen state to the off-screen state; when the proximity sensor 616 detects When the distance between the user and the front of the terminal 600 gradually increases, the processor 601 controls the touch display screen 605 to switch from the rest screen state to the bright screen state.
- FIG. 6 does not constitute a limitation on the terminal 600, and may include more or fewer components than those shown in the figure, or combine some components, or adopt different component arrangements.
- the terminal 600 includes one or more processors, and one or more memories for storing executable instructions of the one or more processors, wherein the one or more processors are configured to The instruction is executed to implement the resource transmission method involved in each of the foregoing embodiments.
- a storage medium including at least one instruction such as a memory including at least one instruction
- the foregoing at least one instruction may be executed by a processor in a terminal to complete the resource transmission method in the foregoing embodiment.
- the aforementioned storage medium may be a non-transitory computer-readable storage medium.
- the non-transitory computer-readable storage medium may include ROM (Read-Only Memory, read-only memory), RAM (Random-Access Memory) , Random Access Memory), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), magnetic tape, floppy disk and optical data storage devices, etc.
- a computer program product including one or more instructions, and the one or more instructions can be executed by the processor of the terminal to complete the resource transmission methods provided in the foregoing embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本公开关于一种资源传输方法及终端,属于通信技术领域。本公开通过确定目标时刻的目标码率,响应于该目标码率与当前码率不一致,获取具备该目标码率的多媒体资源的目标地址信息,向服务器发送携带该目标地址信息的帧获取请求,该帧获取请求用于指示该服务器以该目标码率返回该多媒体资源的媒体帧。
Description
本公开要求于2020年01月17日提交的申请号为202010054775.2、发明名称为“资源传输方法、装置、终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
本公开涉及通信技术领域,特别涉及一种资源传输方法及终端。
随着通信技术的发展,用户可以随时随地在终端上浏览音视频资源,目前,在服务器向终端传输音视频资源(俗称为“拉流阶段”)时,可以采用基于分片的媒体传输方式。
基于分片的媒体传输方式包括常见的DASH(Dynamic Adaptive Streaming over HTTP,MPEG制定的基于HTTP的自适应流媒体传输标准,其中,MPEG的英文全称为Moving Picture Experts Group,中文全称为动态图像专家组)、HLS(HTTP Live Streaming,苹果公司制定的基于HTTP的自适应流媒体传输标准)等,服务器将音视频资源切分成一段一段的音视频片段,每个音视频片段都可以转码成不同的码率,终端在播放音视频资源时,分别访问音视频资源所切分成的各个音视频片段的网址,不同的音视频片段之间可以对应于相同或不同的码率,使得终端能够方便地在不同码率的音视频资源中进行切换,这种过程也称为基于终端自身带宽情况自适应调整码率。
发明内容
本公开提供一种资源传输方法及终端。本公开的技术方案如下:
根据本公开实施例的一方面,提供一种资源传输方法,包括:确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
根据本公开实施例的另一方面,提供一种资源传输装置,包括:第一确定单元,被配置为执行确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;获取单元,被配置为执行响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;发送单元,被配置为执行向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
根据本公开实施例的另一方面,提供一种终端,包括:一个或多个处理器;用于存储所述一个或多个处理器可执行指令的一个或多个存储器;其中,所述一个或多个处理器被配置为执行该指令,以实现如下操作:确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
根据本公开实施例的另一方面,提供一种存储介质,当所述存储介质中的至少一条指令由终端的一个或多个处理器执行时,使得终端能够执行如下操作:确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
根据本公开实施例的另一方面,提供一种计算机程序产品,包括一条或多条指令,所述一条或多条指令可以由终端的一个或多个处理器执行,使得终端能够执行上述资源传输方法。
图1是根据一实施例示出的一种资源传输方法的实施环境示意图;
图2是本公开实施例提供的一种FAS框架的原理性示意图;
图3是根据一实施例示出的一种资源传输方法的流程图;
图4是根据一实施例示出的一种资源传输方法的交互流程图;
图5是根据一实施例示出的一种资源传输装置的逻辑结构框图;
图6示出了本公开一个实施例提供的一种终端的结构框图。
本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。
本公开所涉及的用户信息可以为经用户授权或者经过各方充分授权的信息。
以下,对本公开所涉及的术语进行解释。
一、FLV(Flash Video)
FLV是一种流媒体格式,FLV流媒体格式是随着Flash MX(一种动画制作软件)的推出发展而来的视频格式。由于它形成的文件极小、加载速度极快,使得网络观看视频文件(也即在线浏览视频)成为可能,它的出现有效地解决了视频文件导入Flash后导出的SWF(一种Flash的专用文件格式)文件体积庞大,以致不能在网络上很好的使用等问题。
二、流媒体(Streaming Media)
流媒体采用流式传输方法,是指将一连串的多媒体资源压缩后,通过网络发送资源包,从而在网上即时传输多媒体资源以供观赏的一种技术与过程,此技术使得资源包得以像流水一样发送;如果不使用此技术,就必须在使用前下载整个媒体文件,从而仅能进行离线观看多媒体资源。流式传输可传送现场多媒体资源或预存于服务器上的多媒体资源,当观众用户在收看这些多媒体资源时,多媒体资源在送达观众用户的观众终端后可以由特定播放软件进行播放。
三、FAS(FLV Adaptive Streaming,基于FLV的自适应流媒体传输标准)
FAS是本公开所提出的流式资源传输标准(或称为资源传输协议),与传统的基于分片的媒体传输方式不同,在FAS标准中,终端在启播时刻向服务器发送某一启播码率对应的帧获取请求,服务器响应于帧获取请求,按照启播码率将对应多媒体资源的媒体帧传输至终端,此后服务器与终端之间进行帧级别的多媒体传输,服务器无需等待一个完整的视频片段到达之后才能向终端发送资源包,而是能够将实时媒体帧逐帧发送到终端,终端在接收到媒体帧之后,可以进行缓存、解码、渲染等操作,从而在终端上播放媒体帧,在播放过程中若 需要进行码率切换,仅在需要切换码率的时刻重新发送某一待切换码率对应的帧获取请求,服务器进行类似的处理逻辑,能够按照待切换码率将对应多媒体资源的媒体帧传输至终端,从而实现动态码率切换。其中,上述启播码率和待切换码率均可以视为是目标码率的示例。
在一些实施例中,终端可以在帧获取请求中指定目标位置信息,从而保证从目标位置信息开始拉取媒体流,或者,终端也可以不在帧获取请求中指定目标位置信息,这时服务器会将目标位置信息配置为默认值,从而使得终端从目标位置信息的默认值开始拉取媒体流。在一些实施例中,响应于目标位置信息小于零,服务器可以从目标位置信息开始将已缓存的所有媒体帧打包发送至终端(无需分片),在一些实施例中,响应于目标位置信息大于或等于零或者除了已缓存的媒体帧之外还存在实时流,服务器可以将实时缓存的多媒体资源的媒体帧逐帧发送至终端。
需要说明的是,上述待切换码率可以基于终端自身的带宽信息以及媒体缓存量而确定,当带宽信息或者媒体缓存量发生变化时,终端可以适应性调整待切换码率,重新发送与待切换码率对应的帧获取请求。
四、直播与点播
直播:多媒体资源是实时录制的,主播用户通过主播终端将媒体流“推流”(指基于流式传输方式推送)到服务器上,观众用户在观众终端上触发进入主播用户的直播界面之后,将媒体流从服务器“拉流”(指基于流式传输方式拉取)到观众终端,观众终端解码并播放多媒体资源,从而实时地进行视频播放。
点播:也称为Video On Demand(VOD),多媒体资源预存在服务器上,服务器能够根据观众用户的要求来提供观众用户指定的多媒体资源,在一些实施例中,观众终端向服务器发送点播请求,服务器查询到点播请求所指定的多媒体资源之后,将多媒体资源发送至观众终端,也即是说,观众用户能够选择性地播放某个特定的多媒体资源。
点播的内容可以任意控制播放进度,而直播则不然,直播的内容播放速度取决于主播用户的实时直播进度。
图1是根据一实施例示出的一种资源传输方法的实施环境示意图,参见图1,在该实施环境中可以包括至少一个终端101和服务器102,下面进行详述:
在一些实施例中,终端101用于进行多媒体资源传输,在每个终端上可以 安装有媒体编解码组件以及媒体播放组件,该媒体编解码组件用于在接收多媒体资源(例如分片传输的资源包、帧级传输的媒体帧)之后进行多媒体资源的解码,该媒体播放组件用于在解码多媒体资源之后进行多媒体资源的播放。
按照用户身份的不同,终端101可以划分为主播终端以及观众终端,主播终端对应于主播用户,观众终端对应于观众用户,需要说明的是,对同一个终端而言,该终端即可以是主播终端,也可以是观众终端,比如,用户在录制直播时该终端为主播终端,用户在观看直播时该终端为观众终端。
终端101和服务器102可以通过有线网络或无线网络相连。
在一些实施例中,服务器102,用于提供待传输的多媒体资源,服务器102可以包括一台服务器、多台服务器、云计算平台或者虚拟化中心中的至少一种。在一些实施例中,服务器102承担主要计算工作,终端101承担次要计算工作;或者,服务器102承担次要计算工作,终端101承担主要计算工作;或者,终端101和服务器102两者之间采用分布式计算架构进行协同计算。
在一些实施例中,服务器102可以是集群式的CDN(Content Delivery Network,内容分发网络)服务器,CDN服务器包括中心平台以及部署在各地的边缘服务器,通过中心平台的负载均衡、内容分发、调度等功能模块,使得用户所在终端能够依靠当地的边缘服务器来就近获取所需内容(即多媒体资源)。
CDN服务器在终端与中心平台之间增加了一个缓存机制,该缓存机制也即是部署在不同地理位置的边缘服务器(比如WEB服务器),在性能优化时,中心平台会根据终端与边缘服务器的距离远近,调度与终端之间距离最近的边缘服务器来向终端提供服务。
本公开实施例所涉及的多媒体资源,包括但不限于:视频资源、音频资源、图像资源或者文本资源中至少一项,本公开实施例不对多媒体资源的类型进行具体限定。比如,该多媒体资源为网络主播的直播视频流,或者为预存在服务器上的历史点播视频,或者为电台主播的直播音频流,或者为预存在服务器上的历史点播音频。
在一些实施例中,终端101的设备类型包括但不限于:电视机、智能手机、智能音箱、车载终端、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机或者台式计算机中的至少一种。以下实施例,以终端101 包括智能手机来进行举例说明。
本领域技术人员可以知晓,上述终端101的数量可以仅为一个,或者终端101的数量为几十个或几百个,或者更多数量。本公开实施例对终端101的数量和设备类型不加以限定。
图2是本公开实施例提供的一种FAS框架的原理性示意图,请参考图2,本公开实施例提供一种FAS(基于流式的多码率自适应)框架,在该框架内,终端101与服务器102之间通过FAS协议进行多媒体资源传输。
以任一终端为例进行说明,在终端上可以安装有应用程序(亦称为FAS客户端),该应用程序用于浏览多媒体资源,例如,该应用程序可以为短视频应用、直播应用、视频点播应用、社交应用、购物应用等,本公开实施例不对应用程序的类型进行具体限定。
用户可以在终端上启动应用程序,显示资源推送界面(例如应用程序的首页或者功能界面),在该资源推送界面中包括至少一个多媒体资源的缩略信息,该缩略信息包括标题、简介、发布者、海报、预告片或者精彩片段中至少一项,响应于用户对任一多媒体资源的缩略信息的触控操作,终端可以从资源推送界面跳转至资源播放界面,在该资源播放界面中包括该多媒体资源的播放选项,响应于用户对该播放选项的触控操作,终端从服务器中下载该多媒体资源的媒体描述文件(Media Presentation Description,MPD)。
进一步地,基于该媒体描述文件,确定具备启播码率(或默认播放码率,指启播时刻的目标码率)的多媒体资源的目标地址信息,向服务器发送启播码率(或默认播放码率)对应的帧获取请求(或称为FAS请求),使得服务器基于一定的规范(FAS请求的处理规范)来处理该帧获取请求,服务器定位到该多媒体资源的媒体帧(连续的媒体帧可以构成媒体流)之后,以启播码率(或默认播放码率)向终端返回该多媒体资源的媒体帧(也即以目标码率向终端返回媒体流)。终端接收到媒体流之后,调用媒体编解码组件对媒体流进行解码,得到解码后的媒体流,调用媒体播放组件播放解码后的媒体流。
在一些实施例中,由于服务器在对多媒体资源进行转码之后,可能会形成多种码率的多媒体资源,此时服务器可以为不同码率的多媒体资源分配不同的地址信息,将各种码率的多媒体资源的地址信息均记录在MPD中,终端下载MPD之后,可以在不同时刻向服务器发送携带不同地址信息的帧获取请求,那 么服务器会以不同的码率返回对应的多媒体资源的媒体帧。
进一步地,提供一种自适应调整码率的机制,随着终端当前的带宽信息或者媒体缓存量的波动变化,终端上多媒体资源的播放状态也会随之改变,终端可以适应性调整与当前播放状态匹配度最高的待切换码率(也即是播放过程中的目标码率)。在一些实施例中,FAS标准在帧获取请求中提供一种目标位置信息,不同的目标位置信息能够指定多媒体资源的不同起始拉取位置,那么在帧获取请求中规定了目标位置信息(若缺省,则服务器会配置默认值)和码率之后,若在播放过程中需要进行码率切换,终端只需要再次发送新的帧获取请求,服务器能够随时地从目标位置信息开始按照另一码率向终端发送媒体流,也即终端能够动态地从任一起始的媒体帧开始拉取另一码率的媒体流。
在一些实施例中,在需要切换码率时,终端可以断开当前码率的媒体流传输链接,向服务器发送携带待切换码率所对应目标地址信息的帧获取请求,建立基于待切换码率的媒体流传输链接,或者,终端也可以不断开当前码率的媒体流传输链接,而是直接重新发起携带待切换码率所对应目标地址信息的帧获取请求,建立基于待切换码率的媒体流传输链接(用于传输新的媒体流),将原有的媒体流作为备用流,一旦新的媒体流出现传输异常,那么可以继续播放备用流。
以下,将对上述FAS框架内的MPD文件进行介绍:
在一些实施例中,MPD文件可以包括版本号(@version)和媒体描述集合(@adaptationSet),还可以包括服务类型(@type)、用于表示是否打开自适应功能的功能选项(@hideAuto)或者用于表示是否在启播时默认打开自适应功能的功能选项(@autoDefaultSelect)中至少一项,本公开实施例不对MPD文件承载的内容进行具体限定。
其中,版本号可以包括该媒体描述文件的版本号或者资源传输标准(FAS标准)的版本号中至少一项。
其中,该媒体描述集合用于表示多媒体资源的元信息,该媒体描述集合可以包括多个媒体描述元信息,每个媒体描述元信息对应于一种码率的多媒体资源,每个媒体描述元信息可以包括该媒体描述元信息所对应码率的多媒体资源的画面组长度(@gopDuration)以及属性信息(@representation)。
画面组(Group Of Pictures,GOP)长度是指两个关键帧之间的距离,关键 帧是指视频编码序列中的帧内编码图像帧(Intra-coded picture,也称为“I帧”),I帧的编解码不需要参考其他图像帧,仅利用本帧信息即可实现,而相对地,P帧(Predictive-coded picture,预测编码图像帧)和B帧(Bidirectionally predicted picture,双向预测编码图像帧)的编解码均需要参考其他图像帧,仅利用本帧信息无法完成编解码。
每个属性信息可以包括多媒体资源的标识信息(@id,独一无二的标识符)、多媒体资源的编码方式(@codec,遵从的编解码标准)、多媒体资源所支持的码率(@bitrate,资源传输时单位时间内传送的数据位数)以及该码率的多媒体资源的地址信息(@url,某一码率的多媒体资源对外提供的URL或域名,URL是指统一资源定位符,英文全称为:Uniform Resource Locator),当然,每个属性信息还可以包括多媒体资源的质量类型(@qualityType,包括分辨率、帧率等质量评价指标)、多媒体资源的隐藏选项(@hiden,用于表示某一码率的多媒体资源是否外显,也即用户是否能够手动该码率的多媒体资源)、用于表示多媒体资源是否相对于自适应功能可见的功能选项(@enableAdaptive,指自适应功能能否选中某一码率的多媒体资源)或者默认播放功能选项(@defaultSelect,指是否在启播时默认播放某一码率的多媒体资源)中至少一项。
其中,服务类型用于指定多媒体资源的业务类型,包括直播或者点播中至少一项。
在一些实施例中,MPD文件格式可以为JSON(JavaScript Object Notation,JS对象简谱),也可以为其他脚本格式,本公开实施例不对MPD文件格式进行具体限定。
图3是根据一实施例示出的一种资源传输方法的流程图,所述资源传输方法应用于上述实施环境涉及的FAS框架中的终端,下面进行详述。
在301中,终端在播放多媒体资源的任一时刻,确定该时刻的目标码率,该目标码率为与该时刻的播放状态匹配度最高的码率。
上述301也即,终端确定目标时刻的目标码率,该目标码率为与该目标时刻的播放状态匹配度最高的码率。
在302中,若该目标码率与当前码率不一致,终端获取该目标码率的多媒体资源的目标地址信息。
上述302也即,终端响应于该目标码率与当前码率不一致,获取具备该目 标码率的多媒体资源的目标地址信息。
在303中,终端向服务器发送携带该目标地址信息的帧获取请求,该帧获取请求用于指示该服务器以该目标码率返回该多媒体资源的媒体帧。
在一些实施例中,该目标时刻为该多媒体资源的启播时刻;或,该目标时刻为该多媒体资源中任一个画面组的下载完毕时刻;或,该目标时刻为该多媒体资源中任一媒体帧的播放时刻。
在一些实施例中,确定目标时刻的目标码率包括:基于该目标时刻的带宽信息以及该目标时刻的媒体缓存量,确定该目标码率。
在一些实施例中,基于该目标时刻的带宽信息以及该目标时刻的媒体缓存量,确定该目标码率包括:基于该带宽信息和该媒体缓存量,确定至少一种候选码率的预计缓存量,该预计缓存量是指从该目标时刻起按照对应码率对当前画面组继续进行下载,直到下载结束时刻所预计的媒体缓存量;基于该至少一种候选码率的预计缓存量,从该至少一种候选码率或者该当前码率中确定该目标码率。
在一些实施例中,确定目标时刻的目标码率包括:基于该目标时刻为该多媒体资源的启播时刻,将播放业务所指定的启播码率或者媒体描述文件的默认播放码率确定为该目标码率。
在一些实施例中,该方法还包括:响应于该目标码率与当前码率不一致,确定目标位置信息,该目标位置信息用于表示对该多媒体资源的媒体帧的起始拉取位置;将该目标位置信息嵌入到携带该目标地址信息的帧获取请求中。
在一些实施例中,确定目标位置信息包括:基于该目标时刻为该多媒体资源的启播时刻,基于播放业务所指定的缓存时长,确定该目标位置信息;或,基于该目标时刻为该多媒体资源中任一个画面组的下载完毕时刻,将该画面组的下一个画面组中第一帧的时间戳确定为该目标位置信息;或,基于该目标时刻为该多媒体资源中任一媒体帧的播放时刻,将当前下载的画面组中第一帧的时间戳确定为该目标位置信息。
在一些实施例中,该方法还包括:响应于该目标码率与当前码率一致,忽略该目标码率,以该当前码率继续执行多媒体资源传输。
在一些实施例中,该方法还包括:在播放多媒体资源的过程中,基于缓存区中存在多种码率的同一媒体帧,播放该多种码率中最大码率的媒体帧。
图4是根据一实施例示出的一种资源传输方法的交互流程图,所述资源传输方法可以用于上述实施环境涉及的FAS框架中,该实施例包括以下内容。
在401中,终端在资源播放界面中播放多媒体资源。
其中,终端上可以安装有应用程序,该应用程序用于浏览多媒体资源,例如,该应用程序可以包括短视频应用、直播应用、视频点播应用、社交应用或者购物应用中至少一项,本公开实施例不对应用程序的类型进行具体限定。
本公开实施例所涉及的多媒体资源,包括但不限于:视频资源、音频资源、图像资源或者文本资源中至少一项,本公开实施例不对多媒体资源的类型进行具体限定。比如,该多媒体资源为网络主播的直播视频流,或者为预存在服务器上的历史点播视频,或者为电台主播的直播音频流,或者为预存在服务器上的历史点播音频。
在上述过程中,用户可以在终端上启动应用程序,该应用程序显示资源推送界面,例如该资源推送界面可以是应用程序的首页或者功能界面,本公开实施例不对资源推送界面的类型进行具体限定。在该资源推送界面中可以包括至少一个多媒体资源的缩略信息,该缩略信息包括多媒体资源的标题、简介、海报、预告片或者精彩片段中至少一项。用户在浏览资源推送界面的过程中,可以点击感兴趣的多媒体资源的缩略信息,响应于用户对该多媒体资源的缩略信息的触控操作,终端可以从资源推送界面跳转至资源播放界面。
在该资源播放界面中可以包括播放区域和评论区域,在播放区域内可以包括该多媒体资源的播放选项,在评论区域内可以包括其他用户针对该多媒体资源的观看评论。
在一些实施例中,在播放区域内还可以包括该多媒体资源的详情信息,该详情信息可以包括该多媒体资源的标题、简介、关键词、发布者信息或者当前热度中至少一项,其中,该发布者信息可以包括发布者昵称、发布者头像、发布者粉丝量等,本公开实施例不对详情信息或者发布者信息的内容进行具体限定。
在一些实施例中,在播放区域内还可以包括弹幕输入区和弹幕设置选项,用户可以通过弹幕设置选项控制是否显示弹幕、弹幕移动速度、弹幕显示区域或者弹幕显示方式(透明度、字号大小等)中至少一项,用户还可以通过点击弹幕输入区,输入自己想要评论的内容,弹幕形式不限于文本或者表情图像,本公开实施例不对弹幕设置选项的内容或者用户输入的弹幕形式进行具体限 定。
在一些实施例中,在播放区域内还可以包括收藏选项和关注选项,若用户点击收藏选项,可以触发终端向服务器发送收藏请求,服务器响应于该收藏请求,将该多媒体资源添加至该用户所对应的收藏夹内,若用户点击关注选项,可以触发终端向服务器发送关注请求,服务器响应于该关注请求,将该多媒体资源的发布者添加至该用户所对应的关注列表内。
在一些实施例中,在播放区域内还可以包括虚拟礼物的赠送选项,若用户点击赠送选项,可以显示虚拟礼物的赠送类别以及赠送数量的选择栏,用户在选择好某一类别以及某一数量的虚拟礼物之后,可以通过点击确认按钮,触发终端向服务器发送虚拟礼物的赠送请求,服务器对该赠送请求进行结算,分别从用户的账户中扣除一定数值,并向主播的账户中发放一定数值,在结算完毕之后,终端可以在播放区域中以浮层的方式展示虚拟礼物的特效动画。
上述各种可能实施方式,提供了资源播放界面的不同布局,在实际应用中资源播放界面可以具有更多或者更少的布局方式,本公开实施例不对资源播放界面的布局方式进行具体限定。
在显示资源播放界面之后,用户在想要观看多媒体资源时,可以点击播放区域中的播放选项,终端响应于用户对该播放选项的触控操作,在播放过程的启播(指开始播放)时刻,终端可以通过下述402-407所执行的操作,获取某一码率的多媒体资源的媒体流,调用媒体编解码组件对该媒体流进行解码,调用媒体播放组件对解码后的媒体流进行播放。
在一些实施例中,在播放过程中的除启播时刻外任一播放时刻,终端仍然可以通过下述402-407所执行的操作,重新获取到另一码率的多媒体资源的媒体流(新的媒体流),从而从原有的媒体流切换至播放新的媒体流,实现多种码率的无缝切换,本公开实施例不对下述402-407是在启播时刻执行,还是在播放过程中任一播放时刻执行进行具体限定。
在402中,终端在播放多媒体资源的任一时刻,确定该时刻的目标码率,该目标码率为与该时刻的播放状态匹配度最高的码率。
上述402也即,终端确定目标时刻的目标码率,该目标码率为与该目标时刻的播放状态匹配度最高的码率。
在一些实施例中,该目标时刻可以为该多媒体资源的启播时刻;或,该目标时刻也可以为该多媒体资源中任一个画面组(GOP)的下载完毕时刻;或, 该目标时刻还可以为该多媒体资源中任一媒体帧的播放时刻,本公开实施例不对该目标时刻为播放过程的哪一时刻进行具体限定。
在一些实施例中,终端还可以向用户提供码率选择列表,用户在点击码率选择列表中任一数值时,触发生成携带该数值的码率选择指令,终端响应于码率选择指令,将该码率选择指令所携带的数值确定为目标码率。
在一些实施例中,基于该目标时刻为多媒体资源的启播时刻,这时有可能播放业务本身会指定一个启播码率,或者,在多媒体资源的MPD中会存在一个默认播放码率,因此,终端可以将播放业务所指定的启播码率或者媒体描述文件的默认播放码率确定为目标码率。
上述默认播放码率,是指在MPD文件的媒体描述元信息中@defaultSelect字段被置为true的多媒体资源的码率,由于媒体播放组件无法默认播放两种码率的多媒体资源(存在播放冲突),因此,在所有的媒体描述元信息中,最多只能出现一个码率的多媒体资源的@defaultSelect字段为true。
在一些实施例中,终端可以先遍历MPD的媒体描述元信息,若存在唯一的@defaultSelect字段为true的多媒体资源,将该多媒体资源的@bitrate字段确定为目标码率,否则,若不存在唯一的@defaultSelect字段为true的多媒体资源(比如,存在至少两个@defaultSelect字段为true的多媒体资源,或者不存在任何@defaultSelect字段为true的多媒体资源),终端可以确定播放业务是否指定了启播码率,若播放业务指定了启播码率,将该启播码率确定为目标码率,若播放业务未指定启播码率,终端还可以通过下述自适应策略,基于带宽信息和媒体缓存量自动确定目标码率。
在一些实施例中,终端可以通过如下的自适应策略调整目标码率:终端基于该目标时刻的带宽信息以及该目标时刻的媒体缓存量,确定目标码率。在一些实施例中,该带宽信息可以由终端按照第一采样间隔进行采样得到,该媒体缓存量可以由终端按照第二采样间隔采样得到,该第一采样间隔和第二采样间隔可以相同,也可以不同,例如,两者采用同一定时器触发执行各自的采样逻辑。
其中,该带宽信息可以指多媒体资源的传输速率,假设带宽信息的每次采样时长为T(单位:ms,毫秒),采样时长内终端所下载的数据量为S(单位:bytes,字节),那么一个带宽采样点B可以表示为:B=S*8/T,其中,B的单位可以为kbps(千比特每秒、千比特率),其中,T>0,例如T=500ms,S≥0, 取决于终端实际的下载量。
其中,该媒体缓存量可以指缓存区内该多媒体资源的所有媒体帧的数据量。
在一些实施例中,终端可以基于该带宽信息和该媒体缓存量,确定至少一种候选码率的预计缓存量,该预计缓存量是指从该目标时刻起按照对应码率对当前画面组继续进行下载,直到下载结束时刻所预计的媒体缓存量;基于该至少一种候选码率的预计缓存量,从该至少一种候选码率或者该当前码率中确定该目标码率。
此时终端可以配置媒体缓存量的两个阈值,分别包括第一阈值和第二阈值,其中,第一阈值大于第二阈值,也即是说,第一阈值是一个较高阈值,若媒体缓存量大于第一阈值,说明媒体缓存量十分充足,这时可以尝试增大多媒体资源的码率,因此,可以将该多媒体资源所支持的码率集合中大于当前码率的至少一个码率确定为至少一个候选码率;相反,而第二阈值是一个较低阈值,若媒体缓存量小于第二阈值,说明媒体缓存量十分匮乏,这时需要适当降低多媒体资源的码率,因此,可以将该多媒体资源所支持的码率集合中所***率确定为至少一个候选码率。
下面分别对媒体缓存量大于第一阈值或者小于第二阈值的情况进行讨论:
1):媒体缓存量大于第一阈值,如上述分析可知,将码率集合中大于当前码率的至少一个码率确定为至少一个候选码率,对任一个候选码率均计算该候选码率的预计缓存量,候选码率的预计缓存量可以表示为下式:
q=q
c+D-d-D*r*8/B
est
在上述公式中,q为预计缓存量,q
c为该时刻的媒体缓存量(当前缓存量),D为GOP长度(单位:ms,毫秒),d为当前的GOP中已下载完的长度(单位:ms,毫秒),r为任一个预估码率,B
est为该时刻的带宽信息。
假设第一阈值为q
h且当前码率为r
c,终端计算出各个候选码率r(r>r
c)的预计缓存量q之后,如果不存在预计缓存量大于第一阈值(q>q
h)的多媒体资源,那么可以将当前码率r
c确定为目标码率;否则,如果存在预计缓存量大于第一阈值(q>q
h)的多媒体资源,那么将满足q>q
h的候选码率中的最大候选码率确定为目标码率。
2):媒体缓存量小于第二阈值,如上述分析可知,将码率集合中所***率确定为至少一个候选码率,对任一个候选码率均按照与上述示例1)中类似的操作来获取该候选码率的预计缓存量,这里不做赘述。
假设第二阈值为q
l(q
l<q
h),终端计算出各个候选码率r的预计缓存量q之后,如果存在预计缓存量大于或等于第二阈值(q≥q
l)的多媒体资源,那么将满足q≥q
l的候选码率中的最大候选码率确定为目标码率;反之,如果不存在预计缓存量大于或等于第二阈值(q≥q
l)的多媒体资源,那么此时终端还需要计算一个对照缓存量,该对照缓存量是指以当前码率继续进行下载直到当前GOP下载完毕时的预计缓存量,当前码率的对照缓存量可以表示为下式:
q=q
c+D-d-(D-d)*r
c*8/B
est
其中,r
c表示当前码率,q、q
c、D、d、B
est的含义均与上一个公式中相同字符所表示的含义一致,这里不做赘述。
在计算了对照缓存量之后,将各个预计缓存量以及对照缓存量之间的最大缓存量所对应的码率r
*确定为目标码率,特别地,若r
*=r
c,那么也即是将当前码率确定为目标码率,其余情况下目标码率r
*与当前码率r
c是不相等的。
上述过程中,提供了基于带宽信息和媒体缓存量来确定目标码率的机制,也即是提供了目标码率的自适应调整策略。需要说明的是,由于上述时刻可以是启播时刻、任一个GOP的下载完毕时刻或者任一媒体帧的播放时刻,那么,在一些实施例中,在启播时刻时若播放业务未指定启播码率,且MPD中未规定默认播放码率,终端可以调用自适应调整策略来确定启播时刻的目标码率;或者,在每个GOP下载完毕时,终端可以调用自适应策略来确定下载下一个GOP的目标码率,这种策略也称为“GOP边界决策”;或者,在任一媒体帧的播放时刻,终端可以调用自适应策略来确定下一时刻的目标码率,这种策略也称为“任意点决策”。
在一些实施例中,除了基于带宽信息和媒体缓存量确定目标码率之外,终端还可以基于带宽信息以及播放状态信息来确定目标码率,其中,该播放状态信息可以包括视频缓存量、音频缓存量、最近一次卡顿时间、最近一次卡顿时长或者采样时长内的丢帧率中至少一项,本公开实施例不对播放状态信息所包含的内容进行具体限定,其中,视频缓存量和音频缓存量可以统称为上述“媒体缓存量”。
在403中,响应于目标码率与当前码率不一致,终端获取具备该目标码率的多媒体资源的目标地址信息以及目标位置信息,该目标位置信息用于表示对该多媒体资源的媒体帧的起始拉取位置。
在上述过程中,响应于目标码率和当前码率不一致,此时需要进行码率切 换,终端可以以目标码率为索引,在MPD中查询得到与具备目标码率的多媒体资源对应的媒体描述元信息,在该媒体描述元信息中提取出@url字段内所存储的目标地址信息。
在一些实施例中,该目标位置信息(@fasSpts)用于指示服务器具体从哪帧开始发送媒体流,目标位置信息的数据类型可以为int64_t类型,当然,也可以为其他数据类型,本公开实施例不对目标位置信息的数据类型进行具体限定。
需要说明的是,目标位置信息代表的是相对于当前时刻的一个相对位置参数,若目标位置信息小于0,终端会拉取到一段历史时间段内的缓存数据,若目标位置信息等于0,终端会从当前时刻开始拉取实时媒体流,若目标位置信息大于0,终端会从未来某一时刻开始拉取实时媒体流。
下面将针对不同的执行时刻,分别讨论如何获取目标位置信息:
1):基于该目标时刻为该多媒体资源的启播时刻,终端基于播放业务所指定的缓存时长,确定目标位置信息。
其中,该播放业务所指定的缓存时长由业务方根据业务需求来确定,比如,针对一些短视频而言,缓存时长可以设置为8秒,而针对一些长视频而言,缓存时长可以设置为1分钟,本公开实施例不对缓存时长的取值进行具体限定。
在基于缓存时长确定目标位置信息时,可以将缓存时长映射至对应的目标位置信息,比如,若缓存时长为8秒,那么可以映射为@fasSpts=-8000,此时目标位置信息是一个负值,代表拉取一段历史时间段内的缓存数据,这样表示终端的缓存区最多有8秒的缓存数据。
在一些实施例中,播放业务也可以不指定缓存时长,而是直接指定一个目标位置信息,业务方指定的目标位置信息可以记为“fasSptsInit”,本公开实施例不对业务方指定缓存时长还是指定目标位置信息进行具体限定。
2):基于该目标时刻为该多媒体资源中任一个画面组(GOP)的下载完毕时刻,终端将该画面组的下一个画面组中第一帧的时间戳确定为目标位置信息。
在上述过程中,终端每当一个GOP下载完毕之后,调用GOP边界决策的自适应策略,来确定下一个GOP的目标码率,在确定目标码率之后,可以将下一个GOP中第一帧的PTS(Presentation Time Stamp,显示时间戳)确定为目标位置信息,其中,若缓存区中包括视频资源,那么第一帧是指视频资源中第一个I帧,若缓存区中不包括视频资源,那么第一帧是指音频资源中第一个音频帧。
3):基于该目标时刻为该多媒体资源中任一媒体帧的播放时刻,终端将当 前下载的画面组中第一帧的时间戳确定为目标位置信息。
在上述过程中,终端在任一播放时刻,调用任意点决策的自适应策略来确定目标码率,而由于对同一个GOP而言,GOP内若I帧和P帧(或B帧)的码率不同,那么将无法进行解码,因此只能在GOP之间进行码率切换,而不能在GOP内部切换码率,而任一播放时刻不能保证刚好位于一个GOP的下载完毕时刻,因此,在确定目标码率之后,终端可以选择重新拉取一次当前的整个GOP,所以将当前下载的GOP中第一帧的PTS确定为目标位置信息,其中,若缓存区中包括视频资源,那么第一帧是指视频资源中第一个I帧,若缓存区中不包括视频资源,那么第一帧是指音频资源中第一个音频帧。
在上述示例2)和3)中,均是在播放过程中进行码率切换时的场景,而并非属于1)中的启播场景,在码率切换场景中所确定的目标地址信息可以记为“urlSwitch”,确定的目标位置信息可以记为“fasSptsSwitch”。
上述403中,是在目标码率与当前码率不一致的情况下,终端如何确定目标地址信息以及目标位置信息的处理逻辑,而在一些实施例中,响应于该目标码率与当前码率一致,终端可以忽略该目标码率,以当前码率继续执行多媒体资源传输,此时码率不变,拉流的地址信息也就不变,终端无需生成新的帧获取请求,也就不用发送冗余的帧获取请求,直接以当前码率继续按照FAS标准进行媒体流传输即可。
在404中,终端将该目标位置信息嵌入到携带该目标地址信息的帧获取请求中。
上述帧获取请求可以包括地址信息字段(@url)和扩展字段,终端可以将目标地址信息写入帧获取请求的地址信息字段,将目标位置信息写入帧获取请求的扩展字段。
在一些实施例中,观众用户在应用程序中进入某一主播用户的直播间(直播界面,属于一种资源播放界面),在播放的初始化阶段,终端需要拉取一定的缓存媒体流,开始启动播放,在启播时,终端依据业务指定的初始媒体流(启播码率的媒体流)或MPD中的默认初始媒体流(默认播放码率的媒体流),获取待请求的媒体流对应的目标地址信息(@url),此时可以将启播时刻的目标地址信息记为“urlStart”,假设业务还指定一个负值作为目标位置信息(@fasSpts=fasSptsInit<0),将启播时刻的目标地址信息和目标位置信息封装在帧获取请求中,此时的帧获取请求(启播时的FAS请求)可以表示为“urlStart&(fasSpts= fasSptsInit)”。
在一些实施例中,用户在观看多媒体资源的过程中,随着带宽信息和播放状态信息的变化,导致自适应策略输出的目标码率与当前码率不一致,此时终端需要进行码率切换,将码率切换过程的目标地址信息记为“urlSwitch”,将码率切换过程的目标位置信息记为“fasSptsSwitch”,将码率切换时的目标地址信息和目标位置信息封装在帧获取请求中,此时的帧获取请求(码率切换时的FAS请求)可以表示为“urlSwitch&(fasSpts=fasSptsSwitch)”。
在405中,终端向服务器发送携带该目标地址信息和目标位置信息的帧获取请求,该帧获取请求用于指示该服务器从该目标位置信息开始以该目标码率返回该多媒体资源的媒体帧。
在上述过程中,相当于终端将目标地址信息和目标位置信息均封装在帧获取请求中,在一种可能实施情况中,终端可以仅将目标地址信息封装在帧获取请求中,也即是帧获取情况中缺省了目标位置信息,这时会由服务器按照FAS规范来配置目标位置信息的默认值,从而从目标位置信息的默认值开始进行媒体流传输。
在一些实施例中,该帧获取请求的扩展字段还可以携带音频参数,该音频参数,用于表示请求的媒体帧是否为音频帧,若设定为true,表示终端拉取的媒体帧为音频帧,也即只拉取纯音频流,否则,若设定为false,表示终端拉取的媒体帧为音视频帧,也即拉取音频流和视频画面流,若不做规定时,可以将“false”作为默认值。
在一些实施例中,在配置音频参数时,终端可以获取多媒体资源的类型,若多媒体资源的类型为视频,可以将第一扩展参数置为“false”或者默认值,若多媒体资源的类型为音频,可以将第一扩展参数置为“true”。
在一些实施例中,在配置音频参数时,终端还可以检测应用程序的类型,若应用程序的类型为视频应用,可以将第一扩展参数置为“false”或者默认值,若应用程序的类型为音频应用,可以将第一扩展参数置为“true”。
当然,该帧获取请求中也可以不携带音频参数,或者不携带目标位置信息,或者音频参数和目标位置信息均不携带,本公开实施例不对扩展字段的内容进行具体限定。
在406中,服务器响应于该帧获取请求,从该目标位置信息开始以该目标码率向终端返回该多媒体资源的媒体帧。
在上述过程中,服务器在接收到帧获取请求之后,可以解析该帧获取请求,得到目标地址信息和目标位置信息,服务器基于目标地址信息,从资源库中定位到目标码率的多媒体资源的媒体帧,按照时间戳从小到大的顺序,从目标位置信息开始以目标码率向终端发送多媒体资源的媒体帧(连续的媒体帧也即形成媒体流)。
在一些实施例中,若帧获取请求中未携带目标位置信息中至少一项,服务器可以配置目标位置信息的默认值,不管是从帧获取请求中解析,还是自行配置默认值,服务器均能够确定目标位置信息,进一步地,基于目标位置信息确定从哪个时间戳开始拉取媒体帧,从而服务器能够从目标位置信息所指示的时间戳开始,以目标码率向终端返回音频参数所指示形式的媒体帧。
在一些实施例中,若服务器为CDN服务器,那么该目标地址信息可以是一个域名,终端可以向CDN服务器的中心平台发送帧获取请求,中心平台调用DNS(Domain Name System,域名***,本质上是一个域名解析库)对域名进行解析,可以得到域名对应的CNAME(别名)记录,基于终端的地理位置信息对CNAME记录再次进行解析,可以得到一个距离终端最近的边缘服务器的IP(Internet Protocol,网际互连协议)地址,这时中心平台将帧获取请求导向至上述边缘服务器,由边缘服务器响应于帧获取请求,以目标码率向终端提供多媒体资源的媒体帧,从而能够使得终端就近访问目标码率的多媒体资源。
在407中,终端响应于接收到该目标码率的多媒体资源的媒体帧,切换至播放该目标码率的多媒体资源的媒体帧。
在上述过程中,若终端接收到目标码率的多媒体资源的媒体帧(连续接收到的媒体帧即可构成媒体流),终端可以将该媒体帧存入缓存区中,调用媒体编解码组件对媒体帧进行解码,得到解码后的媒体帧,调用媒体播放组件按照时间戳(PTS)从小到大的顺序来对缓存区内的媒体帧进行播放。
在解码过程中,终端可以从媒体描述文件的@codec字段中确定多媒体资源的编码方式,根据编码方式确定对应的解码方式,从而按照确定的解码方式对媒体帧进行解码。
在一些实施例中,由于终端在发送待切换码率对应的帧获取请求时,可以选择断开已有的媒体流传输链接,也可以选择不断开已有的媒体流传输链接,在不断开已有的媒体流传输链接的情况下,相当于建立了两路媒体流传输链接,终端是基于一种主备流的方式进行播放,将原有的媒体流作为备用流,优先播 放新的媒体流,一旦新的媒体流出现传输异常,那么可以继续播放备用流。
在一些实施例中,在上述播放多媒体资源的过程中,基于缓存区中存在多种码率的同一媒体帧,终端播放该多种码率中最大码率的媒体帧。
在上述过程中,这种基于流式的媒体传输方式,能够做到多媒体资源的帧级传输,而由于帧获取请求携带目标位置信息,这样就能够实现不同码率的媒体流之间的无缝切换,达到多码率自适应的目的,若网络状况改变而需要切换码率时,可以通过FAS框架进行码率的无缝切换。
图5是根据一实施例示出的一种资源传输装置的逻辑结构框图。参照图5,该装置包括第一确定单元501、获取单元502和发送单元503:
第一确定单元501,被配置为执行在播放多媒体资源的任一时刻,确定该时刻的目标码率,该目标码率为与该时刻的播放状态匹配度最高的码率;
也即该第一确定单元501,被配置为执行确定目标时刻的目标码率,该目标码率为与该目标时刻的播放状态匹配度最高的码率;
获取单元502,被配置为执行若该目标码率与当前码率不一致,获取该目标码率的多媒体资源的目标地址信息;
也即该获取单元502,被配置为执行响应于该目标码率与当前码率不一致,获取具备该目标码率的多媒体资源的目标地址信息;
发送单元503,被配置为执行向服务器发送携带该目标地址信息的帧获取请求,该帧获取请求用于指示该服务器以该目标码率返回该多媒体资源的媒体帧。
在一些实施例中,该目标时刻为该多媒体资源的启播时刻;或,该目标时刻为该多媒体资源中任一个画面组的下载完毕时刻;或,该目标时刻为该多媒体资源中任一媒体帧的播放时刻。
在一些实施例中,基于图5的装置组成,该第一确定单元501包括:确定子单元,被配置为执行基于该目标时刻的带宽信息以及该目标时刻的媒体缓存量,确定该目标码率。
在一些实施例中,该确定子单元被配置为执行:基于该带宽信息和该媒体缓存量,确定至少一种候选码率的预计缓存量,该预计缓存量是指从该目标时刻起按照对应码率对当前画面组继续进行下载,直到下载结束时刻所预计的媒体缓存量;基于该至少一种候选码率的预计缓存量,从该至少一种候选码率或者该当前码率中确定该目标码率。
在一些实施例中,该第一确定单元501被配置为执行:基于该目标时刻为该多媒体资源的启播时刻,将播放业务所指定的启播码率或者媒体描述文件的默认播放码率确定为该目标码率。
在一些实施例中,基于图5的装置组成,该装置还包括:第二确定单元,被配置为执行响应于该目标码率与当前码率不一致,确定目标位置信息,该目标位置信息用于表示对该多媒体资源的媒体帧的起始拉取位置;嵌入单元,被配置为执行将该目标位置信息嵌入到携带该目标地址信息的帧获取请求中。
在一些实施例中,该第二确定单元被配置为执行:基于该目标时刻为该多媒体资源的启播时刻,基于播放业务所指定的缓存时长,确定该目标位置信息;或,基于该目标时刻为该多媒体资源中任一个画面组的下载完毕时刻,将该画面组的下一个画面组中第一帧的时间戳确定为该目标位置信息;或,基于该目标时刻为该多媒体资源中任一媒体帧的播放时刻,将当前下载的画面组中第一帧的时间戳确定为该目标位置信息。
在一些实施例中,基于图5的装置组成,该装置还包括:传输单元,被配置为执行响应于该目标码率与当前码率一致,忽略该目标码率,以该当前码率继续执行多媒体资源传输。
在一些实施例中,基于图5的装置组成,该装置还包括:播放单元,被配置为执行在播放多媒体资源的过程中,基于缓存区中存在多种码率的同一媒体帧,播放该多种码率中最大码率的媒体帧。
图6示出了本公开一个实施例提供的一种终端的结构框图。该终端600可以是:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。终端600还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。
通常,终端600包括有:处理器601和存储器602。
处理器601可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器601可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器601也可 以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器601可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器601还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器602可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器602还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器602中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器601所执行以实现本公开中各个实施例提供的资源传输方法。
在一些实施例中,终端600还可选包括有:***设备接口603和至少一个***设备。处理器601、存储器602和***设备接口603之间可以通过总线或信号线相连。各个***设备可以通过总线、信号线或电路板与***设备接口603相连。在一些实施例中,***设备包括:射频电路604、触摸显示屏605、摄像头组件606、音频电路607、定位组件608和电源609中的至少一种。
***设备接口603可被用于将I/O(Input/Output,输入/输出)相关的至少一个***设备连接到处理器601和存储器602。在一些实施例中,处理器601、存储器602和***设备接口603被集成在同一芯片或电路板上;在一些其他实施例中,处理器601、存储器602和***设备接口603中的任意一个或两个可以在单独的芯片或电路板上实现,本公开实施例对此不加以限定。
射频电路604用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路604通过电磁信号与通信网络以及其他通信设备进行通信。射频电路604将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。在一些实施例中,射频电路604包括:天线***、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路604可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。 在一些实施例中,射频电路604还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本公开对此不加以限定。
显示屏605用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏605是触摸显示屏时,显示屏605还具有采集在显示屏605的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器601进行处理。此时,显示屏605还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏605可以为一个,设置终端600的前面板;在另一些实施例中,显示屏605可以为至少两个,分别设置在终端600的不同表面或呈折叠设计;在再一些实施例中,显示屏605可以是柔性显示屏,设置在终端600的弯曲表面上或折叠面上。甚至,显示屏605还可以设置成非矩形的不规则图形,也即异形屏。显示屏605可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
摄像头组件606用于采集图像或视频。在一些实施例中,摄像头组件606包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件606还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。
音频电路607可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器601进行处理,或者输入至射频电路604以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端600的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器601或射频电路604的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路607还可以包括耳机插孔。
定位组件608用于定位终端600的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件608可以是基于美国的GPS(Global Positioning System,全球定位***)、中国的北斗***、俄罗斯的格雷纳斯***或欧盟的伽利略***的定位组件。
电源609用于为终端600中的各个组件进行供电。电源609可以是交流电、直流电、一次性电池或可充电电池。当电源609包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。
在一些实施例中,终端600还包括有一个或多个传感器610。该一个或多个传感器610包括但不限于:加速度传感器611、陀螺仪传感器612、压力传感器613、指纹传感器614、光学传感器615以及接近传感器616。
加速度传感器611可以检测以终端600建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器611可以用于检测重力加速度在三个坐标轴上的分量。处理器601可以根据加速度传感器611采集的重力加速度信号,控制触摸显示屏605以横向视图或纵向视图进行用户界面的显示。加速度传感器611还可以用于游戏或者用户的运动数据的采集。
陀螺仪传感器612可以检测终端600的机体方向及转动角度,陀螺仪传感器612可以与加速度传感器611协同采集用户对终端600的3D动作。处理器601根据陀螺仪传感器612采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。
压力传感器613可以设置在终端600的侧边框和/或触摸显示屏605的下层。当压力传感器613设置在终端600的侧边框时,可以检测用户对终端600的握持信号,由处理器601根据压力传感器613采集的握持信号进行左右手识别或快捷操作。当压力传感器613设置在触摸显示屏605的下层时,由处理器601根据用户对触摸显示屏605的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。
指纹传感器614用于采集用户的指纹,由处理器601根据指纹传感器614采集到的指纹识别用户的身份,或者,由指纹传感器614根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器601授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器614可以被设置终端600的正面、背面或侧面。 当终端600上设置有物理按键或厂商Logo时,指纹传感器614可以与物理按键或厂商Logo集成在一起。
光学传感器615用于采集环境光强度。在一个实施例中,处理器601可以根据光学传感器615采集的环境光强度,控制触摸显示屏605的显示亮度。在一些实施例中,当环境光强度较高时,调高触摸显示屏605的显示亮度;当环境光强度较低时,调低触摸显示屏605的显示亮度。在另一个实施例中,处理器601还可以根据光学传感器615采集的环境光强度,动态调整摄像头组件606的拍摄参数。
接近传感器616,也称距离传感器,通常设置在终端600的前面板。接近传感器616用于采集用户与终端600的正面之间的距离。在一个实施例中,当接近传感器616检测到用户与终端600的正面之间的距离逐渐变小时,由处理器601控制触摸显示屏605从亮屏状态切换为息屏状态;当接近传感器616检测到用户与终端600的正面之间的距离逐渐变大时,由处理器601控制触摸显示屏605从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图6中示出的结构并不构成对终端600的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
在一些实施例中,该终端600包括一个或多个处理器,和用于存储该一个或多个处理器可执行指令的一个或多个存储器,其中,该一个或多个处理器被配置为执行该指令,以实现上述各个实施例所涉及的资源传输方法。
在一些实施例中,还提供了一种包括至少一条指令的存储介质,例如包括至少一条指令的存储器,上述至少一条指令可由终端中的处理器执行以完成上述实施例中资源传输方法。在一些实施例中,上述存储介质可以是非临时性计算机可读存储介质,例如,该非临时性计算机可读存储介质可以包括ROM(Read-Only Memory,只读存储器)、RAM(Random-Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。
在一些实施例中,还提供了一种计算机程序产品,包括一条或多条指令,该一条或多条指令可以由终端的处理器执行,以完成上述各个实施例提供的资源传输方法。
Claims (27)
- 一种资源传输方法,包括:确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
- 根据权利要求1所述的方法,所述目标时刻为所述多媒体资源的启播时刻;或,所述目标时刻为所述多媒体资源中任一个画面组的下载完毕时刻;或,所述目标时刻为所述多媒体资源中任一媒体帧的播放时刻。
- 根据权利要求1所述的方法,所述确定目标时刻的目标码率包括:基于所述目标时刻的带宽信息以及所述目标时刻的媒体缓存量,确定所述目标码率。
- 根据权利要求3所述的方法,所述基于所述目标时刻的带宽信息以及所述目标时刻的媒体缓存量,确定所述目标码率包括:基于所述带宽信息和所述媒体缓存量,确定至少一种候选码率的预计缓存量,所述预计缓存量是指从所述目标时刻起按照对应码率对当前画面组继续进行下载,直到下载结束时刻所预计的媒体缓存量;基于所述至少一种候选码率的预计缓存量,从所述至少一种候选码率或者所述当前码率中确定所述目标码率。
- 根据权利要求1所述的方法,所述确定目标时刻的目标码率包括:基于所述目标时刻为所述多媒体资源的启播时刻,将播放业务所指定的启播码率或者媒体描述文件的默认播放码率确定为所述目标码率。
- 根据权利要求1所述的方法,所述方法还包括:响应于所述目标码率与当前码率不一致,确定目标位置信息,所述目标位置信息用于表示对所述多媒体资源的媒体帧的起始拉取位置;将所述目标位置信息嵌入到携带所述目标地址信息的帧获取请求中。
- 根据权利要求6所述的方法,所述确定目标位置信息包括:基于所述目标时刻为所述多媒体资源的启播时刻,基于播放业务所指定的 缓存时长,确定所述目标位置信息;或,基于所述目标时刻为所述多媒体资源中任一个画面组的下载完毕时刻,将所述画面组的下一个画面组中第一帧的时间戳确定为所述目标位置信息;或,基于所述目标时刻为所述多媒体资源中任一媒体帧的播放时刻,将当前下载的画面组中第一帧的时间戳确定为所述目标位置信息。
- 根据权利要求1所述的方法,所述方法还包括:响应于所述目标码率与当前码率一致,忽略所述目标码率,以所述当前码率继续执行多媒体资源传输。
- 根据权利要求1所述的方法,所述方法还包括:在播放多媒体资源的过程中,基于缓存区中存在多种码率的同一媒体帧,播放所述多种码率中最大码率的媒体帧。
- 一种终端,包括:一个或多个处理器;用于存储所述一个或多个处理器可执行指令的一个或多个存储器;其中,所述一个或多个处理器被配置为执行所述指令,以实现如下操作:确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
- 根据权利要求10所述的终端,所述目标时刻为所述多媒体资源的启播时刻;或,所述目标时刻为所述多媒体资源中任一个画面组的下载完毕时刻;或,所述目标时刻为所述多媒体资源中任一媒体帧的播放时刻。
- 根据权利要求10所述的终端,所述一个或多个处理器被配置为执行所述指令,以实现如下操作:基于所述目标时刻的带宽信息以及所述目标时刻的媒体缓存量,确定所述目标码率。
- 根据权利要求12所述的终端,所述一个或多个处理器被配置为执行所述指令,以实现如下操作:基于所述带宽信息和所述媒体缓存量,确定至少一种候选码率的预计缓存量,所述预计缓存量是指从所述目标时刻起按照对应码率对当前画面组继续进行下载,直到下载结束时刻所预计的媒体缓存量;基于所述至少一种候选码率的预计缓存量,从所述至少一种候选码率或者所述当前码率中确定所述目标码率。
- 根据权利要求10所述的终端,所述一个或多个处理器被配置为执行所述指令,以实现如下操作:基于所述目标时刻为所述多媒体资源的启播时刻,将播放业务所指定的启播码率或者媒体描述文件的默认播放码率确定为所述目标码率。
- 根据权利要求10所述的终端,所述一个或多个处理器还被配置为执行所述指令,以实现如下操作:响应于所述目标码率与当前码率不一致,确定目标位置信息,所述目标位置信息用于表示对所述多媒体资源的媒体帧的起始拉取位置;将所述目标位置信息嵌入到携带所述目标地址信息的帧获取请求中。
- 根据权利要求15所述的终端,所述一个或多个处理器被配置为执行所述指令,以实现如下操作:基于所述目标时刻为所述多媒体资源的启播时刻,基于播放业务所指定的缓存时长,确定所述目标位置信息;或,基于所述目标时刻为所述多媒体资源中任一个画面组的下载完毕时刻,将所述画面组的下一个画面组中第一帧的时间戳确定为所述目标位置信息;或,基于所述目标时刻为所述多媒体资源中任一媒体帧的播放时刻,将当前下载的画面组中第一帧的时间戳确定为所述目标位置信息。
- 根据权利要求10所述的终端,所述一个或多个处理器还被配置为执行所述指令,以实现如下操作:响应于所述目标码率与当前码率一致,忽略所述目标码率,以所述当前码率继续执行多媒体资源传输。
- 根据权利要求10所述的终端,所述一个或多个处理器还被配置为执行所述指令,以实现如下操作:在播放多媒体资源的过程中,基于缓存区中存在多种码率的同一媒体帧,播放所述多种码率中最大码率的媒体帧。
- 一种存储介质,当所述存储介质中的至少一条指令由终端的一个或多个处理器执行时,使得终端能够执行如下操作:确定目标时刻的目标码率,所述目标码率为与所述目标时刻的播放状态匹配度最高的码率;响应于所述目标码率与当前码率不一致,获取具备所述目标码率的多媒体资源的目标地址信息;向服务器发送携带所述目标地址信息的帧获取请求,所述帧获取请求用于指示所述服务器以所述目标码率返回所述多媒体资源的媒体帧。
- 根据权利要求19所述的存储介质,所述目标时刻为所述多媒体资源的启播时刻;或,所述目标时刻为所述多媒体资源中任一个画面组的下载完毕时刻;或,所述目标时刻为所述多媒体资源中任一媒体帧的播放时刻。
- 根据权利要求19所述的存储介质,所述终端的一个或多个处理器用于执行如下操作:基于所述目标时刻的带宽信息以及所述目标时刻的媒体缓存量,确定所述目标码率。
- 根据权利要求21所述的存储介质,所述终端的一个或多个处理器用于执行如下操作:基于所述带宽信息和所述媒体缓存量,确定至少一种候选码率的预计缓存量,所述预计缓存量是指从所述目标时刻起按照对应码率对当前画面组继续进行下载,直到下载结束时刻所预计的媒体缓存量;基于所述至少一种候选码率的预计缓存量,从所述至少一种候选码率或者所述当前码率中确定所述目标码率。
- 根据权利要求19所述的存储介质,所述终端的一个或多个处理器用于执行如下操作:基于所述目标时刻为所述多媒体资源的启播时刻,将播放业务所指定的启播码率或者媒体描述文件的默认播放码率确定为所述目标码率。
- 根据权利要求19所述的存储介质,所述终端的一个或多个处理器还用于执行如下操作:响应于所述目标码率与当前码率不一致,确定目标位置信息,所述目标位置信息用于表示对所述多媒体资源的媒体帧的起始拉取位置;将所述目标位置信息嵌入到携带所述目标地址信息的帧获取请求中。
- 根据权利要求24所述的存储介质,所述终端的一个或多个处理器用于执行如下操作:基于所述目标时刻为所述多媒体资源的启播时刻,基于播放业务所指定的缓存时长,确定所述目标位置信息;或,基于所述目标时刻为所述多媒体资源中任一个画面组的下载完毕时刻,将所述画面组的下一个画面组中第一帧的时间戳确定为所述目标位置信息;或,基于所述目标时刻为所述多媒体资源中任一媒体帧的播放时刻,将当前下载的画面组中第一帧的时间戳确定为所述目标位置信息。
- 根据权利要求19所述的存储介质,所述终端的一个或多个处理器还用于执行如下操作:响应于所述目标码率与当前码率一致,忽略所述目标码率,以所述当前码率继续执行多媒体资源传输。
- 根据权利要求19所述的存储介质,所述终端的一个或多个处理器还用于执行如下操作:在播放多媒体资源的过程中,基于缓存区中存在多种码率的同一媒体帧,播放所述多种码率中最大码率的媒体帧。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP20913374.3A EP3952316A4 (en) | 2020-01-17 | 2020-12-04 | RESOURCE TRANSMISSION METHOD AND TERMINAL |
US17/519,459 US11652864B2 (en) | 2020-01-17 | 2021-11-04 | Method and apparatus for transmitting resources and non-transitory storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010054775.2A CN113141523B (zh) | 2020-01-17 | 2020-01-17 | 资源传输方法、装置、终端及存储介质 |
CN202010054775.2 | 2020-01-17 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/519,459 Continuation US11652864B2 (en) | 2020-01-17 | 2021-11-04 | Method and apparatus for transmitting resources and non-transitory storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021143386A1 true WO2021143386A1 (zh) | 2021-07-22 |
Family
ID=76809529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/133755 WO2021143386A1 (zh) | 2020-01-17 | 2020-12-04 | 资源传输方法及终端 |
Country Status (4)
Country | Link |
---|---|
US (1) | US11652864B2 (zh) |
EP (1) | EP3952316A4 (zh) |
CN (1) | CN113141523B (zh) |
WO (1) | WO2021143386A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114221870A (zh) * | 2021-12-16 | 2022-03-22 | 北京达佳互联信息技术有限公司 | 用于服务器的带宽分配方法和装置 |
CN115396732A (zh) * | 2022-08-11 | 2022-11-25 | 深圳海翼智新科技有限公司 | 音视频数据包的传输方法、装置、电子设备及存储介质 |
CN116684468A (zh) * | 2023-08-02 | 2023-09-01 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、设备及存储介质 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115086300B (zh) * | 2022-06-16 | 2023-09-08 | 乐视云网络技术(北京)有限公司 | 一种视频文件调度方法和装置 |
CN115396406A (zh) * | 2022-07-07 | 2022-11-25 | 百果园技术(新加坡)有限公司 | 一种音视频传输的音频码率调节方法及*** |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101068236A (zh) * | 2007-04-13 | 2007-11-07 | 华为技术有限公司 | 流媒体码率控制方法、***和设备 |
US20120093017A1 (en) * | 2005-12-15 | 2012-04-19 | Zhengye Liu | Adaptive joint source and channel coding scheme for h.264 video multicasting over wireless networks |
CN102695081A (zh) * | 2012-06-13 | 2012-09-26 | 百视通网络电视技术发展有限责任公司 | 基于互联网电视的视频资源调度方法及电视终端 |
CN103338393A (zh) * | 2013-06-13 | 2013-10-02 | 西安交通大学 | 一种hspa***下用户体验驱动的视频码率选择方法 |
CN103533386A (zh) * | 2013-10-21 | 2014-01-22 | 腾讯科技(深圳)有限公司 | 一种直播控制方法,及主播设备 |
CN105025351A (zh) * | 2014-04-30 | 2015-11-04 | 深圳Tcl新技术有限公司 | 流媒体播放器缓冲的方法及装置 |
CN109040801A (zh) * | 2018-07-19 | 2018-12-18 | 北京达佳互联信息技术有限公司 | 媒体码率自适应方法、装置、计算机设备及存储介质 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9124642B2 (en) * | 2009-10-16 | 2015-09-01 | Qualcomm Incorporated | Adaptively streaming multimedia |
CN102333089A (zh) * | 2011-09-26 | 2012-01-25 | 南京邮电大学 | 基于超文本传输协议流化的多码率媒体流自适应控制方法 |
WO2014011848A2 (en) * | 2012-07-12 | 2014-01-16 | Huawei Technologies Co., Ltd. | Signaling and processing content with variable bitrates for adaptive streaming |
US9386308B2 (en) * | 2013-07-16 | 2016-07-05 | Cisco Technology, Inc. | Quality optimization with buffer and horizon constraints in adaptive streaming |
CN110636346B (zh) * | 2019-09-19 | 2021-08-03 | 北京达佳互联信息技术有限公司 | 一种码率自适应切换方法、装置、电子设备及存储介质 |
-
2020
- 2020-01-17 CN CN202010054775.2A patent/CN113141523B/zh active Active
- 2020-12-04 WO PCT/CN2020/133755 patent/WO2021143386A1/zh unknown
- 2020-12-04 EP EP20913374.3A patent/EP3952316A4/en not_active Withdrawn
-
2021
- 2021-11-04 US US17/519,459 patent/US11652864B2/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120093017A1 (en) * | 2005-12-15 | 2012-04-19 | Zhengye Liu | Adaptive joint source and channel coding scheme for h.264 video multicasting over wireless networks |
CN101068236A (zh) * | 2007-04-13 | 2007-11-07 | 华为技术有限公司 | 流媒体码率控制方法、***和设备 |
CN102695081A (zh) * | 2012-06-13 | 2012-09-26 | 百视通网络电视技术发展有限责任公司 | 基于互联网电视的视频资源调度方法及电视终端 |
CN103338393A (zh) * | 2013-06-13 | 2013-10-02 | 西安交通大学 | 一种hspa***下用户体验驱动的视频码率选择方法 |
CN103533386A (zh) * | 2013-10-21 | 2014-01-22 | 腾讯科技(深圳)有限公司 | 一种直播控制方法,及主播设备 |
CN105025351A (zh) * | 2014-04-30 | 2015-11-04 | 深圳Tcl新技术有限公司 | 流媒体播放器缓冲的方法及装置 |
CN109040801A (zh) * | 2018-07-19 | 2018-12-18 | 北京达佳互联信息技术有限公司 | 媒体码率自适应方法、装置、计算机设备及存储介质 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3952316A4 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114221870A (zh) * | 2021-12-16 | 2022-03-22 | 北京达佳互联信息技术有限公司 | 用于服务器的带宽分配方法和装置 |
CN114221870B (zh) * | 2021-12-16 | 2023-01-20 | 北京达佳互联信息技术有限公司 | 用于服务器的带宽分配方法和装置 |
CN115396732A (zh) * | 2022-08-11 | 2022-11-25 | 深圳海翼智新科技有限公司 | 音视频数据包的传输方法、装置、电子设备及存储介质 |
CN115396732B (zh) * | 2022-08-11 | 2024-02-02 | 深圳海翼智新科技有限公司 | 音视频数据包的传输方法、装置、电子设备及存储介质 |
CN116684468A (zh) * | 2023-08-02 | 2023-09-01 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、设备及存储介质 |
CN116684468B (zh) * | 2023-08-02 | 2023-10-20 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN113141523A (zh) | 2021-07-20 |
US20220060533A1 (en) | 2022-02-24 |
US11652864B2 (en) | 2023-05-16 |
CN113141523B (zh) | 2022-07-22 |
EP3952316A4 (en) | 2022-07-27 |
EP3952316A1 (en) | 2022-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021143386A1 (zh) | 资源传输方法及终端 | |
CN108600773B (zh) | 字幕数据推送方法、字幕展示方法、装置、设备及介质 | |
WO2021143362A1 (zh) | 资源传输方法及终端 | |
CN113141514B (zh) | 媒体流传输方法、***、装置、设备及存储介质 | |
CN110213616B (zh) | 视频提供方法、获取方法、装置及设备 | |
WO2018059352A1 (zh) | 直播视频流远程控制方法及装置 | |
CN112394895B (zh) | 画面跨设备显示方法与装置、电子设备 | |
US10423320B2 (en) | Graphical user interface for navigating a video | |
CN108769726B (zh) | 多媒体数据推送方法、装置、存储介质及设备 | |
CN109874043B (zh) | 视频流发送方法、播放方法及装置 | |
WO2021249318A1 (zh) | 一种投屏方法和终端 | |
CN112995759A (zh) | 互动业务处理方法、***、装置、设备及存储介质 | |
CN108600778B (zh) | 媒体流发送方法、装置、***及服务器、终端、存储介质 | |
CN110996117B (zh) | 视频转码方法、装置、电子设备和存储介质 | |
CN112969093A (zh) | 互动业务处理方法、装置、设备及存储介质 | |
US20220095020A1 (en) | Method for switching a bit rate, and electronic device | |
CN111010588B (zh) | 直播处理方法、装置、存储介质及设备 | |
CN113873187B (zh) | 跨终端录屏方法、终端设备及存储介质 | |
CN109714628B (zh) | 播放音视频的方法、装置、设备、存储介质及*** | |
CN113709524B (zh) | 选择音视频流的比特率的方法及其装置 | |
CN111698262B (zh) | 带宽确定方法、装置、终端及存储介质 | |
CN114840283A (zh) | 多媒体资源显示方法、装置、终端及介质 | |
CN116347184A (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: 20913374 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2020913374 Country of ref document: EP Effective date: 20211103 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |