CN111131862A - 一种实现cmaf直播源自动主备切换的实现方法 - Google Patents

一种实现cmaf直播源自动主备切换的实现方法 Download PDF

Info

Publication number
CN111131862A
CN111131862A CN202010001542.6A CN202010001542A CN111131862A CN 111131862 A CN111131862 A CN 111131862A CN 202010001542 A CN202010001542 A CN 202010001542A CN 111131862 A CN111131862 A CN 111131862A
Authority
CN
China
Prior art keywords
live broadcast
broadcast server
timestamp
standby
main
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
CN202010001542.6A
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.)
Shandong Yunman Intelligent Technology Co ltd
Original Assignee
Shandong Yunman Intelligent 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 Shandong Yunman Intelligent Technology Co ltd filed Critical Shandong Yunman Intelligent Technology Co ltd
Priority to CN202010001542.6A priority Critical patent/CN111131862A/zh
Publication of CN111131862A publication Critical patent/CN111131862A/zh
Priority to PCT/CN2020/092458 priority patent/WO2021135053A1/zh
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2405Monitoring of the internal components or processes of the server, e.g. server load
    • 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/64Addressing
    • H04N21/6405Multicasting
    • 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/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/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

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

Abstract

一种实现CMAF直播源自动主备切换的实现方法,CMAF直播中主备直播服务器切换时可以有效的同步主备直播服务器直播流的时间戳以及切片位置,并通过合适的负载均衡方式对外提供服务,从而达到了客户端无感知的CMAF主备切换。

Description

一种实现CMAF直播源自动主备切换的实现方法
技术领域
本发明涉及IPTV、在线视频技术领域,具体涉及一种实现CMAF直播源自动主备切换的实现方法。
背景技术
随着直播技术以及互联网直播业务的发展,用户对于直播延时的要求越来越苛刻。CMAF直播可以在保持了DASH及HLS优秀的CDN适用性的基础上将延时降低到了1-3秒。但因为其低延时特性,对时间戳要求十分精确,针对多机热备场景,需要有良好的机制保证主备服务器生成的直播流的时间戳一致性。
发明内容
本发明为了克服以上技术的不足,提供了一种达到客户端无感知的CMAF直播源自动主备切换的实现方法。
本发明克服其技术问题所采用的技术方案是:
一种实现CMAF直播源自动主备切换的实现方法,包括步骤:
a)主备直播服务器通过udp协议组播查询同组的主备直播服务器,同组的主备直播服务器通过tcp协议短链接进行时间戳同步,主备直播服务器采用ntp协议进行服务器时间同步;
b)主备直播服务器从同一个组播接收MPEG-TS流格式的音视频流;
c)主直播服务器开始直播时先利用组播询问是否已有直播中的备直播服务器,若果有回应则从备直播服务器获取换算时间戳,并利用该换算时间戳生成CMAF的每帧的时间戳,如果没有回应或回应都为否则主直播服务器在处理第一针数据时将当前时间戳设置为换算时间戳并记录当前帧的源时间戳;
d)如果同组的主备直播服务器中已有服务器进行直播,则主动向正在直播的直播服务器发起tcp连接请求,并获取该直播服务器的换算时间戳与原帧起始时间戳;
e)每次MPEG-TS时间戳循环一次后,将换算时间戳增加一个MPEG-TS时间戳循环的时间;
f)利用时间戳换算公式fMP4时间戳=换算时间戳-原帧起始时间戳+当前帧TS时间戳,计算目标帧时间戳,即fMP4时间戳。
进一步的,将主备直播服务器设置虚拟IP地址,对外采用虚拟IP提供服务。
进一步的,主备直播服务器在音视频流的每次IDR帧前判断当前帧时间戳与换算时间戳之间的差值,如果差值为设置音视频切片长度的正整数倍数,则将此IDR帧以及之后的帧放到新的切片文件内。
进一步的,虚拟IP采用高可用负载均衡模式,主备直播服务器根据负载能力均分客户端请求。
进一步的,当主备直播服务器中某台服务器异常时,客户端请求全部分配到正常的直播服务器中。
本发明的有益效果是:CMAF直播中主备直播服务器切换时可以有效的同步主备直播服务器直播流的时间戳以及切片位置,并通过合适的负载均衡方式对外提供服务,从而达到了客户端无感知的CMAF主备切换。
具体实施方式
下面对本发明做进一步说明。
一种实现CMAF直播源自动主备切换的实现方法,包括步骤:
a)主备直播服务器通过udp协议组播查询同组的主备直播服务器,同组的主备直播服务器通过tcp协议短链接进行时间戳同步,主备直播服务器采用ntp协议进行服务器时间同步;
b)主备直播服务器从同一个组播接收MPEG-TS流格式的音视频流;
c)主直播服务器开始直播时先利用组播询问是否已有直播中的备直播服务器,若果有回应则从备直播服务器获取换算时间戳,并利用该换算时间戳生成CMAF的每帧的时间戳,如果没有回应或回应都为否则主直播服务器在处理第一针数据时将当前时间戳设置为换算时间戳并记录当前帧的源时间戳;
d)如果同组的主备直播服务器中已有服务器进行直播,则主动向正在直播的直播服务器发起tcp连接请求,并获取该直播服务器的换算时间戳与原帧起始时间戳;
e)每次MPEG-TS时间戳循环一次后,将换算时间戳增加一个MPEG-TS时间戳循环的时间;
f)利用时间戳换算公式fMP4时间戳=换算时间戳-原帧起始时间戳+当前帧TS时间戳,计算目标帧时间戳,即fMP4时间戳。
通过以上的方法,CMAF直播中主备直播服务器切换时可以有效的同步主备直播服务器直播流的时间戳以及切片位置,并通过合适的负载均衡方式对外提供服务,从而达到了客户端无感知的CMAF主备切换。
优选的,将主备直播服务器设置虚拟IP地址,对外采用虚拟IP提供服务,虚拟IP采用高可用负载均衡模式,主备直播服务器根据负载能力均分客户端请求。CMAF采用的是HTTP进行分发,且每个切片在几百KB至几MB之间,为了确保客户端每次获取都能成功获取到切片,故采用虚拟IP地址以及负载均衡的方式,将每次客户端的请求首先通过虚拟IP地址统一分配,然后再根据主备服务器的负载从合适的服务器返回实际文件。
CMAF也是采用秒级小切片的直播格式,为了保证主备切换时直播不中断,需要同步主备直播服务器的切片时刻。首先保证每个切片都是从IDR帧开始,然后以换算时间戳作为直播起始时间,每个指定间隔进行一次切片。因为IDR帧每隔大约1秒出现一次,主备直播服务器的时间以及主备直播服务器接收并处理一帧的时间远低于1秒,因此可以保证主备直播服务器会在同一个IDR帧前切片。因此,进一步的,主备直播服务器在音视频流的每次IDR帧前判断当前帧时间戳与换算时间戳之间的差值,如果差值为设置音视频切片长度的正整数倍数,则将此IDR帧以及之后的帧放到新的切片文件内。同时,当主备直播服务器中某台服务器异常时,客户端请求全部分配到正常的直播服务器中。

Claims (5)

1.一种实现CMAF直播源自动主备切换的实现方法,其特征在于,包括步骤:
a)主备直播服务器通过udp协议组播查询同组的主备直播服务器,同组的主备直播服务器通过tcp协议短链接进行时间戳同步,主备直播服务器采用ntp协议进行服务器时间同步;
b)主备直播服务器从同一个组播接收MPEG-TS流格式的音视频流;
c)主直播服务器开始直播时先利用组播询问是否已有直播中的备直播服务器,若果有回应则从备直播服务器获取换算时间戳,并利用该换算时间戳生成CMAF的每帧的时间戳,如果没有回应或回应都为否则主直播服务器在处理第一针数据时将当前时间戳设置为换算时间戳并记录当前帧的源时间戳;
d)如果同组的主备直播服务器中已有服务器进行直播,则主动向正在直播的直播服务器发起tcp连接请求,并获取该直播服务器的换算时间戳与原帧起始时间戳;
e)每次MPEG-TS时间戳循环一次后,将换算时间戳增加一个MPEG-TS时间戳循环的时间;
f)利用时间戳换算公式fMP4时间戳=换算时间戳-原帧起始时间戳+当前帧TS时间戳,计算目标帧时间戳,即fMP4时间戳。
2.根据权利要求1所述的实现CMAF直播源自动主备切换的实现方法,其特征在于:将主备直播服务器设置虚拟IP地址,对外采用虚拟IP提供服务。
3.根据权利要求1所述的实现CMAF直播源自动主备切换的实现方法,其特征在于:主备直播服务器在音视频流的每次IDR帧前判断当前帧时间戳与换算时间戳之间的差值,如果差值为设置音视频切片长度的正整数倍数,则将此IDR帧以及之后的帧放到新的切片文件内。
4.根据权利要求2所述的实现CMAF直播源自动主备切换的实现方法,其特征在于:虚拟IP采用高可用负载均衡模式,主备直播服务器根据负载能力均分客户端请求。
5.根据权利要求4所述的实现CMAF直播源自动主备切换的实现方法,其特征在于:当主备直播服务器中某台服务器异常时,客户端请求全部分配到正常的直播服务器中。
CN202010001542.6A 2020-01-02 2020-01-02 一种实现cmaf直播源自动主备切换的实现方法 Pending CN111131862A (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010001542.6A CN111131862A (zh) 2020-01-02 2020-01-02 一种实现cmaf直播源自动主备切换的实现方法
PCT/CN2020/092458 WO2021135053A1 (zh) 2020-01-02 2020-05-27 一种实现cmaf直播源自动主备切换的实现方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010001542.6A CN111131862A (zh) 2020-01-02 2020-01-02 一种实现cmaf直播源自动主备切换的实现方法

Publications (1)

Publication Number Publication Date
CN111131862A true CN111131862A (zh) 2020-05-08

Family

ID=70507426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010001542.6A Pending CN111131862A (zh) 2020-01-02 2020-01-02 一种实现cmaf直播源自动主备切换的实现方法

Country Status (2)

Country Link
CN (1) CN111131862A (zh)
WO (1) WO2021135053A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021135053A1 (zh) * 2020-01-02 2021-07-08 山东云缦智能科技有限公司 一种实现cmaf直播源自动主备切换的实现方法
CN113824985A (zh) * 2021-09-18 2021-12-21 北京百度网讯科技有限公司 直播拉流方法、装置、设备、存储介质及计算机程序产品
CN114598428A (zh) * 2022-05-10 2022-06-07 北京中科大洋科技发展股份有限公司 一种基于srt协议的冗余推流方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016160744A1 (en) * 2015-03-27 2016-10-06 Twitter, Inc. Live video streaming services
CN105472443A (zh) * 2016-01-13 2016-04-06 杭州当贝网络科技有限公司 一种直播源控制方法及***
CN106790005B (zh) * 2016-12-13 2019-09-17 武汉市烽视威科技有限公司 实现低延时hls直播的***及方法
CN106790116A (zh) * 2016-12-27 2017-05-31 程桂平 一种直播源切换方法
CN109005418A (zh) * 2018-08-13 2018-12-14 湖南快乐阳光互动娱乐传媒有限公司 一种直播信号源无感切换控制方法及控制***
CN111131862A (zh) * 2020-01-02 2020-05-08 山东云缦智能科技有限公司 一种实现cmaf直播源自动主备切换的实现方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021135053A1 (zh) * 2020-01-02 2021-07-08 山东云缦智能科技有限公司 一种实现cmaf直播源自动主备切换的实现方法
CN113824985A (zh) * 2021-09-18 2021-12-21 北京百度网讯科技有限公司 直播拉流方法、装置、设备、存储介质及计算机程序产品
CN113824985B (zh) * 2021-09-18 2023-08-22 北京百度网讯科技有限公司 直播拉流方法、装置、设备、存储介质及计算机程序产品
CN114598428A (zh) * 2022-05-10 2022-06-07 北京中科大洋科技发展股份有限公司 一种基于srt协议的冗余推流方法

Also Published As

Publication number Publication date
WO2021135053A1 (zh) 2021-07-08

Similar Documents

Publication Publication Date Title
CN111131862A (zh) 一种实现cmaf直播源自动主备切换的实现方法
US8839340B2 (en) Method, system and device for synchronization of media streams
US11758209B2 (en) Video distribution synchronization
US8667164B2 (en) Method and apparatus for playing live content
US20140222962A1 (en) Determining available media data for network streaming
US9813475B1 (en) Delivering a video stream
US20170353747A1 (en) Quality of Media Synchronization
KR20180090719A (ko) 미디어 동기화 방법 및 시스템
CN107920072B (zh) 一种基于数据特征的多媒体共享方法及***
CN102291458B (zh) 一种p2p服务器架构方法
WO2018171567A1 (zh) 播放媒体流的方法、服务器及终端
Anmulwar et al. Frame synchronisation for multi-source holograhphic teleportation applications-an edge computing based approach
US11900010B2 (en) Method of managing an audio stream read in a manner that is synchronized on a reference clock
CN114900707A (zh) 一种直播方法及***
US10523409B2 (en) Method of synchronization during the processing, by a multimedia player, of an item of multimedia content transmitted by an MBMS service
CN113645491A (zh) 一种多个直播播放端实现实时同步播放的方法
Montagud et al. Early event-driven (EED) RTCP feedback for rapid IDMS
CN115314745B (zh) 一种流媒体同步方法
Boronat et al. Smooth control of adaptive media playout to acquire IDMS in cluster-based applications
JP6178893B1 (ja) ユニキャスト配信装置、再生同期システム、ユニキャスト配信方法、およびユニキャスト配信プログラム
CN114339328A (zh) 时间戳同步服务实现方法和***
AU2011245930A1 (en) Method and apparatus for playing live content

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: 20200508

RJ01 Rejection of invention patent application after publication