CN112565833A - 一种基于hls的多媒体自适应播放控制方法 - Google Patents

一种基于hls的多媒体自适应播放控制方法 Download PDF

Info

Publication number
CN112565833A
CN112565833A CN202011346190.4A CN202011346190A CN112565833A CN 112565833 A CN112565833 A CN 112565833A CN 202011346190 A CN202011346190 A CN 202011346190A CN 112565833 A CN112565833 A CN 112565833A
Authority
CN
China
Prior art keywords
speed
network
network speed
data packets
control method
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011346190.4A
Other languages
English (en)
Inventor
白天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dilu Technology Co Ltd
Original Assignee
Dilu Technology Co Ltd
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 Dilu Technology Co Ltd filed Critical Dilu Technology Co Ltd
Priority to CN202011346190.4A priority Critical patent/CN112565833A/zh
Publication of CN112565833A publication Critical patent/CN112565833A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control 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/64723Monitoring of network processes or resources, e.g. monitoring of network load
    • H04N21/64738Monitoring network characteristics, e.g. bandwidth, congestion level
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (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)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种基于HLS的多媒体自适应播放控制方法,通过即时速度信息、平均速度信息以及m3u8配置信息的相互比较,我们可以有效区分网速变动的类型,并依据网速变动类型作出选择。

Description

一种基于HLS的多媒体自适应播放控制方法
技术领域
本发明涉及一种基于HLS的多媒体自适应播放控制方法,属于多媒体自适应播放控制领域。
背景技术
HLS是Apple实现的基于HTTP的流媒体传输协议,可实现流媒体的直播和点播,为移动设备提供音视频直播和点播方案。
HLS协议在服务器端将媒体数据流转换为不同质量的、连续的、很短时长的媒体文件(MPEG-TS格式,一般每个小文件可以播放8秒钟,称之为分片),而客户端则不断的下载并播放这些分片。
通常的,对于同一个节目,服务器提供质量不同的多个音视频流(每一种质量的音视频流包含一组分片,对应于一种码率),并通过m3u8格式的配置文件给出这多个音视频流的信息(包含每个音视频流的码率,所包含的分片获取方式)。配置文件中的7个音视频流信息如下:
每个音视频流是由多个分片组成,分片为TS格式,含有8秒的的音视频;
音视频流00:40Kbps有音频流,无视频流,有1张JPEG图片;
音视频流01:120Kbps有音频流,有视频流(视频流分辨率176x144);
音视频流02:300Kbps有音频流,有视频流(视频流分辨率320x180);
音视频流03:500Kbps有音频流,有视频流(视频流分辨率400x224);
音视频流04:800Kbps有音频流,有视频流(视频流分辨率480x270);
音视频流05:1300Kbps有音频流,有视频流(视频流分辨率640x360);
音视频流06:2200Kbps有音频流,有视频流(视频流分辨率1024x576)。
由于数据通过HTTP协议传输,所以完全不用考虑防火墙或者代理的问题,而且分片文件的可以播放的时长很短,客户端可以随时选择和切换到对应的码率上,以适应不同带宽条件下的播放。
下载音视频流时,我们以分片作为最基本的播放单位,对于一个分片,只有两种选择:要么完全下载并播放,要么不下载或者下载一部分之后丢弃。
对于分片,我们一般把一个分片分为若干(≧5)个数据包来下载。每下载完成一次数据包,我们就可以获得下载的信息(下载的字节数和下载时间),通过这些下载信息,我们可以计算出网速。
在手机终端,可以使用HLS客户端来收看服务器上的节目。HLS客户端首先接收m3u8格式的配置文件,然后计算当前的网络速度,并实时依据网络速度来下载对应带宽的音视频流,以达到最佳的用户体验。
其中,计算当前网速的方法是:将最近已经下载的50个数据包字节大小/50个数据包的下载时间,得到当前网络平均速度。通常的,一个分片少于50个包,因此需要下载至少一个分片后才能测算出当前的网络平均速度。
当网速发生极大波动时,因为原有的计算方法是取得50个包网络平均速度,故不能及时根据变化后的网速选择切换到对应的码流,会导致卡顿时间比较长(网速快速下降时)或进入最佳播放状态的时间比较长(网速快速提高时)。
发明内容
本发明为解决现有算法中当网速发生极大波动时,播放HLS媒体流出现卡顿时间比较长或进入最佳播放状态的时间比较长的问题,提供了一种基于HLS的多媒体自适应播放控制方法,通过即时速度信息、平均速度信息以及m3u8配置信息的相互比较,我们可以有效区分网速变动的类型,并依据网速变动类型作出选择。
本发明为解决上述技术问题采用以下技术方案:
一种基于HLS的多媒体自适应播放控制方法,具体步骤如下:
步骤一、取得网络的即时速度和平均速度;
步骤二、通过即时速度和平均速度,判断当前是否属于网速陡升或陡降;
步骤三、如果当前属于网速陡升或者陡降,则取即时速度的平均速度,再依据即时速度的平均速度和m3u8配置来选择对应的流。
进一步,步骤一中根据最近下载的M个数据包的下载信息,确定网络的即时速度:
即时速度Vm=第m个数据包的下载速度=第m个数据包的字节数/第m个数据包下载时间;
根据最近下载的N个数据包的下载信息,计算平均速度:
平均速度VN=N个数据包的总字节数/N个数据包的下载总时间;
其中,下载信息包括下载的字节数和下载所需的时间,m=1,2,…,M,M和N根据需要设定。
进一步,步骤二中:
若V1、V2、…、VM均大于b*Va或b*VN,则当前属于网速陡升;
若V1、V2、…、VM均小于a*Va或a*VN,则当前属于网速陡降;
其中,a、b分别为网速陡降、陡升阈值,当前音视频流带宽Va=当前下载的音视频流对应的码率。
进一步,网速陡降阈值a的取值为0.6,网速陡升阈值b的取值为2.0。
进一步,即时速度的平均速度=的M个数据包的总字节数/M个数据包的下载总时间
本发明采用以上技术方案与现有技术相比,具有以下技术效果:
1.将网速的波动归纳为以下5种类型:网速抖动,网速缓升,网速缓降,网速陡升,网速陡降;
2.通过对即时速度信息、平均速度信息以及m3u8配置信息的相互比较,区分网速变动的5种类型,并依据网速变动类型做出选择;
3.通过对网速大幅突然变化的2种类型优化处理,明显提升用户体验。
附图说明
图1是本发明的流程图;
图2至图6分别是网速抖动、网速缓升、网速缓降、网速陡升和网速陡降的示意图;
图7是HLS网络流音视频节目点播在不同网速变化情况下的测试数据。
具体实施方式
本发明一种基于HLS的多媒体自适应播放控制方法,如图1所示,通过即时速度信息、平均速度信息以及m3u8配置信息的相互比较,我们可以有效区分网速变动的类型,并依据网速变动类型作出选择。
第一步、取得网络的即时速度和平均速度
具体的,存储最近下载的M个数据包的下载信息(下载信息包括:下载的字节数和下载所需的时间),计算这M个数据包每个包的下载速度。存储最近一段时期数据包(N个)的下载信息来计算平均速度。
例如,m值取3、n值取50,即通过最近3个数据包的下载信息计算即时速度,通过最近50个数据包的下载信息计算平均速度。其中,即时速度可以反映当前的下载速度,平均速度反映一段时间内的下载速度。为了实现计算网络的即时速度和平均速度,***需要始终保持若干个数据包的下载信息。
第二步、通过即时速度和平均速度,判断当前是否属于网速陡升或陡降。
即时速度V2=最近下载的第1个数据包字节数/对应数据包下载时间;
即时速度V2=最近下载的第2个数据包字节数/对应数据包下载时间;
即时速度V3=最近下载的第3个数据包字节数/对应数据包下载时间;
平均速度V50=最近下载的50个数据包总字节数/对应数据包下载总时间;
当前音视频流带宽Va=当前下载的音视频流对应的码率。
若V1、V2、V3均大于b*Va或b*VN,则当前属于网速陡升;
若V1、V2、V3均小于a*Va或a*VN,则当前属于网速陡降。
其中,a为网速陡降阈值(取值为0.6),b为网速陡升阈值(取值为2.0)。
第三步、如果当前属于网速陡升或者网速陡降,取即时速度的平均速度,再依据即时速度的平均速度和m3u8配置来选择对应的流。
即时速度的平均速度=最近下载的3个数据包字节数/对应的3个数据包下载时间例:m3u8配置的配置如前面配置文件中的7个音视频流信息
当前播放的为音视频流02 300KBps
VN=350KBps
V1=150KBps;V2=160KBps;V3=140KBps;
发现V1、V2、V3都小于a*VN,认为这是网速陡降,然后计算得到即时速度的平均速度150KBps,依据m3u8配置中的不同流需要的网速,切换到流01。
网速陡升情况改进后的效果:
通过3组的测试对比,自适应所需的时间减少了50%~80%不等,平均减少的自适应时间为原来总时间的70%。
网速陡降改情况进后的效果:
对于原来的算法,原来的用户体验根本不能接受,在某些极端(网速下降的比例很大)的测试中,音视频会卡1分钟以上。
通过3组的测试对比,原来的算法,音视频会卡平均20秒以上;而采用了改进后的方法之后,基本上没有卡的情况出现,少数情况会卡1~3秒,在可以接受的范围内。
本发明将网速的波动归纳为如图2至6所示的5种类型:网速抖动,网速缓升,网速缓降,网速陡升,网速陡降;通过对即时速度信息、平均速度信息以及m3u8配置信息的相互比较,区分网速变动的5种类型,并依据网速变动类型作出选择;通过对网速大幅突然变化的2种类型优化处理,提升用户体验。
具体的HLS网络流音视频节目点播在不同网速变化情况下的测试数据图7所示。
应当指出,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也在本申请权利要求的保护范围内。

Claims (5)

1.一种基于HLS的多媒体自适应播放控制方法,其特征在于,具体步骤如下:
步骤一、取得网络的即时速度和平均速度;
步骤二、通过即时速度和平均速度,判断当前是否属于网速陡升或陡降;
步骤三、如果当前属于网速陡升或者陡降,则取即时速度的平均速度,再依据即时速度的平均速度和m3u8配置来选择对应的流。
2.如权利要求1所述的一种基于HLS的多媒体自适应播放控制方法,其特征在于,步骤一中根据最近下载的M个数据包的下载信息,确定网络的即时速度:
即时速度Vm=第m个数据包的下载速度=第m个数据包的字节数/第m个数据包下载时间;
根据最近下载的N个数据包的下载信息,计算平均速度:
平均速度VN=N个数据包的总字节数/N个数据包的下载总时间;
其中,下载信息包括下载的字节数和下载所需的时间,m=1,2,…,M,M和N根据需要设定。
3.如权利要求1所述的一种基于HLS的多媒体自适应播放控制方法,其特征在于,步骤二中:
若V1、V2、…、VM均大于b*Va或b*VN,则当前属于网速陡升;
若V1、V2、…、VM均小于a*Va或a*VN,则当前属于网速陡降;
其中,a、b分别为网速陡降、陡升阈值,当前音视频流带宽Va=当前下载的音视频流对应的码率。
4.如权利要求3所述的一种基于HLS的多媒体自适应播放控制方法,其特征在于,网速陡降阈值a的取值为0.6,网速陡升阈值b的取值为2.0。
5.如权利要求1所述的一种基于HLS的多媒体自适应播放控制方法,其特征在于,即时速度的平均速度=的M个数据包的总字节数/M个数据包的下载总时间。
CN202011346190.4A 2020-11-26 2020-11-26 一种基于hls的多媒体自适应播放控制方法 Pending CN112565833A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011346190.4A CN112565833A (zh) 2020-11-26 2020-11-26 一种基于hls的多媒体自适应播放控制方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011346190.4A CN112565833A (zh) 2020-11-26 2020-11-26 一种基于hls的多媒体自适应播放控制方法

Publications (1)

Publication Number Publication Date
CN112565833A true CN112565833A (zh) 2021-03-26

Family

ID=75045663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011346190.4A Pending CN112565833A (zh) 2020-11-26 2020-11-26 一种基于hls的多媒体自适应播放控制方法

Country Status (1)

Country Link
CN (1) CN112565833A (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152651A (zh) * 2013-01-31 2013-06-12 广东欧珀移动通信有限公司 一种自动调节流媒体缓冲区播放门限的方法和***
CN106210929A (zh) * 2016-07-13 2016-12-07 诚迈科技(南京)股份有限公司 基于hls客户端的网络流下载终端及优化方法
CN108124192A (zh) * 2016-11-30 2018-06-05 亦非云互联网技术(上海)有限公司 Hls流媒体的播放方法及***
CN109348265A (zh) * 2018-11-27 2019-02-15 湖南国科微电子股份有限公司 基于hls多码流模式下的直播方法及***
CN110121100A (zh) * 2019-05-28 2019-08-13 平安科技(深圳)有限公司 媒体文件的下载方法、装置、终端和计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152651A (zh) * 2013-01-31 2013-06-12 广东欧珀移动通信有限公司 一种自动调节流媒体缓冲区播放门限的方法和***
CN106210929A (zh) * 2016-07-13 2016-12-07 诚迈科技(南京)股份有限公司 基于hls客户端的网络流下载终端及优化方法
CN108124192A (zh) * 2016-11-30 2018-06-05 亦非云互联网技术(上海)有限公司 Hls流媒体的播放方法及***
CN109348265A (zh) * 2018-11-27 2019-02-15 湖南国科微电子股份有限公司 基于hls多码流模式下的直播方法及***
CN110121100A (zh) * 2019-05-28 2019-08-13 平安科技(深圳)有限公司 媒体文件的下载方法、装置、终端和计算机可读存储介质

Similar Documents

Publication Publication Date Title
US11076187B2 (en) Systems and methods for performing quality based streaming
US10298985B2 (en) Systems and methods for performing quality based streaming
CN107147919B (zh) 直播快速启播方法及***
US7779146B2 (en) Methods and systems for HTTP streaming using server-side pacing
US20080133766A1 (en) Method and apparatus for streaming media to a plurality of adaptive client devices
CN106803968B (zh) 一种基于hls协议的带宽自适应调节视频分辨率的方法
CN110121100B (zh) 媒体文件的下载方法、装置、终端和计算机可读存储介质
JP5147950B2 (ja) 可変帯域幅のチャンネルを介してサイマル放送を行う装置および方法
EP2437458A1 (en) Content delivery
MX2013013373A (es) Metodo para adaptacion dinamica de la tasa de bits recibida y receptor asociado.
CN108124192B (zh) Hls流媒体的播放方法及***
CN109561347B (zh) 一种互联网视频播放质量判定方法及***
KR20170018333A (ko) 클라이언트 단말기와 적어도 하나의 서버 간의 송신 경로를 따라 배열된 네트워크 장비를 동작하기 위한 방법, 및 대응하는 네트워크 장비
KR101702426B1 (ko) 다시점 비디오 서비스의 시점변경 지연을 줄이기 위한 다중 http 스레드 기반의 비디오 전송 시스템 및 방법
CN112565833A (zh) 一种基于hls的多媒体自适应播放控制方法
WO2009053595A1 (fr) Dispositif de reception en continu de paquets de donnees audio et/ou video
CN110881018B (zh) 媒体流的实时接收方法及客户端
EP3664456A1 (en) Apparatus and method for playing streamed media
CN115336283B (zh) 客户机装置和向客户机装置流传送媒体内容的方法
Shende et al. Cross-layer Network Bandwidth Estimation for Low-latency Live ABR Streaming
KR20190048186A (ko) 적응적 스트리밍 서비스를 위한 다중 경로 기반 분할 전송 시스템 및 스트리밍 방법
WO2017084772A1 (en) Delivery of media content segments in a content delivery network
WO2021167531A1 (en) Methods and systems for bandwidth estimation
Laine et al. Network Capacity Estimators Predicting QoE in HTTP Adaptive Streaming
JP2022542767A (ja) コンテンツ配信のためのレイテンシマネジメント

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210326