WO2020155959A1 - 切换清晰度的方法、装置、计算机设备及可读存储介质 - Google Patents

切换清晰度的方法、装置、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2020155959A1
WO2020155959A1 PCT/CN2019/128448 CN2019128448W WO2020155959A1 WO 2020155959 A1 WO2020155959 A1 WO 2020155959A1 CN 2019128448 W CN2019128448 W CN 2019128448W WO 2020155959 A1 WO2020155959 A1 WO 2020155959A1
Authority
WO
WIPO (PCT)
Prior art keywords
definition
download speed
segment
switching
switch
Prior art date
Application number
PCT/CN2019/128448
Other languages
English (en)
French (fr)
Inventor
吴志强
郑翰超
陈辉
丁建强
谭兆歆
Original Assignee
上海哔哩哔哩科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海哔哩哔哩科技有限公司 filed Critical 上海哔哩哔哩科技有限公司
Priority to EP19912438.9A priority Critical patent/EP3879840B1/en
Publication of WO2020155959A1 publication Critical patent/WO2020155959A1/zh
Priority to US17/342,293 priority patent/US11303949B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/752Media network packet handling adapting media to network capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234363Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the spatial resolution, e.g. for clients with a lower screen resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/23439Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements for generating different versions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2402Monitoring of the downstream path of the transmission network, e.g. bandwidth available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26258Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • H04N21/4621Controlling 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

Definitions

  • This application relates to the technical field of audio and video playback, and in particular to a method, device, computer equipment, and readable storage medium for switching resolution.
  • DASH Dynamic Adaptive Streaming over HTTP, HTTP-based dynamic adaptive streaming
  • DASH is an adaptive bit rate streaming technology that makes high quality Streaming media can be delivered over the Internet through a traditional HTTP web server; DASH divides a streaming media content into multiple segments, each segment contains a certain length (for example, 10 seconds) of playable content, and each segment corresponds to There are multiple definitions (for example, 1080P, 720P, 480P, 360P), and the client can choose to download and play segments of the specified definition according to the current network conditions.
  • the purpose of this application is to provide a method, a device, a computer device, and a readable storage medium for switching definitions, which can automatically switch the definitions according to the current download speed without stuttering.
  • a method for switching definition includes the following steps:
  • MPD Media Presentation Description
  • the current safe download speed is periodically determined according to the set time interval, and according to the safe download speed and the definition information, it is determined whether the currently playing audio and/or video needs to be checked. Switch the definition;
  • the switch time point is determined according to the played duration of the currently played segment and the preset safe buffer duration, so as to switch the definition at the switch time point.
  • the definition information includes: a plurality of usable definitions and a bandwidth corresponding to each definition.
  • the determining the current safe download speed periodically according to a set time interval includes:
  • each segment calculate the actual download speed of each segment, and calculate the average download speed according to the actual download speed of N segments;
  • the playback information includes: connection establishment time, download time, and total download bytes;
  • the calculating the actual download speed of each segment according to the playback information of each segment includes:
  • Actual download speed (8 ⁇ total number of bytes downloaded)/(connection time length + download time length).
  • the safety factor is 0.8;
  • the percentage K is calculated according to the following formula:
  • D is the playing time of a segment
  • L is the average connection time length calculated based on the connection time length of N fragments.
  • the judging whether it is necessary to switch the definition of the currently played audio and/or video according to the safe download speed and the definition information includes:
  • Adjust the definition of the segment to be played later to be just less than the definition corresponding to the bandwidth of the safe download speed.
  • the determining the switching time point according to the played time length of the currently played segment and the preset safe buffer time length, so as to switch the definition at the switching time point includes:
  • ceil() is rounded up
  • C is the playing duration of the currently playing segment
  • Q is the safe buffer duration, and Q is equal to 1.5 times the playback duration of a fragment
  • this application also provides a device for switching resolution, which includes the following components:
  • the parsing module is used to obtain a media introduction MPD file when DASH is used to play audio and/or video, and obtain definition information by parsing the MPD file;
  • the judging module is used to periodically determine the current safe download speed according to the set time interval during the audio and/or video playback, and judge whether it is necessary to check the current safe download speed according to the safe download speed and the definition information. Audio and/or video resolution switching;
  • the switching module is used to determine the switching time point according to the playback duration of the currently played segment and the preset safe buffer time when the definition switching is required to perform the definition at the switching time point Switch.
  • the present application also provides a computer device, the computer device comprising: a memory, a processor, and computer-readable instructions stored on the memory and running on the processor, the processor The following steps are implemented when the computer-readable instructions are executed:
  • the current safe download speed is periodically determined according to the set time interval, and according to the safe download speed and the definition information, it is determined whether the currently playing audio and/or video needs to be checked. Switch the definition;
  • the switch time point is determined according to the played duration of the currently played segment and the preset safe buffer duration, so as to switch the definition at the switch time point.
  • this application also provides a computer-readable storage medium on which computer-readable instructions are stored, and the computer-readable instructions implement the following steps when executed by a processor:
  • the current safe download speed is periodically determined according to the set time interval, and according to the safe download speed and the definition information, it is determined whether the currently playing audio and/or video needs to be checked. Switch the definition;
  • the switch time point is determined according to the played duration of the currently played segment and the preset safe buffer duration, so as to switch the definition at the switch time point.
  • the method, device, computer equipment, and readable storage medium for switching resolution provided in this application can periodically determine whether it is necessary to switch the resolution according to the preset time interval and the current safe download speed, and automatically The resolution switching is performed at the calculated switching time point; since the connection time and network jitter for obtaining the slices are considered when calculating the secure download speed, it can ensure that the current network speed is sufficient to meet the bandwidth requirements of the resolution after the switching; In addition, switching the resolution at the switching time point can avoid the situation that the segment corresponding to the resolution after the switch has not been downloaded and the segment of the current resolution has been played, thereby ensuring the absence of audio and/or video. When the seam is switched, there will be no switching jam.
  • FIG. 1 is a schematic diagram of an optional flow of the method for switching definition provided in Embodiment 1;
  • FIG. 2 is a schematic diagram of the content structure of the MPD file in the first embodiment
  • FIG. 3 is a schematic diagram of an optional program module of the device for switching resolution provided in the second embodiment
  • FIG. 4 is a schematic diagram of an optional hardware architecture of the computer device provided in the third embodiment.
  • Fig. 1 is a schematic diagram of an optional flow chart of the method for switching the definition of this application. The method is applied to the DASH client. As shown in Fig. 1, the method may include the following steps:
  • Step S101 When using DASH to play audio and/or video, obtain an MPD file, and obtain definition information by parsing the MPD file.
  • the definition information includes: a plurality of usable definitions and a bandwidth corresponding to each definition.
  • MPD files are video and/or video description files, which can be used to describe the composition of the entire MPEG DASH (also known as DASH) code stream, which is equivalent to the M3U8 of the HLS (HTTP Live Streaming) protocol (M3U8 is a part of the video).
  • the MPD file is an XML (Extensible Markup Language, Extensible Markup Language) Document (Document is a computer terminology. Every HTML (Hyper Text Markup Language, Hyper Text Markup Language) document loaded into the browser becomes Document object), through the content of the MPD file, a URL (Uniform Resource Locator) download for HTTP GET request (HTTP GET request is a method of HTTP request) can be constructed.
  • FIG. 2 it is a schematic diagram of the content structure of the MPD file in XML format.
  • An MPD file in XML format includes multiple fragment Period files; and each Period file has a corresponding application description AdaptationSet file;
  • the AdaptationSet file contains the resolution description files of different definitions/streams.
  • Each Representation file corresponds to a definition, and each Representation file contains the bandwidth requirements for the corresponding definition; a Representation file includes multiple
  • Each segment corresponds to video content or audio content of a certain length of time.
  • a streaming media content is put into a Period segment; the video data and audio data in the streaming media content are stored in different AdaptationSet segments; different definitions of video or audio use different
  • the Representation section represents; a Representation section includes video attribute information or audio attribute information.
  • the obtaining definition information by parsing the MPD file includes:
  • the definition list can be obtained by parsing the MPD file, and the definition list includes: index value, definition information, bandwidth information corresponding to the definition, and audio or video URL ( Uniform Resource Locator (Uniform Resource Locator) information.
  • index value index value
  • definition information definition information
  • bandwidth information bandwidth information corresponding to the definition
  • audio or video URL Uniform Resource Locator (Uniform Resource Locator) information.
  • Step S102 In the process of playing audio and/or video, the current safe download speed is determined periodically according to the set time interval, and according to the safe download speed and the definition information, it is judged whether it is necessary to check the currently played audio and video. / Or video to switch the definition.
  • determining the current safe download speed periodically according to a set time interval includes:
  • Step A1 Obtain the playback information of N segments before the currently played segment; where N is a positive integer;
  • the playback information includes: connection establishment duration, download duration, and total download bytes;
  • connection duration is the duration from when the DASH client sends a request to the HTTP server to when the DASH client receives a response from the HTTP server;
  • the download duration is the time from when the DASH client starts to download the audio and/or video according to the received response to the end of the download;
  • the total number of bytes downloaded is the total number of bytes consumed to download audio and/or video.
  • the DASH client each time a segment is downloaded, the DASH client obtains the total number of bytes downloaded from the file header of the segment file, and calculates the connection duration and download duration of a segment, and adds The total download bytes, connection duration and download duration of a segment are stored for later use in calculating the safe download speed.
  • Step A2 Calculate the actual download speed of each fragment according to the playback information of each fragment; and calculate the average download speed according to the actual download speed of N fragments;
  • the calculation of the actual download speed of each segment according to the playback information of each segment includes:
  • Actual download speed (8 ⁇ total number of bytes downloaded)/(connection time length + download time length).
  • the calculation of the average download speed according to the actual download speed of the N fragments includes:
  • Average download speed (actual download speed 1+actual download speed 2+->+actual download speed N)/N.
  • Step A3 Multiply the average download speed by the preset safety factor and the percentage to obtain the current safe download speed.
  • D is the playing time of a segment
  • L is the average connection time length calculated based on the connection time length of N segments, and L ⁇ D.
  • the step A3 includes:
  • P is a safety factor; preferably, P is 0.8.
  • the influence of the average connection duration in the downloading of a segment is considered; because the download request of the segment is sent from the DASH client to the HTTP server until the download of the segment is completed. Including the connection time and download time, so the total time to download a segment is the sum of the connection time and download time; since the total time to download a segment cannot exceed the playback time of one segment, the total time for a segment is The maximum download duration is the difference between the playback duration of a segment and the connection duration of the segment; therefore, the percentage K can indicate the ratio of the maximum download duration of a segment to the playback duration of a segment.
  • the jitter of the network is also considered when calculating the safe download speed, and the safety factor P is used to ensure that the current download speed is sufficient to meet the bandwidth requirement of a certain definition.
  • the judging whether it is necessary to switch the definition of the currently played audio and/or video according to the safe download speed and the definition information includes:
  • Adjust the definition of the segment to be played later to be just less than the definition corresponding to the bandwidth of the safe download speed.
  • the calculated safe download speed can be compared with the bandwidth requirements of each definition in the definition list to determine the maximum definition that the current safe download speed can support.
  • the current safe download speed is 120Mbps
  • the available definitions include 1080P, 720P, 480P, 360P
  • the bandwidth requirement of 1080P is 150Mbps
  • the bandwidth requirement of 720P is 100Mbps
  • the bandwidth requirement of 480P is The bandwidth requirement of 50Mbps and 360P is 25Mbps; since the current safe download speed can meet the bandwidth requirement of 720P, the resolution of the fragments to be played later is adjusted to 720P.
  • step S102 the method further includes:
  • step S102 is executed.
  • the average connection duration is longer than the playback duration, it means that the next segment cannot be downloaded before the current segment is played, that is, the audio and/or video of the current definition cannot be played smoothly; at this time, the DASH client will Adjust the clarity of the audio and/or video to the minimum.
  • the judgment of the definition switching is performed periodically (for example, the judgment of the definition switching is performed every 500 seconds).
  • the actual download speed of the film for example, N is 10
  • calculate the average download speed and calculate a safe download speed after considering the connection time and network jitter; according to the safe download speed, the audio and/or
  • the definition of the video is exactly the definition that the safe download speed can support.
  • Step S103 In the case of the need to switch the definition, determine the switching time point according to the playback duration of the currently played segment and the preset safe buffer time, so as to switch the definition at the switching time point .
  • step S103 includes:
  • ceil() is rounded up
  • C is the playing duration of the currently playing segment
  • Q is the safe buffer duration, and Q is equal to 1.5 times the playback duration of a fragment
  • the switching time point is calculated to ensure that sufficient space is reserved for the segment after switching the resolution. Download time, thus ensuring seamless switching of audio and/or video, and no switching jams.
  • this embodiment provides a device for switching definitions.
  • FIG. 3 shows an optional structural block diagram of the device for switching definitions.
  • the clarity device is divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete this application.
  • the program module referred to in this application refers to a series of computer-readable instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment.
  • the device for switching resolution applied to the DASH client includes the following components:
  • the parsing module 301 is configured to obtain a media introduction MPD file when using DASH to play audio and/or video, and obtain definition information by parsing the MPD file.
  • the definition information includes: a plurality of usable definitions and a bandwidth corresponding to each definition.
  • parsing module 301 is specifically used for:
  • the judging module 302 is used to determine the current safe download speed periodically according to the set time interval during the audio and/or video playing, and judge whether the current playing speed needs to be adjusted according to the safe download speed and the definition information.
  • the audio and/or video can be switched in definition.
  • the judgment module 302 includes:
  • the acquiring unit is used to acquire the playback information of N segments before the currently played segment;
  • the calculation unit is used to calculate the actual download speed of each fragment according to the playback information of each fragment, and calculate the average download speed according to the actual download speed of the N fragments;
  • a processing unit configured to multiply the average download speed by a preset safety factor and percentage to obtain the current safe download speed
  • Switching unit Adjust the definition of the segment to be played later to a definition that is just less than the bandwidth corresponding to the safe download speed.
  • the playback information includes: connection time length, download time length, and total downloaded bytes.
  • the calculation unit is specifically used for:
  • Actual download speed (8 ⁇ total number of download bytes)/(connection duration + download duration);
  • Average download speed (actual download speed 1+actual download speed 2+->+actual download speed N)/N.
  • processing unit is specifically used for:
  • the percentage K is calculated according to the following formula:
  • D is the playing time of a segment
  • L is the average connection duration calculated based on the connection duration of N shards
  • the safe download speed is calculated according to the following formula:
  • P is a safety factor; preferably, P is 0.8.
  • the switching module 303 is used to determine the switching time point according to the playback duration of the currently played segment and the preset safe buffering time when the definition switching is required, so as to perform the clearing at the switching time point Degree switching.
  • the switching module 303 is used for:
  • ceil() is rounded up
  • C is the playing duration of the currently playing segment
  • Q is the safe buffer duration, and Q is equal to 1.5 times the playback duration of a fragment
  • This embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a cabinet server (including independent servers, or A server cluster composed of multiple servers), etc.
  • the computer device 40 of this embodiment at least includes but is not limited to: a memory 401 and a processor 402 that can be communicatively connected to each other through a system bus.
  • FIG. 4 only shows the computer device 40 with components 401-402, but it should be understood that it is not required to implement all of the illustrated components, and more or fewer components may be implemented instead.
  • the memory 401 (readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 401 may be an internal storage unit of the computer device 40, such as a hard disk or memory of the computer device 40.
  • the memory 401 may also be an external storage device of the computer device 40, such as a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc.
  • the memory 401 may also include both the internal storage unit of the computer device 40 and its external storage device.
  • the memory 401 is generally used to store the operating system and various application software installed in the computer device 40, such as the program code of the device for switching resolution in the second embodiment.
  • the memory 401 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 402 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 402 is generally used to control the overall operation of the computer device 40.
  • the processor 402 is configured to execute the program of the method for switching resolution stored in the processor 402, and the following steps are implemented when the program of the method for switching the resolution is executed:
  • the current safe download speed is periodically determined according to the set time interval, and according to the safe download speed and the definition information, it is determined whether the currently playing audio and/or video needs to be checked. Switch the definition;
  • the switch time point is determined according to the played duration of the currently played segment and the preset safe buffer duration, so as to switch the definition at the switch time point.
  • This embodiment also provides a computer-readable storage medium (volatile/nonvolatile), such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM) , Static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Disk, CD, Server, App Store And so on, computer-readable instructions are stored thereon, and the computer-readable instructions implement the following method steps when executed by a processor:
  • the current safe download speed is periodically determined according to the set time interval, and according to the safe download speed and the definition information, it is determined whether the currently playing audio and/or video needs to be checked. Switch the definition;
  • the switching time point is determined according to the played duration of the currently played segment and the preset security buffer duration, so as to switch the definition at the switching time point.
  • the method, device, computer equipment, and readable storage medium for switching resolution provided in this embodiment can periodically determine whether the resolution needs to be switched according to the preset time interval and the current safe download speed, and automatically The resolution is switched at the calculated switching time point; since the connection time and network jitter of the slice are taken into account when calculating the secure download speed, it can ensure that the current network speed is sufficient to meet the bandwidth requirements of the resolution after the switch In addition, switching the resolution at the switching time point can avoid the situation that the segment corresponding to the resolution after the switch has not been downloaded and the segment of the current resolution has been played, thereby ensuring the audio and/or video Seamless switching, there will be no switching jams.

Landscapes

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

Abstract

本申请公开了一种切换清晰度的方法、装置、计算机设备及可读存储介质,该方法包括:当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。本申请能够根据当前的下载速度自动的进行清晰度切换,且不会出现卡顿现象。

Description

切换清晰度的方法、装置、计算机设备及可读存储介质
本申请申明2019年01月30日递交的申请号为201910091813.9、名称为“切换清晰度的方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及音视频播放技术领域,具体涉及一种切换清晰度的方法、装置、计算机设备及可读存储介质。
背景技术
为了让音视频播放的更加流畅,越来越多的视频网站开始采用DASH(Dynamic Adaptive Streaming over HTTP,基于HTTP的动态自适应流)技术,DASH是一种自适应比特率流技术,使得高质量流媒体可以通过传统的HTTP网络服务器以互联网传递;DASH将一个流媒体内容分解为多个分片,每个分片包含一定长度(例如,10秒)的可播放内容,且每个分片对应有多个清晰度(例如,1080P、720P、480P、360P),客户端可以根据当前网络条件选择下载和播放指定清晰度的分片。与传统的音视频播放技术相比,在进行清晰度的切换时不需要重新加载播放器。但是,发明人发现:目前在使用DASH时,是根据用户端的选择进行清晰度的切换,不够智能;此外,由于仍需对分片进行下载缓冲,在进行清晰度的切换的过程中会出现当前分片已播放完而下个分片还未下载完成的情况,从而导致播放卡顿,影响用户体验度。
发明内容
本申请的目的在于提供一种切换清晰度的方法、装置、计算机设备及可读存储介质,能够根据当前的下载速度自动的进行清晰度切换,且不会出现卡顿现象。
根据本申请的一个方面,提供了一种切换清晰度的方法,该方法包括如下步骤:
当使用DASH播放音频和/或视频时,获取MPD(Media Presentation Description,媒体介绍说明)文件,并通过解析所述MPD文件得到清晰度信息;
在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频 进行清晰度的切换;
在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
可选的,所述清晰度信息包括:多个可使用的清晰度以及与每个清晰度所对应的带宽。
可选的,所述按照设定时间间隔定期确定出当前的安全下载速度,包括:
获取在当前播放的分片之前的N个分片的播放信息;
根据每个分片的播放信息,计算出每个分片的实际下载速度,并根据N个分片的实际下载速度计算出平均下载速度;
将所述平均下载速度乘以预设的安全系数以及占分比,得到当前的安全下载速度。
可选的,所述播放信息包括:建连时长、下载时长、下载总字节数;
所述根据每个分片的播放信息,计算出每个分片的实际下载速度,包括:
实际下载速度=(8×下载总字节数)/(建连时长+下载时长)。
可选的,所述安全系数为0.8;
所述占分比K按照如下公式计算得到:
K=(D-L)/D;
其中,D为一个分片的播放时长;
L是根据N个分片的建连时长计算得到的平均建连时长。
可选的,所述根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换,包括:
将之后播放的分片的清晰度调整为刚好小于所述安全下载速度的带宽所对应的清晰度。
可选的,所述根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换,包括:
按照如下公式计算出切换时间点T:
Figure PCTCN2019128448-appb-000001
其中,ceil()为向上取整;
C为当前播放的分片的已播放时长;
Q为安全缓冲时长,且Q等于一个分片的播放时长的1.5倍;
当播放在当前分片之后的第T个分片时,进行清晰度的切换。
为了实现上述目的,本申请还提供一种切换清晰度的装置,该装置包括以下组成部分:
解析模块,用于当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件, 并通过解析所述MPD文件得到清晰度信息;
判断模块,用于在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
切换模块,用于在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
为了实现上述目的,本申请还提供一种计算机设备,所述计算机设备包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
为了实现上述目的,本申请还提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
本申请提供的切换清晰度的方法、装置、计算机设备及可读存储介质,能够按照预设的时间间隔,周期性的根据当前的安全下载速度判断是否需要进行清晰度的切换,并自动的在计算出的切换时间点处进行清晰度的切换;由于在计算安全下载速度时考虑到了获取 分片的建连时间以及网络抖动,能够保证当前的网络速度足以满足切换后的清晰度的带宽要求;此外,在切换时间点处进行清晰度的切换可以避免出现切换后的清晰度对应的分片未下载完成而当前清晰度的分片已播放结束的情况,从而保证了音频和/或视频的无缝切换,不会出现切换卡顿的现象。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1为实施例一提供的切换清晰度的方法的一种可选的流程示意图;
图2为实施例一中的MPD文件的内容结构示意图;
图3为实施例二提供的切换清晰度的装置的一种可选的程序模块示意图;
图4为实施例三提供的计算机设备的一种可选的硬件架构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
实施例一
下面结合附图对本申请提供的切换清晰度的方法进行说明。
图1为本申请切换清晰度的方法的一种可选的流程示意图,该方法应用于DASH客户端,如图1所示,该方法可以包括以下步骤:
步骤S101:当使用DASH播放音频和/或视频时,获取MPD文件,并通过解析所述MPD文件得到清晰度信息。
具体的,所述清晰度信息包括:多个可使用的清晰度以及与每个清晰度所对应的带宽。
进一步的,MPD文件是视频和/或视频的描述文件,可以用于描述整个MPEG DASH(又称为DASH)码流的构成,相当于HLS(HTTP Live Streaming)协议的M3U8(M3U8是视频的一种格式)文件,MPD文件是一个XML(Extensible Markup Language,可扩展标记语言)Document(Document是计算机专业术语,每个载入浏览器的HTML(Hyper Text  Markup Language,超级文本标记语言)文档都会成为Document对象),通过MPD文件的内容可以构造出用于HTTP GET请求(HTTP GET请求是HTTP请求的一种方式)下载的URL(Uniform Resource Locator,统一资源定位符)。
如图2所示,为XML格式的MPD文件的内容结构示意图,在一个XML格式的MPD文件中包括多个片段Period文件;而在每个Period文件中都有对应的应用描述AdaptationSet文件;在一个AdaptationSet文件中包含不同清晰度/码流的分辨率描述Representation文件,每个Representation文件对应一个清晰度,且在每个Representation文件中包含对应清晰度所需的带宽要求;在一个Representation文件中包括多个分片Segment,每个Segment对应一定时间长度的视频内容或音频内容。
在XML格式的MPD文件中,一个流媒体内容放入一个Period段中;并将流媒体内容中的视频数据和音频数据分别存入不同的AdaptationSet段中;不同清晰度的视频或音频用不同的Representation段表示;在一个Representation段中包括视频属性信息或音频属性信息。
更进一步的,所述通过解析所述MPD文件得到清晰度信息,包括:
通过解析MPD文件中的Representation文件,得到可使用的清晰度,以及与每个清晰度对应的带宽。
优选的,在实际应用中,可以通过解析所述MPD文件得到清晰度列表,在所述清晰度列表中包括:索引值、清晰度信息、清晰度对应的带宽信息、以及音频或视频的URL(Uniform Resource Locator,统一资源定位符)信息。
步骤S102:在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换。
具体的,所述按照设定时间间隔定期确定出当前的安全下载速度,包括:
步骤A1:获取在当前播放的分片之前的N个分片的播放信息;其中,N为正整数;
进一步的,所述播放信息包括:建连时长、下载时长、下载总字节数;
其中,建连时长为,从DASH客户端向HTTP服务器发送请求到DASH客户端接收到HTTP服务器反馈回的响应的时长;
下载时长为,从DASH客户端根据接收到的响应开始下载音频和/或视频到下载结束的时间;
下载总字节数为,下载音频和/或视频所消耗的总字节数。
在本实施例中,每当下载一个分片时,DASH客户端会从分片文件的文件头部获取到 下载总字节数,并统计出一个分片的建连时长和下载时长,并将一个分片的下载总字节数、建连时长和下载时长进行存储,以供后期计算安全下载速度时使用。
步骤A2:根据每个分片的播放信息,计算出每个分片的实际下载速度;并根据N个分片的实际下载速度计算出平均下载速度;
进一步的,所述根据每个分片的播放信息,计算出每个分片的实际下载速度,包括:
实际下载速度=(8×下载总字节数)/(建连时长+下载时长)。
所述根据N个分片的实际下载速度计算出平均下载速度,包括:
平均下载速度=(实际下载速度1+实际下载速度2+……+实际下载速度N)/N。
步骤A3:将所述平均下载速度乘以预设的安全系数以及占分比,得到当前的安全下载速度。
进一步的,所述占分比K按照如下公式计算得到:
K=(D-L)/D;
其中,D为一个分片的播放时长;
L是根据N个分片的建连时长计算得到的平均建连时长,且L<D。
所述步骤A3,包括:
安全下载速度=平均下载速度×P×K;
其中,P为安全系数;优选的,P为0.8。
在本实施例中,在计算安全下载速度时考虑了平均建连时长在下载一个分片过程中的影响;由于从DASH客户端向HTTP服务器发送分片的下载请求至该分片下载完成的时长包括建连时长和下载时长,所以下载一个分片的总耗时为建连时长与下载时长之和;由于下载一个分片的总耗时不能超过一个分片的播放时长,所以一个分片的最大的下载时长为一个分片的播放时长与该分片的建连时长之差;因此,通过占分比K可以表示一个分片的最大的下载时长占一个分片的播放时长的比例。此外,在本实施例中,在计算安全下载速度时还考虑了网络的抖动,通过安全系数P保障当前的下载速度足以满足一定清晰度的带宽要求。
进一步的,所述根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换,包括:
将之后播放的分片的清晰度调整为刚好小于所述安全下载速度的带宽所对应的清晰度。
在实际应用中,可以将计算出的安全下载速度与清晰度列表中的各个清晰度的带宽要求进行比对,判断出当前安全下载速度所能支持的最大清晰度。例如,当前的安全下载速度为120Mbps,而根据清晰度信息可知,可使用的清晰度包括1080P、720P、480P、360P; 1080P的带宽要求为150Mbps、720P的带宽要求为100Mbps、480P的带宽要求为50Mbps、360P的带宽要求为25Mbps;由于当前的安全下载速度可以满足720P的带宽要求,所以讲之后播放的分片的清晰度调整为720P。
更进一步的,在步骤S102之前,所述方法还包括:
根据在当前播放的分片之前的N个分片的建连时长,计算出平均建连时长;
判断所述平均建连时长是否大于一个分片的播放时长;
若是,则将之后播放的音频和/或视频的清晰度调整为最低;
若否,则执行步骤S102。
如果平均建连时长大于播放时长,则说明无法在当前分片播放完之前下载完下个分片,即无法流畅的播放当前清晰度的音频和/或视频;此时,DASH客户端会将当前播放的音频和/或视频的清晰度调至最低。
在本实施例中,按照设定时间间隔,定期进行清晰度切换的判断(例如,每500秒进行一次清晰度切换的判断);在进行判断时,会根据距离当前分片最近的N个分片(例如,N为10)的实际下载速度,计算出平均下载速度,并在考虑了建连时长和网络抖动之后计算出一个安全下载速度;根据安全下载速度,将之后播放的音频和/或视频的清晰度整为该安全下载速度足以支持的清晰度。
步骤S103:在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
具体的,步骤S103,包括:
按照如下公式计算出切换时间点T:
Figure PCTCN2019128448-appb-000002
其中,ceil()为向上取整;
C为当前播放的分片的已播放时长;
Q为安全缓冲时长,且Q等于一个分片的播放时长的1.5倍;
当播放在当前分片之后的第T个分片时,进行清晰度的切换。
例如,当(C+Q)/D的值为3.4时,T的值则为4;那么在播放完当前分片之后,当播放第4个分片时,进行清晰度的切换。
在本实施例中,为了避免出现当前分片已播放结束但切换清晰度后的分片未下载完成的情况出现,通过计算切换时间点,以保证为切换清晰度后的分片留出充足的下载时间,从而保证了音频和/或视频的无缝切换,不会出现切换卡顿的现象。
实施例二
基于上述实施例一中提供的切换清晰度的方法,本实施例中提供一种切换清晰度的装置,具体地,图3示出了该切换清晰度的装置的可选的结构框图,该切换清晰度的装置被分割成一个或多个程序模块,一个或者多个程序模块被存储于存储介质中,并由一个或多个处理器所执行,以完成本申请。本申请所称的程序模块是指能够完成特定功能的一系列计算机可读指令段,以下描述将具体介绍本实施例各程序模块的功能。
如图3所示,应用于DASH客户端的切换清晰度的装置包括以下组成部分:
解析模块301,用于当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息。
具体的,所述清晰度信息包括:多个可使用的清晰度以及与每个清晰度所对应的带宽。
进一步的,解析模块301,具体用于:
通过解析MPD文件中的Representation文件,得到可使用的清晰度,以及与每个清晰度对应的带宽。
判断模块302,用于在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换。
具体的,判断模块302,包括:
获取单元,用于获取在当前播放的分片之前的N个分片的播放信息;
计算单元,用于根据每个分片的播放信息,计算出每个分片的实际下载速度,并根据N个分片的实际下载速度计算出平均下载速度;
处理单元,用于将所述平均下载速度乘以预设的安全系数以及占分比,得到当前的安全下载速度;
切换单元:将之后播放的分片的清晰度调整为刚好小于所述安全下载速度的带宽所对应的清晰度。
进一步的,所述播放信息包括:建连时长、下载时长、下载总字节数。
所述计算单元,具体用于:
按照如下公式计算出每个分片的实际下载速度:
实际下载速度=(8×下载总字节数)/(建连时长+下载时长);
按照如下公式计算出N个分片的平均下载速度:
平均下载速度=(实际下载速度1+实际下载速度2+……+实际下载速度N)/N。
更进一步的,处理单元,具体用于:
按照如下公式计算得到所述占分比K:
K=(D-L)/D;
其中,D为一个分片的播放时长;
L是根据N个分片的建连时长计算得到的平均建连时长;
按照如下公式计算得到安全下载速度:
安全下载速度=平均下载速度×P×K;
其中,P为安全系数;优选的,P为0.8。
切换模块303,用于在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
具体的,切换模块303,用于:
按照如下公式计算出切换时间点T:
Figure PCTCN2019128448-appb-000003
其中,ceil()为向上取整;
C为当前播放的分片的已播放时长;
Q为安全缓冲时长,且Q等于一个分片的播放时长的1.5倍;
当播放在当前分片之后的第T个分片时,进行清晰度的切换。
实施例三
本实施例还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图4所示,本实施例的计算机设备40至少包括但不限于:可通过系统总线相互通信连接的存储器401、处理器402。需要指出的是,图4仅示出了具有组件401-402的计算机设备40,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器401(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器401可以是计算机设备40的内部存储单元,例如该计算机设备40的硬盘或内存。在另一些实施例中,存储器401也可以是计算机设备40的外部存储设备,例如该计算机设备40上配备的插接式硬盘,智能存储卡 (Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器401还可以既包括计算机设备40的内部存储单元也包括其外部存储设备。在本实施例中,存储器401通常用于存储安装于计算机设备40的操作系统和各类应用软件,例如实施例二的切换清晰度的装置的程序代码等。此外,存储器401还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器402在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器402通常用于控制计算机设备40的总体操作。
具体的,在本实施例中,处理器402用于执行处理器402中存储的切换清晰度的方法的程序,所述切换清晰度的方法的程序被执行时实现如下步骤:
当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
上述方法步骤的具体实施例过程可参见第一实施例,本实施例在此不再重复赘述。
实施例四
本实施例还提供一种计算机可读存储介质(易失性/非易失性),如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下方法步骤:
当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安 全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
上述方法步骤的具体实施例过程可参见第一实施例,本实施例在此不再重复赘述。
本实施例提供的切换清晰度的方法、装置、计算机设备及可读存储介质,能够按照预设的时间间隔,周期性的根据当前的安全下载速度判断是否需要进行清晰度的切换,并自动的在计算出的切换时间点处进行清晰度的切换;由于在计算安全下载速度时考虑到了获取分片的建连时间以及网络抖动,能够保证当前的网络速度足以满足切换后的清晰度的带宽要求;此外,在切换时间点处进行清晰度的切换可以避免出现切换后的清晰度对应的分片未下载完成而当前清晰度的分片已播放结束的情况,从而保证了音频和/或视频的无缝切换,不会出现切换卡顿的现象。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种切换清晰度的方法,所述方法包括:
    当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
    在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
    在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
  2. 根据权利要求1所述的切换清晰度的方法,所述清晰度信息包括:多个可使用的清晰度以及与每个清晰度所对应的带宽。
  3. 根据权利要求1所述的切换清晰度的方法,所述按照设定时间间隔定期确定出当前的安全下载速度,包括:
    获取在当前播放的分片之前的N个分片的播放信息;
    根据每个分片的播放信息,计算出每个分片的实际下载速度,并根据N个分片的实际下载速度计算出平均下载速度;
    将所述平均下载速度乘以预设的安全系数以及占分比,得到当前的安全下载速度。
  4. 根据权利要求3所述的切换清晰度的方法,所述播放信息包括:建连时长、下载时长、下载总字节数;
    所述根据每个分片的播放信息,计算出每个分片的实际下载速度,包括:
    实际下载速度=(8×下载总字节数)/(建连时长+下载时长)。
  5. 根据权利要求3所述的切换清晰度的方法,所述安全系数为0.8;
    所述占分比K按照如下公式计算得到:
    K=(D-L)/D;
    其中,D为一个分片的播放时长;
    L是根据N个分片的建连时长计算得到的平均建连时长。
  6. 根据权利要求2所述的切换清晰度的方法,所述根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换,包括:
    将之后播放的分片的清晰度调整为刚好小于所述安全下载速度的带宽所对应的清晰度。
  7. 根据权利要求1所述的切换清晰度的方法,所述根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换,包括:
    按照如下公式计算出切换时间点T:
    Figure PCTCN2019128448-appb-100001
    其中,ceil()为向上取整;
    C为当前播放的分片的已播放时长;
    Q为安全缓冲时长,且Q等于一个分片的播放时长的1.5倍;
    当播放在当前分片之后的第T个分片时,进行清晰度的切换。
  8. 一种切换清晰度的装置,所述装置包括:
    解析模块,用于当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
    判断模块,用于在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
    切换模块,用于在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
  9. 一种计算机设备,所述计算机设备包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
    当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
    在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
    在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
  10. 根据权利要求9所述的计算机设备,所述清晰度信息包括:多个可使用的清晰度以及与每个清晰度所对应的带宽。
  11. 根据权利要求9所述的计算机设备,所述按照设定时间间隔定期确定出当前的安全下载速度,包括:
    获取在当前播放的分片之前的N个分片的播放信息;
    根据每个分片的播放信息,计算出每个分片的实际下载速度,并根据N个分片的实际下载速度计算出平均下载速度;
    将所述平均下载速度乘以预设的安全系数以及占分比,得到当前的安全下载速度。
  12. 根据权利要求11所述的计算机设备,所述播放信息包括:建连时长、下载时长、下载总字节数;
    所述根据每个分片的播放信息,计算出每个分片的实际下载速度,包括:
    实际下载速度=(8×下载总字节数)/(建连时长+下载时长)。
  13. 根据权利要求11所述的计算机设备,所述安全系数为0.8;
    所述占分比K按照如下公式计算得到:
    K=(D-L)/D;
    其中,D为一个分片的播放时长;
    L是根据N个分片的建连时长计算得到的平均建连时长。
  14. 根据权利要求10所述的计算机设备,所述根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换,包括:
    将之后播放的分片的清晰度调整为刚好小于所述安全下载速度的带宽所对应的清晰度。
  15. 根据权利要求9所述的计算机设备,所述根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换,包括:
    按照如下公式计算出切换时间点T:
    Figure PCTCN2019128448-appb-100002
    其中,ceil()为向上取整;
    C为当前播放的分片的已播放时长;
    Q为安全缓冲时长,且Q等于一个分片的播放时长的1.5倍;
    当播放在当前分片之后的第T个分片时,进行清晰度的切换。
  16. 一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
    当使用DASH播放音频和/或视频时,获取媒体介绍说明MPD文件,并通过解析所述MPD文件得到清晰度信息;
    在播放音频和/或视频的过程中,按照设定时间间隔定期确定出当前的安全下载速度,并根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换;
    在需要进行清晰度的切换的情况下,根据当前播放的分片的已播放时长以及预设的安全缓冲时长,确定出切换时间点,以在所述切换时间点进行清晰度的切换。
  17. 根据权利要求16所述的计算机可读存储介质,所述清晰度信息包括:多个可使用的清晰度以及与每个清晰度所对应的带宽。
  18. 根据权利要求16所述的计算机可读存储介质,所述按照设定时间间隔定期确定出当前的安全下载速度,包括:
    获取在当前播放的分片之前的N个分片的播放信息;
    根据每个分片的播放信息,计算出每个分片的实际下载速度,并根据N个分片的实际下载速度计算出平均下载速度;
    将所述平均下载速度乘以预设的安全系数以及占分比,得到当前的安全下载速度。
  19. 根据权利要求18所述的计算机可读存储介质,所述播放信息包括:建连时长、下载时长、下载总字节数;
    所述根据每个分片的播放信息,计算出每个分片的实际下载速度,包括:
    实际下载速度=(8×下载总字节数)/(建连时长+下载时长)。
  20. 根据权利要求17所述的计算机可读存储介质,所述根据所述安全下载速度以及所述清晰度信息判断是否需要对当前播放的音频和/或视频进行清晰度的切换,包括:
    将之后播放的分片的清晰度调整为刚好小于所述安全下载速度的带宽所对应的清晰度。
PCT/CN2019/128448 2019-01-30 2019-12-25 切换清晰度的方法、装置、计算机设备及可读存储介质 WO2020155959A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19912438.9A EP3879840B1 (en) 2019-01-30 2019-12-25 Definition switching method and apparatus, computer device, and readable storage medium
US17/342,293 US11303949B2 (en) 2019-01-30 2021-06-08 Method of switching resolution, computing device, and computer-readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910091813.9A CN111510770B (zh) 2019-01-30 2019-01-30 切换清晰度的方法、装置、计算机设备及可读存储介质
CN201910091813.9 2019-01-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/342,293 Continuation US11303949B2 (en) 2019-01-30 2021-06-08 Method of switching resolution, computing device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2020155959A1 true WO2020155959A1 (zh) 2020-08-06

Family

ID=71840795

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/128448 WO2020155959A1 (zh) 2019-01-30 2019-12-25 切换清晰度的方法、装置、计算机设备及可读存储介质

Country Status (4)

Country Link
US (1) US11303949B2 (zh)
EP (1) EP3879840B1 (zh)
CN (1) CN111510770B (zh)
WO (1) WO2020155959A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112752152A (zh) * 2020-12-28 2021-05-04 海信视像科技股份有限公司 投送视频播放方法及显示设备
CN113315810A (zh) * 2021-04-29 2021-08-27 上海探寻信息技术有限公司 一种在线音频播放方法及设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087646B (zh) * 2020-08-26 2023-01-17 深圳市雅阅科技有限公司 视频播放方法、装置、计算机设备和存储介质
CN114416013A (zh) * 2022-01-04 2022-04-29 深圳Tcl新技术有限公司 数据发送方法、装置、电子设备及计算机可读存储介质
CN116781951B (zh) * 2023-08-24 2023-12-05 湖南快乐阳光互动娱乐传媒有限公司 一种清晰度调节方法、装置和服务器

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140019635A1 (en) * 2012-07-13 2014-01-16 Vid Scale, Inc. Operation and architecture for dash streaming clients
CN106375836A (zh) * 2016-09-27 2017-02-01 广东小天才科技有限公司 一种视频的分辨率切换方法及装置
CN106993237A (zh) * 2017-04-13 2017-07-28 中北大学 基于mpeg‑dash协议的动态自适应码率选择方法
CN108271048A (zh) * 2018-02-09 2018-07-10 北京邮电大学 一种兼顾吞吐量和视频缓冲的码率自适应调整装置和方法
CN108574860A (zh) * 2017-03-07 2018-09-25 合网络技术(北京)有限公司 多媒体资源播放方法及装置
CN109040855A (zh) * 2018-09-03 2018-12-18 重庆邮电大学 一种无线dash流媒体码率平滑自适应传输方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070044123A1 (en) * 2005-08-16 2007-02-22 Alcatel System and method for smoothing channel changing in internet protocol television systems
US9432433B2 (en) * 2006-06-09 2016-08-30 Qualcomm Incorporated Enhanced block-request streaming system using signaling or block creation
CN101267538B (zh) * 2007-03-15 2010-09-08 华为技术有限公司 一种切换网络电视频道的方法和系统
US20110149753A1 (en) * 2009-12-21 2011-06-23 Qualcomm Incorporated Switching between media broadcast streams having varying levels of quality
US8589583B2 (en) * 2010-09-08 2013-11-19 Hulu, Inc. Method and apparatus for adaptive bit rate switching
US8856283B2 (en) * 2011-06-03 2014-10-07 Apple Inc. Playlists for real-time or near real-time streaming
US9462021B2 (en) * 2012-09-24 2016-10-04 Google Technology Holdings LLC Methods and devices for efficient adaptive bitrate streaming
CN103702219A (zh) * 2013-12-16 2014-04-02 乐视网信息技术(北京)股份有限公司 一种视频播放的控制方法及设备
CN104602044B (zh) * 2015-02-05 2019-02-15 秦永红 一种rtmp流媒体公网直播系统及其设计方法
US10200725B2 (en) * 2015-06-15 2019-02-05 Intel Corporation Adaptive data streaming based on virtual screen size
CN105100830B (zh) * 2015-07-23 2019-02-15 中国科学院声学研究所 一种基于视频聚合服务的快速切换视频源的装置和方法
CN107197371B (zh) * 2016-03-15 2019-12-13 广州市动景计算机科技有限公司 视频清晰度的切换方法及装置
US20180191801A1 (en) * 2016-12-30 2018-07-05 Facebook, Inc. Adaptively updating content delivery network link in a manifest file
US10986001B2 (en) * 2018-01-25 2021-04-20 Nokia Solutions And Networks Oy System and method for quality of service detection of encrypted packet flows

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140019635A1 (en) * 2012-07-13 2014-01-16 Vid Scale, Inc. Operation and architecture for dash streaming clients
CN106375836A (zh) * 2016-09-27 2017-02-01 广东小天才科技有限公司 一种视频的分辨率切换方法及装置
CN108574860A (zh) * 2017-03-07 2018-09-25 合网络技术(北京)有限公司 多媒体资源播放方法及装置
CN106993237A (zh) * 2017-04-13 2017-07-28 中北大学 基于mpeg‑dash协议的动态自适应码率选择方法
CN108271048A (zh) * 2018-02-09 2018-07-10 北京邮电大学 一种兼顾吞吐量和视频缓冲的码率自适应调整装置和方法
CN109040855A (zh) * 2018-09-03 2018-12-18 重庆邮电大学 一种无线dash流媒体码率平滑自适应传输方法

Non-Patent Citations (1)

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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112752152A (zh) * 2020-12-28 2021-05-04 海信视像科技股份有限公司 投送视频播放方法及显示设备
CN112752152B (zh) * 2020-12-28 2022-11-25 海信视像科技股份有限公司 投送视频播放方法及显示设备
CN113315810A (zh) * 2021-04-29 2021-08-27 上海探寻信息技术有限公司 一种在线音频播放方法及设备
CN113315810B (zh) * 2021-04-29 2023-04-07 上海探寻信息技术有限公司 一种在线音频播放方法及设备

Also Published As

Publication number Publication date
EP3879840A1 (en) 2021-09-15
EP3879840B1 (en) 2023-03-22
US20210329319A1 (en) 2021-10-21
CN111510770B (zh) 2021-08-24
US11303949B2 (en) 2022-04-12
EP3879840A4 (en) 2021-11-17
CN111510770A (zh) 2020-08-07

Similar Documents

Publication Publication Date Title
WO2020155959A1 (zh) 切换清晰度的方法、装置、计算机设备及可读存储介质
US9060207B2 (en) Adaptive video streaming over a content delivery network
US9021537B2 (en) Pre-buffering audio streams
US9271003B2 (en) Real-time audio or video transcoding
TWI470983B (zh) 用以更新超文件傳輸協定內容描述之方法及裝置
US11503347B2 (en) Method of playing video, computing device, and computer program product
US20150271231A1 (en) Transport accelerator implementing enhanced signaling
JP6314252B2 (ja) ネットワークビデオ再生方法及び装置
US10404828B2 (en) Streaming apparatus, streaming method, and streaming service system using the streaming apparatus
US11496536B2 (en) Method of requesting video, computing device, and computer-program product
CN110933517A (zh) 码率切换方法、客户端和计算机可读存储介质
WO2020155958A1 (zh) 测量网速的方法、装置、计算机设备及可读存储介质
WO2020155956A1 (zh) 首帧均衡限流方法、装置、计算机设备及可读存储介质
WO2016018572A1 (en) Systems and methods for selective transport accelerator operation
US20240163322A1 (en) Methods, systems, and media for delivering manifestless streaming media content
WO2020155963A1 (zh) 视频清晰度确定方法、系统、计算机设备及存储介质
JP6538061B2 (ja) クライアント端末にマルチメディアコンテンツのコンテンツ部分を提供する方法及び対応するキャッシュ
TW201501526A (zh) 提供多媒體內容之內容部分至用戶端之方法及對應之快取
WO2020155957A1 (zh) 播放音视频的方法、装置、计算机设备及可读存储介质
CN113438313A (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: 19912438

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019912438

Country of ref document: EP

Effective date: 20210610

NENP Non-entry into the national phase

Ref country code: DE