WO2020098455A1 - Method for real-time delivery of media stream and server - Google Patents

Method for real-time delivery of media stream and server Download PDF

Info

Publication number
WO2020098455A1
WO2020098455A1 PCT/CN2019/112324 CN2019112324W WO2020098455A1 WO 2020098455 A1 WO2020098455 A1 WO 2020098455A1 CN 2019112324 W CN2019112324 W CN 2019112324W WO 2020098455 A1 WO2020098455 A1 WO 2020098455A1
Authority
WO
WIPO (PCT)
Prior art keywords
media
unit
time
candidate
sorting
Prior art date
Application number
PCT/CN2019/112324
Other languages
French (fr)
Chinese (zh)
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 北京开广信息技术有限公司
Publication of WO2020098455A1 publication Critical patent/WO2020098455A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • 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/40Support for services or applications
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed by the present invention are a method for real-time delivery of a media stream and a server. The method comprises the following steps: receiving a media segment request sent by a client terminal, wherein the media segment request does not carry any control parameter or carry at least one control parameter, and the control parameter includes a first category of parameters indicating a target media stream to be transmitted, a second category of parameters indicating candidate media units to be transmitted, and a unit sorting manner; generating a media segment according to the media segment request, wherein the target media stream to be transmitted is determined according to the first category of parameters, the candidate media units to be transmitted are determined according to the second category of parameters, and the candidate media units to be transmitted are sorted and encapsulated into the media segment in an order specified by the unit sorting manner; and sending the media segment to the client terminal. The method can realize real-time and segmented delivery of media stream according to the requirements of the client terminal, thereby effectively reducing the delay and overhead of media stream transmission, and supporting the transmission priority of the latest and high-priority media units.

Description

媒体流的实时递送方法及服务器Media stream real-time delivery method and server
相关申请的交叉引用Cross-reference of related applications
本申请要求北京开广信息技术有限公司于2018年11月14日提交的、发明名称为“媒体流的实时递送方法及服务器”的、中国专利申请号“201811351129.1”的优先权。This application requires the priority of the Chinese patent application number "201811351129.1" filed by Beijing Kaiguang Information Technology Co., Ltd. and filed on November 14, 2018, with the invention titled "media streaming real-time delivery method and server".
技术领域Technical field
本发明涉及数字信息传送技术领域,特别涉及一种媒体流的实时递送方法及服务器。The invention relates to the technical field of digital information transmission, in particular to a method and server for real-time delivery of media streams.
背景技术Background technique
随着互联网特别是移动互联网的快速发展,通过互联网来实时传送音频、视频、图像等多媒体数据成为许多应用的基本需求,为满足这一需求,人们提出了各种流媒体实时传输技术,目前得到广泛使用的主要包括三类:实时传送协议(RTP(Real-time Transport Protocol,实时传输协议)/RTSP(Real Time Streaming Protocol,实时流传输协议))、RTMP(Real Time Messaging Protocol,实时消息传送协议)和HTTP(HyperText Transfer Protocol,超文本传输协议)自适应性流传输HAS(HTTP Adaptive Streaming)。其中,HTTP自适应流传输又包括多种方案:苹果公司提出的HLS(HTTP Live Streaming)、微软提出的平滑流Smooth Streaming、Adobe提出的HDS(HTTP Dynamic Streaming)、MPEG组织提出的DASH(Dynamic Adaptive Streaming over HTTP,基于HTTP的动态自适应流)。With the rapid development of the Internet, especially the mobile Internet, the real-time transmission of audio, video, image and other multimedia data through the Internet has become the basic demand of many applications. To meet this demand, various real-time streaming media transmission technologies have been proposed, which are currently available Three types are widely used: real-time transport protocol (RTP (Real-time Transport Protocol) / RTSP (Real Time Streaming Protocol)), RTMP (Real Time Time Messaging Protocol), real-time messaging protocol ) And HTTP (HyperTextTransferProtocol, Hypertext Transfer Protocol) adaptive streaming HAS (HTTPAdaptiveStreaming). Among them, HTTP adaptive streaming includes multiple solutions: HLS (HTTP Live Streaming) proposed by Apple, Smooth Streaming proposed by Microsoft, HDS (HTTP Dynamic Streaming) proposed by Adobe, and DASH (Dynamic Adaptive) proposed by MPEG. Streaming over HTTP, dynamic adaptive streaming based on HTTP).
相关技术中的HTTP自适应性流传输方案的共同特点是将媒体流切割成短时间(2s~10s)的媒体片段,并同时生成描述这些媒体片段的索引文件或清单文件(例如HLS中的m3u8播放列表和DASH中的MPD文件),然后将其保存到各Web服务器上,客户端通过访问播放列表或清单文件,获得这些媒体片段的URL(Uniform Resource Locator,统一资源定位符)访问地址,然后可以采用标准的HTTP协议来逐个下载这些媒体片段并进行播放。简言之,上述方案的主要区别体现在媒体片段采用的封装格式和清单文件格式的不同。The common feature of the HTTP adaptive streaming solution in the related art is that the media stream is cut into media fragments in a short time (2s ~ 10s), and an index file or a manifest file describing these media fragments is generated at the same time (such as m3u8 in HLS) Playlists and MPD files in DASH), and then save them to each web server, the client obtains the URL (Uniform Resource Locator) access address of these media fragments by accessing the playlist or manifest file, and then You can use standard HTTP protocol to download and play these media segments one by one. In short, the main difference between the above schemes is the difference between the packaging format adopted by the media fragments and the format of the manifest file.
相对于RTP/RTSP和RTMP来说,HTTP自适应流传输可以充分利用现有的互联网Web缓存设施(如CDN和各种Web缓存服务器),可以支持大规模的用户访问。同时,通过提供多种码率的媒体片段,还可以支持客户端根据网络条件和终端能力来自行选择合适码率的片段,实现码率自适应。因此,HTTP自适应流传输已成为目前互联网上实时流媒体递送的主流方式。Compared with RTP / RTSP and RTMP, HTTP adaptive streaming can make full use of the existing Internet Web cache facilities (such as CDN and various Web cache servers), and can support large-scale user access. At the same time, by providing media segments with multiple bit rates, it can also support clients to select segments with appropriate bit rates according to network conditions and terminal capabilities, to achieve bit rate adaptation. Therefore, HTTP adaptive streaming has become the mainstream method of real-time streaming media delivery on the Internet.
但是,相关技术中的HTTP自适应流传输方案均存在以下问题:However, the HTTP adaptive streaming solutions in related technologies all have the following problems:
第一,媒体片段的时长无法适应动态变化的网络传输。目前的HAS方案均采用预分段的方式,即服务器按照预先设置的时长来生成媒体片段及其清单文件并提交给web服务器。当网络传输带宽充足且延时较小时,设置较大的片段时长意味着增加实时传送的延时;当网络传输带宽不足且延时较大时,设置较小的片段时长意味着频繁的文件请求,增加服务器的负担和网络传输开销。由于互联网上的传输带宽和传输延时是动态变化的,采用固定时长的预分段方式无法实现最优传输。First, the length of media fragments cannot adapt to dynamically changing network transmissions. The current HAS solutions all use a pre-segmentation method, that is, the server generates media fragments and their manifest files according to a preset time and submits them to the web server. When the network transmission bandwidth is sufficient and the delay is small, setting a larger fragment length means increasing the real-time transmission delay; when the network transmission bandwidth is insufficient and the delay is large, setting a smaller fragment length means frequent file requests , Increase the burden on the server and network transmission overhead. Since the transmission bandwidth and transmission delay on the Internet are dynamically changing, using a fixed-length pre-segmentation method cannot achieve optimal transmission.
第二,清单文件增加了传送延时和开销。客户端需要先得到清单文件,才能获得媒体片段的URL地址。但是由于清单文件需要经过一段时间才能传输给客户端,因此,客户端得到的清单文件并不能反映当前最新的媒体片段的生成情况,此外,当清单文件遇到阻塞或者传输出错时,将阻塞用户对媒体片段的快速访问,降低实时流媒体的传送性能。Second, the manifest file adds transmission delay and overhead. The client needs to obtain the manifest file before it can obtain the URL address of the media segment. However, because the manifest file takes a period of time to be transmitted to the client, the manifest file obtained by the client does not reflect the current generation of the latest media fragments. In addition, when the manifest file encounters blocking or transmission errors, it will block the user Fast access to media fragments reduces the transmission performance of real-time streaming media.
第三,不支持对最新媒体内容的优先传送。在许多应用场景中,如实时监控、实时赛事直播等,用户往往期待及时看到最新产生的媒体内容,特别是当传输网络带宽不足以传输所有媒体内容时,而现有HTTP自适应流传输方案中无法满足这一需求,这体现在:首先,从服务器上媒体片段的打包生成,到清单文件的更新,再到客户端获取清单文件并发送请求,最后到服务器接收到请求需要经过一段延时,此时客户端根据清单文件请求的媒体片段可能已非最新产生的媒体内容;其次,当媒体片段按照时间先后顺序来封装,并采用HTTP/TCP协议来传送,一旦发生拥塞,则能传送到客户端的只是这些媒体片段的前半部,而包含较新媒体内容的后半部却无法及时传送。Third, priority transmission of the latest media content is not supported. In many application scenarios, such as real-time monitoring and live event live broadcasting, users often expect to see the latest media content in time, especially when the transmission network bandwidth is insufficient to transmit all media content, and the existing HTTP adaptive streaming solution This requirement cannot be met in the following, which is reflected in: first, from the packaging and generation of media fragments on the server, to the update of the manifest file, to the client to obtain the manifest file and send the request, and finally to the server to receive the request after a delay At this time, the media segment requested by the client according to the manifest file may not be the latest media content generated; secondly, when the media segment is encapsulated in chronological order and transmitted using HTTP / TCP protocol, once congestion occurs, it can be transmitted to The client is only the first half of these media clips, while the second half containing newer media content cannot be delivered in time.
第四,不支持对高优先级内容的优先传送。在一些应用场景中,媒体流包括了各种不同类型的媒体单元,这些媒体单元的重要性或优先级不同,比如通常音频单元比视频单元的优先级更高;另外,即使同一种类型的媒体单元,也可能因为编码,产生不同的优先级,比如视频编码中,I帧的重要性高于P帧和B帧。当网络传输条件较差导致无法传送所有媒体单元时,为了保证用户的体验,应优先传送高优先级内容,但是,对于现有的HTTP自适应流传输方案来说,由于媒体片段都是预先生成的,无法调整媒体片段的内容,因此,无法支持高优先级内容的优先传送,亟待解决。Fourth, priority transmission of high-priority content is not supported. In some application scenarios, the media stream includes various types of media units. The importance or priority of these media units is different. For example, the audio unit usually has a higher priority than the video unit. In addition, even the same type of media Units may also have different priorities due to encoding. For example, in video encoding, the I frame is more important than the P and B frames. When the network transmission conditions are poor and all media units cannot be transmitted, in order to ensure the user's experience, high-priority content should be transmitted first. However, for the existing HTTP adaptive streaming solution, the media fragments are generated in advance The content of media clips cannot be adjusted, so it is impossible to support the preferential transmission of high-priority content, which needs to be resolved urgently.
发明内容Summary of the invention
本发明旨在至少在一定程度上解决相关技术中的技术问题之一。The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
为此,本发明的第一个目的在于提出一种媒体流的实时递送方法,该方法可以有效降低媒体流传输延时和开销,并支持对最新媒体单元和高优先级媒体单元的优先传送。To this end, the first object of the present invention is to propose a real-time delivery method of media streams, which can effectively reduce the media stream transmission delay and overhead, and support the preferential transmission of the latest media units and high-priority media units.
本发明的第二个目的在于提出一种媒体流的实时递送服务器。The second object of the present invention is to propose a real-time delivery server for media streams.
本发明的第三个目的在于提出一种计算机设备。The third object of the present invention is to propose a computer device.
本发明的第四个目的在于提出一种非临时性计算机可读存储介质。The fourth object of the present invention is to propose a non-transitory computer-readable storage medium.
本发明的第五个目的在于提出一种计算机程序产品。The fifth object of the present invention is to propose a computer program product.
为达到上述目的,本发明一方面实施例提出了一种媒体流的实时递送方法,其特征在于,所述媒体流为实时产生的媒体单元的序列,其中,每个媒体单元关联有一个产生时间和/或一个指示产生顺序的序号,所述方法包括:接收客户端发送的媒体段请求,其中,所述媒体段请求不携带或携带至少一个控制参数,且控制参数包括指示待传送的目标媒体流的第一类参数、指示待传送的候选媒体单元的第二类参数和单元排序方式;根据所述媒体段请求生成媒体段,其中,根据所述第一类参数确定所述待传送的目标媒体流,根据所述第二类参数确定所述待传送的候选媒体单元,将所述待传送的候选媒体单元按所述单元排序方式指定的顺序排序并封装成所述媒体段;发送所述媒体段至所述客户端。To achieve the above objective, an embodiment of the present invention provides a method for real-time delivery of media streams, characterized in that the media stream is a sequence of media units generated in real time, where each media unit is associated with a generation time And / or a sequence number indicating the generation sequence, the method includes: receiving a media segment request sent by a client, wherein the media segment request does not carry or carries at least one control parameter, and the control parameter includes indicating the target media to be transmitted The first type parameter of the stream, the second type parameter indicating the candidate media unit to be transmitted and the unit sorting method; generating a media segment according to the media segment request, wherein the target to be transmitted is determined according to the first type parameter Media stream, determining the candidate media units to be transferred according to the second type of parameters, sorting and encapsulating the candidate media units to be transferred in the order specified by the unit sorting method, and packaging the media segments; sending the Media segment to the client.
本发明实施例的媒体流的实时递送方法,根据客户端的请求来实时生成媒体段,并返回给客户端,以实现按客户端需求分段的实时媒体流递送,媒体分段的时长将自动适应网络传输带宽的变化,客户端可以通过主动请求来控制媒体分段的时长,由于每个媒体段是由客户端的请求触发产生的,不再需要清单文件,客户端也不需要请求和解析清单文件,一方面客户端可以更快速的获得最新的媒体流,减少了实时媒体流的传输延时,另一方面,也降低了清单文件带来的传输开销和处理开销,最后,客户端还可以通过请求来控制媒体段中媒体单元的产生时间及排列顺序,在网络传输条件较差时尽可能保证及时发送最新产生的媒体单元或高优先级的媒体单元,从而有效降低媒体流传输延时和开销,并支持对最新媒体单元和高优先级媒体单元的优先传送。The real-time delivery method of the media stream according to the embodiment of the present invention generates a media segment in real time according to the request of the client and returns it to the client, so as to realize the real-time media stream delivery according to the client's needs, and the duration of the media segment will be automatically adapted When the network transmission bandwidth changes, the client can control the length of media segmentation through active requests. Since each media segment is triggered by the client's request, the manifest file is no longer needed, and the client does not need to request and parse the manifest file. On the one hand, the client can obtain the latest media stream more quickly, reducing the transmission delay of the real-time media stream. On the other hand, it also reduces the transmission overhead and processing overhead caused by the manifest file. Finally, the client can also pass Request to control the generation time and arrangement order of the media units in the media segment. When the network transmission conditions are poor, ensure that the latest generated media unit or high-priority media unit is sent in a timely manner, thereby effectively reducing the media stream transmission delay and overhead , And supports priority transmission of the latest media units and high-priority media units.
另外,根据本发明上述实施例的媒体流的实时递送方法还可以具有以下附加的技术特征:In addition, the method for real-time delivery of media streams according to the above embodiments of the present invention may also have the following additional technical features:
进一步地,在本发明的一个实施例中,所述根据所述媒体段请求生成媒体段,进一步包括:如果所述媒体段请求不携带所述第一类参数,则所述待传送的目标媒体流为缺省指定的媒体流;如果所述媒体段请求中不携带所述第二类参数,则所述候选媒体单元包括缺省指定的媒体单元,所述缺省指定的媒体单元为所述目标媒体流中所有和最新媒体单元的序号间隔小于第一预设值的媒体单元,或者为所述目标媒体流中所有和最新媒体单元的产生时间间隔小于第二预设值的媒体单元;如果所述媒体段请求中不携带所述单元排序方式,则将所述候选媒体单元按照缺省指定的单元排序方式来封装成所述媒体段。Further, in an embodiment of the present invention, the generating a media segment according to the media segment request further includes: if the media segment request does not carry the first type parameter, the target media to be transmitted The stream is a media stream designated by default; if the second segment parameter is not carried in the media segment request, the candidate media unit includes a media unit designated by default, and the media unit designated by default is the A media unit in which the sequence number interval of all and latest media units in the target media stream is less than the first preset value, or a media unit in which the generation time interval of all and latest media units in the target media stream is less than the second preset value; if The media segment request does not carry the unit sorting mode, and then the candidate media unit is encapsulated into the media segment according to the unit sorting mode specified by default.
进一步地,在本发明的一个实施例中,所述根据媒体段请求生成媒体段,进一步包括:如果所述媒体段请求携带至少一个所述第二类参数,其中,所述每个第二类参数对应着候选媒体单元的至少一个约束条件,则所述待传送的候选媒体单元包括所述目标媒体流中同时满足所述第二类参数对应的全部约束条件的所有媒体单元。Further, in an embodiment of the present invention, the generating the media segment according to the media segment request further includes: if the media segment request carries at least one parameter of the second category, wherein each of the second category The parameter corresponds to at least one constraint condition of the candidate media unit, and the candidate media unit to be transmitted includes all media units in the target media stream that simultaneously satisfy all the constraint conditions corresponding to the second-type parameter.
进一步地,在本发明的一个实施例中,所述每个媒体单元关联有一个序偏,所述序偏是指所述媒体单元与最新媒体单元的序号间隔,所述第二类参数包括起始序号和/或最大序偏,其中,所述起始序号对应的约束条件为:如果所述起始序号有效,则所述候选媒体单元的序号在所述起始序号之后;所述最大序偏对应的约束条件为:如果所述最大序偏有效,则所述候选媒体单元的序偏小于或等于所述最大序偏。Further, in an embodiment of the present invention, each media unit is associated with a sequence offset, where the sequence offset refers to the interval between the sequence number of the media unit and the latest media unit, and the second type of parameter includes A start sequence number and / or a maximum sequence offset, wherein the constraint condition corresponding to the start sequence number is: if the start sequence number is valid, the sequence number of the candidate media unit is after the start sequence number; the maximum sequence The constraint condition corresponding to the bias is: if the maximum order bias is valid, the order bias of the candidate media unit is less than or equal to the maximum order bias.
进一步地,在本发明的一个实施例中,所述每个媒体单元关联有一个时偏,所述时偏是指所述媒体单元与最新媒体单元的产生时间间隔,所述第二类参数包括起始时间和/或最大时偏,其中,所述起始时间对应的约束条件为:如果所述起始时间有效,则所述候选媒体单元的产生时间在所述起始时间之后;所述最大时偏对应的约束条件为:如果所述最大时偏有效,则所述候选媒体单元的时偏小于或等于所述最大时偏。Further, in an embodiment of the present invention, each media unit is associated with a time offset, the time offset refers to a time interval between the generation of the media unit and the latest media unit, and the second type of parameters includes A start time and / or a maximum time offset, wherein the constraint condition corresponding to the start time is: if the start time is valid, the generation time of the candidate media unit is after the start time; The constraint condition corresponding to the maximum time offset is: if the maximum time offset is valid, the time offset of the candidate media unit is less than or equal to the maximum time offset.
进一步地,在本发明的一个实施例中,所述每个媒体单元关联有一个优先级,所述第二类参数包括最小优先级,所述最小优先级对应的约束条件包括:如果所述最小优先级有效,则所述候选媒体单元的优先级大于或等于最小优先级;如果所述媒体段请求携带的其他第二类参数未限定候选媒体单元的范围,则所述候选媒体单元的范围为缺省指定。Further, in an embodiment of the present invention, each media unit is associated with a priority, the second type parameter includes a minimum priority, and the constraint corresponding to the minimum priority includes: if the minimum If the priority is valid, the priority of the candidate media unit is greater than or equal to the minimum priority; if the other second-type parameters carried in the media segment request do not define the scope of the candidate media unit, the scope of the candidate media unit is Specify by default.
可选地,在本发明的一个实施例中,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向。Optionally, in an embodiment of the present invention, the unit sorting mode is one of the following basic sorting modes: sequence number forward, sequence number reverse, generation time forward, and generation time reverse.
可选地,在本发明的一个实施例中,所述每个媒体单元关联有一个优先级,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向、高优先级优先、低优先级优先。Optionally, in an embodiment of the present invention, each media unit is associated with a priority, and the unit sorting mode is one of the following basic sorting modes: sequence number forward, sequence number reverse, and generation time forward , Reverse time, high priority and low priority.
可选地,在本发明的一个实施例中,所述单元排序方式为多个基本排序方式的级联,所述将候选媒体单元按单元排序方式指定的顺序排序包括:将所述候选媒体单元按照第一基本排序方式排序,且将排序后位置相同的候选媒体单元按照第二基本排序方式排序,依此类推直至完成排序。Optionally, in an embodiment of the present invention, the unit sorting mode is a cascade of multiple basic sorting modes, and sorting the candidate media units in the order specified by the unit sorting mode includes: sorting the candidate media units Sort according to the first basic sorting manner, and sort the candidate media units with the same position after sorting according to the second basic sorting manner, and so on until the sorting is completed.
为达到上述目的,本发明另一方面实施例提出了一种媒体流的实时递送服务器,所述媒体流为实时产生的媒体单元的序列,其中,每个媒体单元关联有一个产生时间和/或一个指示产生顺序的序号,所述服务器包括:客户端接口组件,用于接收客户端发送的媒体段请求并返回相应的媒体段,其中,所述媒体段请求不携带或携带至少一个控制参数,且控制参数包括指示待传送的目标媒体流的第一类参数、指示待传送的候选媒体单元的第二类参数和单元排序方式;媒体段生成组件,根据所述媒体段请求生成媒体段,其中,根据所述第一类参数确定所述待传送的目标媒体流,根据所述第二类参数确定所述待传送的候选媒体单元,将所述待传送的候选媒体单元按单元排序方式指定的顺序排序并封装成所述媒体段,并通过所述客户端接口组件发送所述媒体段至所述客户端。To achieve the above objective, another embodiment of the present invention provides a real-time delivery server for a media stream, where the media stream is a sequence of media units generated in real time, where each media unit is associated with a generation time and / or A sequence number indicating the generation sequence, the server includes: a client interface component, configured to receive a media segment request sent by the client and return the corresponding media segment, wherein the media segment request does not carry or carries at least one control parameter, And the control parameters include a first type parameter indicating the target media stream to be transmitted, a second type parameter indicating the candidate media unit to be transmitted, and a unit sorting method; a media segment generation component generates a media segment according to the media segment request, wherein , Determine the target media stream to be transmitted according to the first type of parameter, determine the candidate media unit to be transmitted according to the second type parameter, and specify the candidate media unit to be transmitted in the unit sorting manner The media segments are sequentially sorted and packaged, and the media segments are sent to the client through the client interface component.
本发明实施例的媒体流的实时递送服务器,根据客户端的请求来实时生成媒体段,并返回给客户端,以实现按客户端需求分段的实时媒体流递送,媒体分段的时长将自动适应网络传输带宽的变化,客户端可以通过主动请求来控制媒体分段的时长,由于每个媒体段是由客户端的请求触发产生的,不再需要清单文件,客户端也不需要请求和解析清单文件,一方面客户端可以更快速的获得最新的媒体流,减少了实时媒体流的传输延时,另一方面,也降低了清单文件带来的传输开销和处理开销,最后,客户端还可以通过请求来控制媒体段中媒体单元的产生时间及排列顺序,在网络传输条件较差时尽可能保证及时发送最新产生的媒体单元或高优先级的媒体单元,从而有效降低媒体流传输延时和开销,并支持对最新媒体单元和高优先级媒体单元的优先传送。The real-time delivery server of the media stream according to the embodiment of the present invention generates media segments in real time according to the client's request and returns them to the client, so as to realize the real-time media stream delivery according to the client's needs, and the duration of the media segment will be automatically adapted When the network transmission bandwidth changes, the client can control the length of media segmentation through active requests. Since each media segment is triggered by the client's request, the manifest file is no longer needed, and the client does not need to request and parse the manifest file. On the one hand, the client can obtain the latest media stream more quickly, reducing the transmission delay of the real-time media stream. On the other hand, it also reduces the transmission overhead and processing overhead caused by the manifest file. Finally, the client can also pass Request to control the generation time and arrangement order of the media units in the media segment. When the network transmission conditions are poor, ensure that the latest generated media unit or high-priority media unit is sent in a timely manner, thereby effectively reducing the media stream transmission delay and overhead , And supports priority transmission of the latest media units and high-priority media units.
另外,根据本发明上述实施例的媒体流的实时递送服务器还可以具有以下附加的技术特征:In addition, the real-time delivery server for media streams according to the above embodiments of the present invention may also have the following additional technical features:
进一步地,在本发明的一个实施例中,所述媒体段生成组件进一步用于在所述媒体段请求不携带所述第一类参数时,所述待传送的目标媒体流为缺省指定的媒体流,且在所述媒体段请求中不携带所述第二类参数时,所述候选媒体单元包括缺省指定的媒体单元,所述缺省指定的媒体单元为所述目标媒体流中所有和最新媒体单元的序号间隔小于第一预设值的媒体单元,或者为所述目标媒体流中所有和最新媒体单元的产生时间间隔小于第二预设值的媒体单元,以及在所述媒体段请求中不携带所述单元排序方式时,将所述候选媒体单元按照缺省指定的单元排序方式来封装成所述媒体段。Further, in an embodiment of the present invention, the media segment generation component is further configured to: when the media segment request does not carry the first type parameter, the target media stream to be transmitted is specified by default A media stream, and when the media segment request does not carry the second type parameter, the candidate media unit includes a media unit specified by default, and the media unit specified by default is all of the target media stream A media unit with a sequence number interval less than the first preset value from the latest media unit, or all media units in the target media stream whose generation time interval is less than the second preset value, and the media segment When the request does not carry the unit sorting mode, the candidate media unit is encapsulated into the media segment according to the unit sorting mode specified by default.
进一步地,在本发明的一个实施例中,所述媒体段生成组件进一步用于在所述媒体段请求携带至少一个所述第二类参数,其中,所述每个第二类参数对应着候选媒体单元的至少一个约束条件时,所述待传送的候选媒体单元包括所述目标媒体流中同时满足所述第二类参数对应的全部约束条件的所有媒体单元。Further, in an embodiment of the present invention, the media segment generating component is further configured to request to carry at least one parameter of the second type in the media segment, wherein each parameter of the second type corresponds to a candidate When the media unit has at least one constraint condition, the candidate media unit to be transmitted includes all media units in the target media stream that simultaneously satisfy all the constraint conditions corresponding to the second type parameter.
进一步地,在本发明的一个实施例中,所述每个媒体单元关联有一个序偏,所述序偏是指所述媒体单元与最新媒体单元的序号间隔,所述第二类参数包括起始序号和/或最大序偏,其中,所述起始序号对应的约束条件为:如果所述起始序号有效,则所述候选媒体单元的序号在所述起始序号之后;所述最大序偏对应的约束条件为:如果所述最大序偏有效,则所述候选媒体单元的序偏小于或等于所述最大序偏。Further, in an embodiment of the present invention, each media unit is associated with a sequence offset, where the sequence offset refers to the interval between the sequence number of the media unit and the latest media unit, and the second type of parameter includes A start sequence number and / or a maximum sequence offset, wherein the constraint condition corresponding to the start sequence number is: if the start sequence number is valid, the sequence number of the candidate media unit is after the start sequence number; the maximum sequence The constraint condition corresponding to the bias is: if the maximum order bias is valid, the order bias of the candidate media unit is less than or equal to the maximum order bias.
进一步地,在本发明的一个实施例中,所述每个媒体单元关联有一个时偏,所述时偏是指所述媒体单元与最新媒体单元的产生时间间隔,所述第二类参数包括起始时间和/或最大时偏,其中,所述起始时间对应的约束条件为:如果所述起始时间有效,则所述候选媒体单元的产生时间在所述起始时间之后;所述最大时偏对应的约束条件为:如果所述最大时偏有效,则所述候选媒体单元的时偏小于或等于所述最大时偏。Further, in an embodiment of the present invention, each media unit is associated with a time offset, the time offset refers to a time interval between the generation of the media unit and the latest media unit, and the second type of parameters includes A start time and / or a maximum time offset, wherein the constraint condition corresponding to the start time is: if the start time is valid, the generation time of the candidate media unit is after the start time; The constraint condition corresponding to the maximum time offset is: if the maximum time offset is valid, the time offset of the candidate media unit is less than or equal to the maximum time offset.
进一步地,在本发明的一个实施例中,所述每个媒体单元关联有一个优先级,所述第二类参数包括最小优先级,所述最小优先级对应的约束条件包括:如果所述最小优先级有效,则所述候选媒体单元的优先级大于或等于最小优先级;如果所述媒体段请求携带的其他第二类参数未限定候选媒体单元的范围,则所述候选媒体单元的范围为缺省指定。Further, in an embodiment of the present invention, each media unit is associated with a priority, the second type parameter includes a minimum priority, and the constraint corresponding to the minimum priority includes: if the minimum If the priority is valid, the priority of the candidate media unit is greater than or equal to the minimum priority; if the other second-type parameters carried in the media segment request do not define the scope of the candidate media unit, the scope of the candidate media unit is Specify by default.
可选地,在本发明的一个实施例中,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向。Optionally, in an embodiment of the present invention, the unit sorting mode is one of the following basic sorting modes: sequence number forward, sequence number reverse, generation time forward, and generation time reverse.
可选地,在本发明的一个实施例中,所述每个媒体单元关联有一个优先级,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向、高优先级优先、低优先级优先。Optionally, in an embodiment of the present invention, each media unit is associated with a priority, and the unit sorting mode is one of the following basic sorting modes: sequence number forward, sequence number reverse, and generation time forward , Reverse time, high priority and low priority.
可选地,在本发明的一个实施例中,所述单元排序方式为多个基本排序方式的级联,所述将候选媒体单元按单元排序方式指定的顺序排序包括:将所述候选媒体单元按照第一基本排序方式排序,且将排序后位置相同的候选媒体单元按照第二基本排序方式排序,依此类推直至完成排序。Optionally, in an embodiment of the present invention, the unit sorting mode is a cascade of multiple basic sorting modes, and sorting the candidate media units in the order specified by the unit sorting mode includes: sorting the candidate media units Sort according to the first basic sorting manner, and sort the candidate media units with the same position after sorting according to the second basic sorting manner, and so on until the sorting is completed.
为达到上述目的,本发明第三方面实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如上述实施例描述的媒体流的实时递送方法。To achieve the above objective, an embodiment of the third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, Realize the real-time delivery method of the media stream as described in the above embodiments.
为达到上述目的,本发明第四方面实施例提出了一种非临时性计算机可读存储介质,该程序被处理器执行时实现如上述实施例描述的媒体流的实时递送方法。In order to achieve the above object, an embodiment of the fourth aspect of the present invention provides a non-transitory computer-readable storage medium. When the program is executed by a processor, a method for real-time delivery of a media stream as described in the foregoing embodiment is implemented.
为达到上述目的,本发明第五方面实施例提出了一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,执行如上述实施例描述的媒体流的实时递送方法。In order to achieve the above object, an embodiment of the fifth aspect of the present invention provides a computer program product. When instructions in the computer program product are executed by a processor, a method for real-time delivery of media streams as described in the foregoing embodiment is performed.
本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will be partially given in the following description, and some will become apparent from the following description, or be learned through the practice of the present invention.
附图说明BRIEF DESCRIPTION
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above-mentioned and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
图1为根据本发明实施例的媒体流的实时递送方法的流程图;1 is a flowchart of a method for real-time delivery of media streams according to an embodiment of the present invention;
图2为根据本发明一个实施例的客户端连续提交媒体段请求的实时传送过程示意图;2 is a schematic diagram of a real-time transmission process of a client continuously submitting a media segment request according to an embodiment of the present invention;
图3为根据本发明一个实施例的候选媒体单元排序并封装到媒体段的示意图(单元排序方式为序号反向);3 is a schematic diagram of sorting and encapsulating candidate media units into media segments according to an embodiment of the present invention (unit sorting method is sequence number reverse);
图4为根据本发明另一个实施例的候选媒体单元排序并封装到媒体段的示意图(单元排序方式为时间反向);4 is a schematic diagram of sorting and encapsulating candidate media units into media segments according to another embodiment of the present invention (unit sorting method is time reverse);
图5为根据本发明再一个实施例的候选媒体单元排序并封装到媒体段的示意图(单元排序方式为高优先级优先+时间反向);以及FIG. 5 is a schematic diagram of sorting and packaging candidate media units according to yet another embodiment of the present invention (packet sorting method is high priority first + time reverse); and
图6为根据本发明实施例的媒体流的实时递送服务器的结构示意图。6 is a schematic structural diagram of a real-time delivery server for media streams according to an embodiment of the present invention.
具体实施方式detailed description
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。Hereinafter, embodiments of the present invention will be described in detail. Examples of the embodiments are shown in the drawings, in which the same or similar reference numerals indicate the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the drawings are exemplary, and are intended to explain the present invention, and should not be construed as limiting the present invention.
在互联网中,经常需要将各种实时产生的音频流、视频流或数据流从一个网络节点传送到另一个网络节点,这些网络节点既包括各种终端,如PC、手机、平板,也包括各种应用服务器,如视频服务器、音频服务器,将传送的这些音频流、视频流或数据流统称为媒体流。媒体流的传送过程可以用通用的客户端-服务器模型来描述:实时产生的媒体流由服务器递送给客户端。这里的服务器和客户端指的是逻辑上的功能实体,其中,服务器为发送媒体流的功能实体,客户端为接收媒体流的功能实体。服务器和客户端可存在于任何网络节点上。In the Internet, it is often necessary to transfer various real-time generated audio streams, video streams or data streams from one network node to another network node. These network nodes include not only various terminals, such as PCs, mobile phones, tablets, but also various Various application servers, such as video servers and audio servers, collectively refer to these audio streams, video streams, or data streams as media streams. The transmission process of the media stream can be described by a general client-server model: the media stream generated in real time is delivered by the server to the client. The server and the client here refer to logical functional entities, where the server is a functional entity that sends media streams and the client is a functional entity that receives media streams. The server and client can exist on any network node.
每个传送的媒体流是一个实时产生的媒体单元的序列。不同的媒体流,其对应的媒体单元可以自行选择。当媒体流是一个实时产生的字节流时,可以选取一个字节为媒体单元;当媒体流是一个经过实时采样获得的音频流或视频流时,可以选取原始的音频帧或视频帧为媒体单元;当媒体流是一个经过实时采样和编码的音频流或视频流时,可以选择编码后的音频帧、编码后的视频帧或访问单元(Access Unit)为媒体单元;当媒体流是一个经过实时采样、编码和封装的音频流或视频流时,可以选择封装后的传输包(如RTP包,PES/PS/TS包等)为媒体单元;当媒体流是一个经过实时采样、编码、封装和预分段的音频流或视频流时,可以选择一个已分割的媒体片段(如HLS协议中使用的TS格式片段、DASH协议中使用的fMP4格式片段)为媒体单元。Each transmitted media stream is a sequence of media units generated in real time. For different media streams, the corresponding media units can be selected by themselves. When the media stream is a byte stream generated in real time, one byte can be selected as the media unit; when the media stream is an audio stream or video stream obtained through real-time sampling, the original audio frame or video frame can be selected as the media Unit; when the media stream is a real-time sampled and encoded audio stream or video stream, you can select the encoded audio frame, encoded video frame or access unit (Access Unit) as the media unit; when the media stream is a When real-time sampling, encoding and encapsulating audio or video streams, you can select the encapsulated transmission package (such as RTP packet, PES / PS / TS packet, etc.) as the media unit; when the media stream is a real-time sampling, encoding, encapsulation With pre-segmented audio or video streams, you can select a segmented media segment (such as the TS format segment used in the HLS protocol and the fMP4 format segment used in the DASH protocol) as the media unit.
每个媒体单元可以关联一个产生时间,该产生时间通常为一个时间戳。每个媒体单元还可以关联一个序号,该序号可以用来表示媒体单元产生的顺序。当序号用来表示媒体单元产生的顺序时,序号的意义需要根据具体的媒体单元来定义。当媒体单元为一个字节时,媒体单元的序号为字节序号;当媒体单元为音频帧、视频帧时,媒体单元的序号为帧序号;当媒体单元为一个传输包时,媒体单元的序号为包序号;当媒体单元为一个流片段时,媒体单元的序号为片段序号(如HLS中每个TS片段的Media Sequence)。Each media unit may be associated with a generation time, which is usually a time stamp. Each media unit can also be associated with a serial number, which can be used to indicate the order in which the media units are generated. When the serial number is used to indicate the order in which the media unit is generated, the meaning of the serial number needs to be defined according to the specific media unit. When the media unit is a byte, the serial number of the media unit is the byte serial number; when the media unit is an audio frame or video frame, the serial number of the media unit is the frame serial number; when the media unit is a transmission packet, the serial number of the media unit Is the packet sequence number; when the media unit is a stream segment, the sequence number of the media unit is the segment sequence number (such as the Media Sequence of each TS segment in HLS).
对于一个媒体流来说,可以同时关联一个表示产生顺序的序号和一个产生时间, 比如,当实时媒体流为一个RTP包流时,RTP头部既有包序号(Sequence Number)字段来指示RTP包的顺序,又有Timestramp字段来指示RTP中封装的媒体数据的产生时间。在此情况下,多个连续的RTP包可能对应相同的产生时间,但是其序号则是唯一的。For a media stream, you can associate a sequence number and a generation time, for example, when the real-time media stream is an RTP packet stream, the RTP header has a Sequence Number field to indicate the RTP packet In order, there is a Timestramp field to indicate the generation time of the media data encapsulated in RTP. In this case, multiple consecutive RTP packets may correspond to the same generation time, but the sequence number is unique.
本发明实施例的方法可以针对任何一种实时媒体流来实施。在下面的实施例当中,本发明实施例将分别选择RTP实时媒体流或MPEG2-TS实时媒体流来阐述本发明实施例的实施方法。对于RTP实时流来说,媒体单元为一个RTP包,选择RTP的包序号(Sequence Number)为媒体单元的序号,RTP包的包序号为一个16位字段,最大值为65535,对于连续产生的RTP包,其序号是循环计数的,如果当前包序号为Seq,则下一个包的序号为(Seq+1)%65536,因此,序号在实现上受制于其位长,可能出现序号大小无法反映其先后顺序的情况,此时,可通过媒体单元的产生时间来判断序号是否出现循环计数,以准确判断两个媒体单元的序号的先后关系及其间隔。对于MPEG2-TS实时流来说,可以采用类似于HLS/DASH的方式,将TS流分割成固定时长比如1秒左右的TS片段,每个TS片段可包括多个媒体帧,然后将这些片段按产生顺序编上序号,作为媒体单元,每个片段中包含的第一个媒体帧的时间戳指明了该片段的产生时间。The method of the embodiment of the present invention may be implemented for any real-time media stream. In the following embodiments, the embodiments of the present invention will respectively select RTP real-time media streams or MPEG2-TS real-time media streams to illustrate the implementation method of the embodiments of the present invention. For RTP real-time streaming, the media unit is an RTP packet, and the sequence number of the RTP packet is selected as the sequence number of the media unit. The packet sequence number of the RTP packet is a 16-bit field with a maximum value of 65535. For continuously generated RTP The sequence number of the packet is cyclically counted. If the current packet sequence number is Seq, the sequence number of the next packet is (Seq + 1)% 65536. Therefore, the sequence number is subject to its bit length in implementation, and the sequence number size may not reflect its In the case of sequence, at this time, it can be judged by the generation time of the media unit whether the serial number has a cycle count, so as to accurately determine the sequence relationship and interval between the sequence numbers of the two media units. For the MPEG2-TS real-time stream, you can use a method similar to HLS / DASH to divide the TS stream into TS fragments of a fixed duration, such as about 1 second, each TS fragment can include multiple media frames, and then press these fragments The generation sequence is numbered, and as a media unit, the timestamp of the first media frame contained in each segment indicates the generation time of the segment.
在相关技术中的实时流媒体协议如RTP或RTMP中,采用的是服务器推送的方式:服务器上一旦有新的媒体单元,则主动发送给客户端。本发明实施例的方法则可以与各种HTTP自适应流(如HLS、平滑流,MPEG-DASH)类似,采用客户端拉取的方式,但是不同点在于,现有的各种HTTP自适应流中,客户端都是根据清单文件来请求或拉取已分割好的片段,每个片段可以通过一个URL来标识,而在本发明的实施例中,媒体段可以不是预先分割好的,而是服务器根据客户端的请求即时生成的,客户端可以控制媒体段的内容及时长。In real-time streaming media protocols such as RTP or RTMP in related technologies, the server push method is adopted: once a new media unit is available on the server, it is actively sent to the client. The method of the embodiment of the present invention may be similar to various HTTP adaptive streams (such as HLS, smooth stream, MPEG-DASH), and adopts the client-side pull method, but the difference is that the existing various HTTP adaptive streams In the client, the client requests or pulls the divided segments according to the manifest file, and each segment can be identified by a URL. In the embodiment of the present invention, the media segment may not be pre-divided, but The server generates it immediately according to the client's request, and the client can control the content and length of the media segment.
下面参照附图描述根据本发明实施例提出的媒体流的实时递送方法及服务器,首先将参照附图描述根据本发明实施例提出的媒体流的实时递送方法。The method and server for real-time delivery of media streams according to embodiments of the present invention will be described below with reference to the drawings. First, the method for real-time delivery of media streams according to embodiments of the present invention will be described with reference to the drawings.
图1是本发明实施例的媒体流的实时递送方法的流程图。FIG. 1 is a flowchart of a method for real-time delivery of media streams according to an embodiment of the present invention.
如图1所示,该媒体流的实时递送方法,媒体流为实时产生的媒体单元的序列,其中,每个媒体单元关联有一个产生时间和/或一个指示产生顺序的序号,方法包括:As shown in FIG. 1, in the real-time delivery method of the media stream, the media stream is a sequence of media units generated in real time, where each media unit is associated with a generation time and / or a sequence number indicating the generation order. The method includes:
在步骤S101中,接收客户端发送的媒体段请求,其中,媒体段请求不携带或携带至少一个控制参数,且控制参数包括指示待传送的目标媒体流的第一类参数、指示待传送的候选媒体单元的第二类参数和单元排序方式。In step S101, a media segment request sent by a client is received, where the media segment request does not carry or carries at least one control parameter, and the control parameter includes a first type parameter indicating a target media stream to be transmitted, and a candidate indicating to be transmitted The second type of media unit parameters and unit ordering method.
具体而言,媒体段请求可以不携带任何第一类参数和第二类参数,可以根据进一 步实施的需要来定义新的参数,例如,可以作为第一类参数的控制参数包括:媒体流标识、媒体流名称等;可以作为第二类参数的控制参数包括:起始序号、起始时间、最大序偏、最大时偏、最小优先级、最大优先级等。Specifically, the media segment request may not carry any first-type parameters and second-type parameters, and new parameters may be defined according to the needs of further implementation. For example, control parameters that may be used as the first-type parameters include: media stream identification, Media stream name, etc .; control parameters that can be used as the second type of parameters include: start sequence number, start time, maximum sequence offset, maximum time offset, minimum priority, maximum priority, etc.
媒体段请求可以采用任何协议来提交,比如常见的HTTP协议、TCP协议、UDP协议等。当采用HTTP协议提交媒体段请求时,也可以采用HTTP-GET方式或者HTTP-POST方式。Media segment requests can be submitted using any protocol, such as the common HTTP protocol, TCP protocol, UDP protocol, etc. When HTTP protocol is used to submit media segment request, HTTP-GET or HTTP-POST can also be used.
当媒体段请求中携带控制参数时,控制参数需要采用一定的方式封装成字符串或字节流,发送给服务器。例如,当采用HTTP-GET来发送媒体段请求时,控制参数可以作为字符串封装到URL中。采用HTTP-GET的媒体段请求的示例如下:When the media segment request carries control parameters, the control parameters need to be encapsulated into a string or byte stream in a certain way and sent to the server. For example, when HTTP-GET is used to send a media segment request, the control parameters can be encapsulated as a string in the URL. Examples of media segment requests using HTTP-GET are as follows:
不携带控制参数的媒体段请求:Media segment request without control parameters:
GET“http://www.xxx-server.com/msreq”[req1]GET "http://www.xxx-server.com/msreq" [req1]
携带一个控制参数的媒体段请求:Media segment request carrying a control parameter:
GET“http://www.xxx-server.com/msreq?streamID=601”[req2]GET "http://www.xxx-server.com/msreq?streamID=601"[req2]
GET“http://www.xxx-server.com/msreq?seqBegin=1005”[req3]GET "http://www.xxx-server.com/msreq?seqBegin = 1005" [req3]
GET“http://www.xxx-server.com/msreq?timeBegin=31000”[req4]GET "http://www.xxx-server.com/msreq?timeBegin=31000"[req4]
GET“http://www.xxx-server.com/msreq?maxSeqOffset=10”[req5]GET "http://www.xxx-server.com/msreq?maxSeqOffset=10"[req5]
GET“http://www.xxx-server.com/msreq?maxTimeOffset=2000”[req6]GET "http://www.xxx-server.com/msreq?maxTimeOffset=2000"[req6]
GET“http://www.xxx-server.com/msreq?minPriority=4”[req7]GET "http://www.xxx-server.com/msreq?minPriority=4"[req7]
GET“http://www.xxx-server.com/msreq?maxPriority=3”[req8]GET "http://www.xxx-server.com/msreq?maxPriority=3"[req8]
GET“http://www.xxx-server.com/msreq?unitSortMode=SEQ_BACKWARD”[req9]GET "http://www.xxx-server.com/msreq?unitSortMode=SEQ_BACKWARD"[req9]
携带两个控制参数的媒体段请求:Media segment request carrying two control parameters:
GET“http://www.xxx-server.com/msreq?seqBegin=1010&maxSeqOffset=5”[req10]GET "http://www.xxx-server.com/msreq?seqBegin = 1010 & maxSeqOffset = 5" [req10]
GET“http://www.xxx-server.com/msreq?timeBegin=31000&maxTimeOffset=3000”[req11]GET "http://www.xxx-server.com/msreq?timeBegin=31000&maxTimeOffset=3000"[req11]
GET“http://www.xxx-server.com/msreq?seqBegin=1010&minPriority=3”[req12]GET "http://www.xxx-server.com/msreq?seqBegin = 1010 & minPriority = 3" [req12]
GET“http://www.xxx-server.com/msreq?timeBegin=31000&GET "http://www.xxx-server.com/msreq?timeBegin=31000&
unitSortMode=TIME_BACKWARD”[req13]unitSortMode = TIME_BACKWARD ”[req13]
GET“http://www.xxx-server.com/msreq?timeBegin=31000&GET "http://www.xxx-server.com/msreq?timeBegin=31000&
unitSortMode=HIGH_PRIORITY_FIRST”[req14]unitSortMode = HIGH_PRIORITY_FIRST "[req14]
GET“http://www.xxx-server.com/msreq?maxTimeOffset=2000&GET "http://www.xxx-server.com/msreq?maxTimeOffset=2000&
unitSortMode=HIGH_PRIORITY_FIRST+TIME_BACKWARD”[req15]unitSortMode = HIGH_PRIORITY_FIRST + TIME_BACKWARD "[req15]
携带三个控制参数的媒体段请求:Media segment request carrying three control parameters:
GET“http://www.xxx-server.com/msreq?seqBegin=1010&maxSeqOffset=5&unitSortMode=TIME_BACKWARD”[req16]GET "http://www.xxx-server.com/msreq?seqBegin=1010&maxSeqOffset=5&unitSortMode=TIME_BACKWARD"[req16]
GET“http://www.xxx-server.com/msreq?timeBegin=33000&GET "http://www.xxx-server.com/msreq?timeBegin=33000&
maxTimeOffset=3000&unitSortMode=TIME_BACKWARD”[req17]maxTimeOffset = 3000 & unitSortMode = TIME_BACKWARD ”[req17]
上述请求的URL中,参数名streamID、seqBegin、timeBegin、maxSeqOffset、maxTimeOffset、minPriority、maxPriority和unitSortMode分别代表媒体流标识、起始序号、起始时间、最大序偏、最大时偏,最小优先级、最大优先级和单元排序方式。In the URL of the above request, the parameter names streamID, seqBegin, timeBegin, maxSeqOffset, maxTimeOffset, minPriority, maxPriority and unitSortMode represent the media stream ID, start sequence number, start time, maximum sequence offset, maximum time offset, minimum priority, maximum Priority and unit sorting method.
服务器端可以采用Web服务器来接收上述客户端的媒体段请求,并从请求的URL中提取出相应的控制参数,并对控制参数进行分类:如果是媒体流标识,则该参数为第一类参数;如果为起始序号、起始时间、最大序偏、最大时偏、最小优先级和最大优先级,则为第二类参数。The server can use a Web server to receive the client ’s media segment request, extract the corresponding control parameters from the requested URL, and classify the control parameters: if it is a media stream identifier, this parameter is the first type of parameter; If it is the start sequence number, start time, maximum sequence offset, maximum time offset, minimum priority and maximum priority, it is the second type of parameter.
在步骤S102中,根据媒体段请求生成媒体段,其中,根据第一类参数确定待传送的目标媒体流,根据第二类参数确定待传送的候选媒体单元,并将待传送的候选媒体单元按单元排序方式指定的顺序排序并封装成媒体段。In step S102, a media segment is generated according to the media segment request, wherein the target media stream to be transmitted is determined according to the first type of parameter, the candidate media unit to be transmitted is determined according to the second type of parameter, and the candidate media unit to be transmitted is The order specified by the cell sorting method is sorted and encapsulated into media segments.
具体而言,服务器接收到媒体段请求后,可获取媒体段请求中携带的控制参数,然后可以根据其中的第一类参数来确定待传送的目标媒体流,根据携带的第二类参数来确定待传送的候选媒体单元,最后将待传送的候选媒体单元按单元排序方式指定的顺序排序并封装成媒体段。其中,可以采用自定义的封装协议将一个或多个媒体单元封装成媒体段,例如一个简单的封装协议如下:媒体段由段头和段净荷组成,段净荷由若干个媒体单元级联而成,段头中则指示每个媒体单元的起始位置和长度。候选单元在封装成媒体端时,应保证媒体单元在媒体段中的顺序与单元排序方式指定的顺序一致。Specifically, after receiving the media segment request, the server can obtain the control parameters carried in the media segment request, and then can determine the target media stream to be transmitted according to the first type parameters therein, and determine the second type parameters carried The candidate media units to be transmitted are finally sorted and packaged into media segments in the order specified by the unit sorting manner. Among them, you can use a custom encapsulation protocol to encapsulate one or more media units into a media segment. For example, a simple encapsulation protocol is as follows: The media segment is composed of a segment header and a segment payload. The segment payload is formed by cascading several media units. The header indicates the starting position and length of each media unit. When the candidate units are packaged into the media side, the order of the media units in the media segment should be consistent with the order specified by the unit sorting method.
在步骤S103中,发送媒体段至客户端。In step S103, the media segment is sent to the client.
具体而言,服务器可以根据客户端的媒体段请求所使用的协议来选择适当的方式将媒体段发送给客户端,例如当接收的媒体段请求采用HTTP GET方式时,可以通过HTTP GET响应消息来发送生成的媒体段:将媒体段放入到HTTP响应消息的实体主体中。Specifically, the server can select the appropriate method to send the media segment to the client according to the protocol used by the client's media segment request. For example, when the received media segment request uses HTTP GET, it can be sent through the HTTP GET response message. Generated media segment: Put the media segment into the entity body of the HTTP response message.
当服务器接收到来自客户端的连续的媒体段请求时,服务器将根据客户端的请求来不断生成新的媒体段,这些新的媒体段中封装了最近产生的若干媒体单元,客户端解析这些媒体段,即可恢复出实时媒体流的各媒体单元,实现了媒体流从服务器到客户端的实时传送,这一过程如图2所示。When the server receives continuous media segment requests from the client, the server will continuously generate new media segments according to the client's request. These new media segments encapsulate several recently generated media units, and the client parses these media segments. The media units of the real-time media stream can be recovered, and the real-time transmission of the media stream from the server to the client is realized. This process is shown in FIG. 2.
由于采用了即时生成媒体段的方式,本发明实施例的方法不再需要清单文件,从 而降低传输延时和节省开销。此外,客户端可以自行调整发送请求的频率来控制媒体段的时长,以更好的适应网络带宽的变化。Due to the method of generating media segments on the fly, the method of the embodiment of the present invention no longer requires a manifest file, thereby reducing transmission delay and saving overhead. In addition, the client can adjust the frequency of sending requests to control the length of the media segment to better adapt to changes in network bandwidth.
上述是对实施例1的详细阐述,下面将对实施例2进行详细说明,以下实施例中,将对服务器如何根据媒体段请求来生成媒体段做出说明。The foregoing is a detailed explanation of Embodiment 1, and Embodiment 2 will be described in detail below. In the following embodiments, the server will be described how to generate a media segment according to a media segment request.
进一步地,在本发明的一个实施例中,根据媒体段请求生成媒体段,进一步包括:如果媒体段请求不携带第一类参数,则待传送的目标媒体流为缺省指定的媒体流;如果媒体段请求中不携带第二类参数,则候选媒体单元包括缺省指定的媒体单元,所述缺省指定的媒体单元为所述目标媒体流中所有和最新媒体单元的序号间隔小于第一预设值的媒体单元,或者为所述目标媒体流中所有和最新媒体单元的产生时间间隔小于第二预设值的媒体单元;如果所述的媒体段请求中不携带所述单元排序方式,则将所述候选媒体单元按照缺省指定的单元排序方式来封装成媒体段。Further, in an embodiment of the present invention, generating the media segment according to the media segment request further includes: if the media segment request does not carry the first type of parameters, the target media stream to be transmitted is the media stream specified by default; if If the media segment request does not carry the second type of parameters, the candidate media unit includes the media unit specified by default, and the default designated media unit is the sequence number interval of all and latest media units in the target media stream is less than the first pre A set media unit, or a media unit whose generation time interval of all and latest media units in the target media stream is less than a second preset value; if the media segment request does not carry the unit sorting method, then The candidate media units are encapsulated into media segments according to the order of units specified by default.
以RTP实时流为例,媒体单元为一个RTP包,每个RTP包都携带一个包序号。假定最新产生的RTP包的包序号为1020,第一预设值为20,缺省指定的单元排序方式为序号正向,当服务器收到一个不携带任何参数的媒体段请求时如[req1],服务器可从现有的实时媒体流中选择一个作为目标媒体流,则待发送的候选媒体单元包括目标媒体流中最近产生的20个RTP包(包序号从1001到1020),然后将这20个RTP包按序号的先后顺序封装成媒体段。Taking RTP real-time streaming as an example, the media unit is an RTP packet, and each RTP packet carries a packet sequence number. Assume that the newly generated RTP packet has a packet sequence number of 1020, the first preset value is 20, and the default specified unit sorting method is sequence number forward. When the server receives a media segment request that does not carry any parameters, such as [req1] , The server can select one of the existing real-time media streams as the target media stream, then the candidate media units to be sent include the 20 most recently generated RTP packets in the target media stream (packet sequence numbers from 1001 to 1020), and then the 20 The RTP packets are encapsulated into media segments in sequence.
以TS实时流为例,媒体单元为一个TS片段,每个TS片段都关联了一个产生时间,该产生时间为该TS片段中第一个媒体帧的时间戳。假定最新产生的TS片段的产生时间为33000(单位是微秒),第二预设值为3000,缺省指定的单元排序方式为产生时间正向,当服务器收到一个不携带任何参数的媒体段请求时如[req1],服务器可从现有的实时媒体流中选择一个作为目标媒体流,则待发送的候选媒体单元包括目标媒体流中最近3秒产生的TS片段,即产生时间Tp在范围(30000<Tp<=33000)内的TS片段,然后将这些TS片段按照产生时间的先后顺序封装成媒体段。Taking the TS real-time stream as an example, the media unit is a TS segment, and each TS segment is associated with a generation time, and the generation time is the time stamp of the first media frame in the TS segment. Assume that the generation time of the newly generated TS segment is 33000 (unit is microseconds), the second preset value is 3000, and the default cell sorting method is generation time forward. When the server receives a media that does not carry any parameters When the segment request is [req1], the server can select one of the existing real-time media streams as the target media stream, and the candidate media unit to be sent includes the TS segment generated in the target media stream in the last 3 seconds, that is, the generation time Tp is TS segments within the range (30000 <Tp <= 33000), and then encapsulate these TS segments into media segments in the order of generation time.
采用上述实施方式,每次用户发送的媒体段请求都会返回最近产生的若干个媒体单元。当服务器持续接受到媒体段请求后,会持续将最近产生的媒体单元递送给客户端。With the above embodiment, each media segment request sent by the user will return several media units that have been generated recently. When the server continues to receive the media segment request, it will continue to deliver the recently generated media unit to the client.
实施例3,以下实施例中,将对服务器如何根据第二类参数来确定待传送的候选媒体单元进行说明。 Embodiment 3 In the following embodiments, it will be described how the server determines candidate media units to be transmitted according to the second type of parameters.
进一步地,在本发明的一个实施例中,如果所述的媒体段请求携带至少一个所述 第二类参数,其中,所述每个第二类参数对应着候选媒体单元的至少一个约束条件,则所述待传送的候选媒体单元包括所述目标媒体流中同时满足所述第二类参数对应的全部约束条件的所有媒体单元。Further, in an embodiment of the present invention, if the media segment request carries at least one parameter of the second type, wherein each parameter of the second type corresponds to at least one constraint condition of the candidate media unit, Then, the candidate media unit to be transmitted includes all media units in the target media stream that simultaneously satisfy all the constraint conditions corresponding to the second type parameters.
下面将进一步给出六种第二类参数,以及每种第二类参数对应的约束条件,具体实施时可以根据需要采用其中的一种或多种,也并不限定自行定义其他的第二类参数:The following will further give six types of second-type parameters, and the constraints corresponding to each type of second-type parameters. In specific implementation, one or more of these types of parameters can be used as needed, and it is not limited to define other types of self-defined parameter:
1)起始序号1) Starting serial number
所述起始序号对应的约束条件为:如果所述起始序号有效,则所述候选媒体单元的序号在所述起始序号之后。The constraint condition corresponding to the starting sequence number is: if the starting sequence number is valid, the sequence number of the candidate media unit is after the starting sequence number.
2)最大序偏2) Maximum order deviation
一个媒体单元的序偏是指所述媒体单元与最新媒体单元的序号间隔,所述最大序偏对应的约束条件为:如果所述最大序偏有效,则所述的候选媒体单元的序偏小于或等于所述最大序偏。The sequence deviation of a media unit refers to the interval between the sequence number of the media unit and the latest media unit, and the constraint condition corresponding to the maximum sequence deviation is: if the maximum sequence deviation is valid, the sequence of the candidate media unit is too small Is equal to or equal to the maximum order deviation.
3)起始时间3) Start time
所述起始时间对应的约束条件为:如果所述起始时间有效,则所述候选单元的产生时间在起始时间之后。The constraint condition corresponding to the start time is: if the start time is valid, the generation time of the candidate unit is after the start time.
4)最大时偏4) Maximum time deviation
一个媒体单元的时偏是指所述媒体单元与最新媒体单元的产生时间间隔,所述最大时偏的约束条件为:如果所述最大时偏有效,则所述的候选媒体单元的时偏小于或等于所述最大时偏;The time offset of a media unit refers to the time interval between the generation of the media unit and the latest media unit, and the constraint condition of the maximum time offset is: if the maximum time offset is valid, the time offset of the candidate media unit is small At or equal to the maximum time offset;
5)最小优先级5) Minimum priority
每个媒体单元关联有一个优先级,所述最小优先级对应的约束条件为:如果所述最小优先级有效,则所述候选媒体单元的优先级大于或等于最小优先级;如果媒体段请求携带的其他第二类参数未限定候选媒体单元的范围,则所述候选媒体单元的范围为缺省指定。Each media unit is associated with a priority, and the constraint condition corresponding to the minimum priority is: if the minimum priority is valid, the priority of the candidate media unit is greater than or equal to the minimum priority; if the media segment request carries The other parameters of the second type do not limit the range of the candidate media unit, and the range of the candidate media unit is specified by default.
6)最大优先级6) Maximum priority
每个媒体单元关联有一个优先级,所述最大优先级对应的约束条件为:如果所述最大优先级有效,则所述候选媒体单元的优先级小于或等于最大优先级;如果媒体段请求携带的其他第二类参数未限定候选媒体单元的范围,则所述候选媒体单元的范围为缺省指定。Each media unit is associated with a priority, and the constraint condition corresponding to the maximum priority is: if the maximum priority is valid, the priority of the candidate media unit is less than or equal to the maximum priority; if the media segment request carries The other parameters of the second type do not limit the range of the candidate media unit, and the range of the candidate media unit is specified by default.
上述的第二类参数有效和无效指的是所述参数的值是否在一个指定的范围内。以起始序号为例,该起始序号的值不能超过当前最新媒体单元的序号,另一方面,为保证实时性,起始序号的值不能是早于某个现有媒体单元的序号,在上述范围内的起始 序号即为有效。如果某个第二类参数为无效,则等同于不携带这个第二类参数。当所有第二类参数均无效时,所述的候选媒体单元为所述缺省指定的媒体单元。The validity and invalidity of the second type of parameters mentioned above refers to whether the value of the parameter is within a specified range. Taking the starting serial number as an example, the value of the starting serial number cannot exceed the serial number of the current latest media unit. On the other hand, to ensure real-time performance, the value of the starting serial number cannot be earlier than the serial number of an existing media unit. The starting number within the above range is valid. If a second type parameter is invalid, it is equivalent to not carrying this second type parameter. When all the parameters of the second type are invalid, the candidate media unit is the media unit specified by default.
需要指出的是,在其他的实施方式中,可以定义新的第二类参数,但是,如果在一定的映射规则下,参数A可以映射到参数B,且参数A对应的约束条件可以转换成参数B的约束条件,则称这两个参数为等价参数。等价参数不应看作是多个第二类参数,仍应该看作是同一个参数的不同实施方式。举例来说,可以定义一个第二类参数——最小序号,最小序号对应的约束条件是:如果所述最小序号有效,则所述候选媒体单元的序号应大于或等于最小序号,所述的大于是指该序号在最小序号之后。将该最小序号与起始序号的约束条件进行对比,即可发现,若建立一个映射规则:最小序号=起始序号+1,则起始序号和最小序号对应的约束条件包含的候选媒体单元将完全一样。因此,最小序号和起始序号实际上是等价参数,应看作是同一个第二类参数的不同实施方法,而不应该看作是一个新的第二类参数。It should be pointed out that in other embodiments, a new second type of parameter can be defined, but, if under certain mapping rules, parameter A can be mapped to parameter B, and the constraint conditions corresponding to parameter A can be converted into parameters B's constraint, then these two parameters are called equivalent parameters. Equivalent parameters should not be regarded as multiple second-type parameters, but should still be regarded as different implementations of the same parameter. For example, a second type of parameter can be defined-the minimum sequence number, and the constraint condition corresponding to the minimum sequence number is: if the minimum sequence number is valid, the sequence number of the candidate media unit should be greater than or equal to the minimum sequence number, the large So it means that the serial number is after the minimum serial number. Comparing the constraints of the minimum sequence number and the start sequence number, we can find that if a mapping rule is established: minimum sequence number = start sequence number + 1, then the candidate media units included in the constraints corresponding to the start sequence number and the minimum sequence number will be exactly the same. Therefore, the minimum sequence number and the starting sequence number are actually equivalent parameters, which should be regarded as different implementation methods of the same second type parameter, and should not be regarded as a new second type parameter.
下述实施过程以RTP实时流为例,媒体单元为一个RTP包,每个RTP包都携带一个包序号,用来指示RTP包产生的先后顺序。假定最新产生的RTP包的包序号为1020,服务器接收到如下媒体段请求时:The following implementation process takes the RTP real-time stream as an example. The media unit is an RTP packet, and each RTP packet carries a packet sequence number, which is used to indicate the order in which the RTP packets are generated. Assuming that the packet sequence number of the newly generated RTP packet is 1020, when the server receives the following media segment request:
1)GET“http://www.xxx-server.com/msreq?seqBegin=1005”[req3]1) GET "http://www.xxx-server.com/msreq?seqBegin = 1005" [req3]
该请求只携带了一个第二类参数:起始序号,满足该起始序号对应的约束条件的RTP有15个(包序号从1006到1020),则待发送的候选媒体单元包括这15个RTP包;The request only carries a second type of parameter: the start sequence number, there are 15 RTPs that satisfy the constraint conditions corresponding to the start sequence number (packet sequence numbers from 1006 to 1020), then the candidate media units to be sent include these 15 RTPs package;
2)GET“http://www.xxx-server.com/msreq?maxSeqOffset=10”[req5]2) GET "http://www.xxx-server.com/msreq?maxSeqOffset=10" [req5]
该请求只携带一个第二类参数:最大序偏,满足该最大序偏对应的约束条件的RTP包有11个(包序号从1010到1020,其中,包序号为1010的RTP包的序偏为10,包序号为1020的RTP包的序偏为0),则待发送的候选媒体单元包括11个RTP包(包序号从1010到1020);The request only carries one parameter of the second type: maximum sequence bias, there are 11 RTP packets that satisfy the constraints corresponding to the maximum sequence bias (packet sequence numbers from 1010 to 1020, where the sequence bias of the RTP packet with the packet sequence number 1010 is 10, the sequence bias of the RTP packet whose packet sequence number is 1020 is 0), then the candidate media unit to be sent includes 11 RTP packets (the packet sequence number is from 1010 to 1020);
3)GET“http://www.xxx-server.com/msreq?seqBegin=1010&3) GET "http://www.xxx-server.com/msreq?seqBegin = 1010 &
maxSeqOffset=5”[req10]maxSeqOffset = 5 ”[req10]
该请求携带了两个第二类参数:起始序号和最大序偏,所述的候选单元需要满足两个约束条件,第一个约束条件是候选媒体单元的序号应大于1010,满足该约束条件的候选媒体单元共有10个(包序号从1011到1020),第二个条件是候选媒体单元的序偏不超过5,满足该约束条件的候选媒体单元共有6个RTP包(包序号从1015到1020)。因此,同时满足上述两个约束条件的候选媒体单元包括6个RTP包(包序号 从1015到1020)。The request carries two parameters of the second type: the starting sequence number and the maximum sequence offset. The candidate unit needs to meet two constraints. The first constraint is that the sequence number of the candidate media unit should be greater than 1010, which satisfies the constraint There are 10 candidate media units (packet numbers from 1011 to 1020). The second condition is that the sequence bias of the candidate media units does not exceed 5. The candidate media units satisfying this constraint condition have 6 RTP packets (packet numbers from 1015 to 1020). Therefore, the candidate media unit that simultaneously satisfies the above two constraints includes 6 RTP packets (packet numbers from 1015 to 1020).
下述实施过程以TS实时流为例,媒体单元为一个TS片段,每个TS片段都关联了一个产生时间,该产生时间为该TS片段中第一个媒体帧的时间戳。假定最新产生的TS片段的产生时间为33000(单位是微秒),服务器接收到如下媒体段请求时:The following implementation process takes a TS real-time stream as an example. The media unit is a TS segment, and each TS segment is associated with a generation time, and the generation time is a time stamp of the first media frame in the TS segment. Assuming that the generation time of the newly generated TS segment is 33000 (in microseconds), when the server receives the following media segment request:
1)GET“http://www.xxx-server.com/msreq?timeBegin=31000”[req4]1) GET "http://www.xxx-server.com/msreq?timeBegin=31000"[req4]
该请求只携带了一个第二类参数:起始时间,该起始序号对应的约束条件是TS片段的产生时间应在所述起始时间之后,则候选媒体单元包括产生时间Tp在范围(31000<Tp<=33000)内的所有TS片段;The request only carries a second type of parameter: the start time, the constraint condition corresponding to the start sequence number is that the generation time of the TS segment should be after the start time, then the candidate media unit includes the generation time Tp in the range (31000 <Tp <= 33000) all TS fragments;
2)GET“http://www.xxx-server.com/msreq?2) GET "http://www.xxx-server.com/msreq?
maxTimeOffset=2000”[req6]maxTimeOffset = 2000 "[req6]
该请求只携带了一个第二类参数:最大时偏。满足最大时偏的约束条件为:候选媒体单元与最新媒体单元的产生时间间隔小于或等于2000,即候选媒体单元包括产生时间Tp范围(31000<=Tp<=33000)内的所有TS片段;The request only carries a second type of parameter: maximum time offset. The constraint condition that satisfies the maximum time deviation is: the generation time interval between the candidate media unit and the latest media unit is less than or equal to 2000, that is, the candidate media unit includes all TS segments within the generation time Tp range (31000 <= Tp <= 33000);
3)GET“http://www.xxx-server.com/msreq?timeBegin=31000&3) GET "http://www.xxx-server.com/msreq?timeBegin=31000&
maxTimeOffset=3000”[req11]maxTimeOffset = 3000 ”[req11]
该请求携带了两个第二类参数:起始时间和最大时偏。其中,起始时间对应的约束条件是TS片段的产生时间应大于31000,则候选媒体单元包括产生时间Tp在范围(31000<Tp<=33000)内的所有TS片段;最大时偏对应的约束条件是候选媒体单元与最新媒体单元的产生时间间隔小于或等于3000,满足该约束条件的候选媒体单元包括产生时间Tp在范围(30000<=Tp<=33000)内的所有TS片段,因此,最终同时满足上述两个约束条件的待发送的候选媒体单元即是产生时间Tp在范围(31000<Tp<=33000)内的所有TS片段。The request carries two parameters of the second type: start time and maximum time offset. The constraint condition corresponding to the start time is that the generation time of the TS segment should be greater than 31000, then the candidate media unit includes all TS segments whose generation time Tp is within the range (31000 <Tp <= 33000); the constraint condition corresponding to the maximum time offset Is that the generation time interval between the candidate media unit and the latest media unit is less than or equal to 3000, and the candidate media unit that satisfies the constraint includes all TS segments whose generation time Tp is within the range (30000 <= Tp <= 33000), so the The candidate media units to be transmitted that satisfy the above two constraints are all TS segments with a generation time Tp in the range (31000 <Tp <= 33000).
下述实施过程以带优先级的RTP流为例,媒体单元为一个RTP包,每个RTP包都携带一个包序号,并且根据RTP包携带的净荷内容关联了一个优先级。每个媒体单元的优先级可以根据具体情况来定义,例如,当RTP包为一个多媒体数据流时,可以将RTP包分为三个优先级:The following implementation process takes the RTP stream with priority as an example, the media unit is an RTP packet, each RTP packet carries a packet sequence number, and a priority is associated according to the payload content carried by the RTP packet. The priority of each media unit can be defined according to specific circumstances. For example, when the RTP packet is a multimedia data stream, the RTP packet can be divided into three priorities:
优先级3:RTP包中封装的是音频信息;Priority 3: The audio information encapsulated in the RTP packet;
优先级2:RTP包中封装的是关键视频信息;Priority 2: The key video information is encapsulated in the RTP package;
优先级1:RTP包中封装的是非关键视频信息;Priority 1: The non-critical video information encapsulated in the RTP packet;
假定最新产生的RTP包的包序号为1020,从包序号为1000的RTP包开始,每个 RTP包关联的优先级如表1所示。其中,表1为每个RTP包关联的优先级表。Assume that the packet sequence number of the newly generated RTP packet is 1020. Starting from the RTP packet with the packet sequence number 1000, the associated priority of each RTP packet is shown in Table 1. Among them, Table 1 is a priority table associated with each RTP packet.
表1Table 1
包序号Package number 产生时间Generation time 优先级priority 包序号Package number 产生时间Generation time 优先级priority
10001000 2950029500 33 10111011 3200032000 22
10011001 3100031000 11 10121012 3200032000 33
10021002 3100031000 22 10131013 3250032500 11
10031003 3100031000 22 10141014 3250032500 22
10041004 3100031000 33 10151015 3250032500 22
10051005 3150031500 11 10161016 3250032500 33
10061006 3150031500 22 10171017 3300033000 11
10071007 3150031500 22 10181018 3300033000 22
10081008 3150031500 33 10191019 3300033000 22
10091009 3200032000 11 10201020 3300033000 33
10101010 3200032000 22  A  A  A
服务器接收到如下媒体段请求时:When the server receives the following media segment request:
1)GET“http://www.xxx-server.com/msreq?minPriority=3”[req7]1) GET "http://www.xxx-server.com/msreq?minPriority=3" [req7]
该请求只携带一个第二类参数:最小优先级,由于没有其他第二类参数来限定媒体单元的范围,因此,候选媒体单元首先需要满足的约束条件是其序号在一个缺省指定的范围内。这里,设第一预设值为20,则缺省指定的序号范围是:从1001到1020的20个RTP包;同时,候选媒体单元还需满足的约束条件是其优先级大于或等于最小优先级,因此,最终同时满足上述约束条件的RTP包有5个(包序号分别为1004,1008,1012,1016和1020)。The request only carries a second type parameter: minimum priority. Since there is no other second type parameter to limit the scope of the media unit, the constraint condition that the candidate media unit needs to satisfy first is that its serial number is within a range specified by default . Here, if the first preset value is 20, the serial number range specified by default is: 20 RTP packets from 1001 to 1020; at the same time, the constraint condition that the candidate media unit needs to meet is that its priority is greater than or equal to the minimum priority Therefore, there are 5 RTP packets that satisfy the above constraints at the same time (packet sequence numbers are 1004, 1008, 1012, 1016, and 1020, respectively).
2)GET“http://www.xxx-server.com/msreq?maxPriority=1”[req8]2) GET "http://www.xxx-server.com/msreq?maxPriority=1" [req8]
该请求只携带一个第二类参数:最大优先级,由于没有其他第二类参数来限定媒体单元的范围,因此,候选媒体单元首先需要满足的约束条件是其序号在一个缺省指定的范围内。这里,设第一预设值为20,则缺省指定的序号范围是:从1001到1020的20个RTP包;同时,候选媒体单元还需满足的约束条件是其优先级小于或等于最大优先级,因此,最终同时满足上述约束条件的RTP包有5个(包序号分别为1001,1005,1009,1013和1017)。The request only carries a second type parameter: maximum priority. Since there is no other second type parameter to limit the scope of the media unit, the first constraint that the candidate media unit needs to satisfy is that its serial number is within a range specified by default . Here, if the first preset value is 20, then the default designated serial number range is: 20 RTP packets from 1001 to 1020; at the same time, the constraint condition that the candidate media unit needs to meet is that its priority is less than or equal to the maximum priority Therefore, there are 5 RTP packets that satisfy the above constraints at the same time (packet numbers are 1001, 1005, 1009, 1013, and 1017, respectively).
该实施例中,客户端可以通过连续提交媒体段请求,并通过携带的第二类参数如 起始序号或起始时间,即可获得最近产生的媒体单元,实现媒体流的实时传送。当客户端判断网络无法及时传送完所有媒体单元时,可以在媒体段请求中携带第二类参数——最大序偏和最大时偏,服务器将仅传送最新产生的若干媒体单元,丢弃产生较早而没有得到及时传送的媒体单元,以实现客户端对最新媒体内容的优先传送。此外,当客户端判断网络无法及时传送完所有媒体单元时,还可以在媒体段请求中携带第二类参数--最小优先级,服务器将仅传送优先级高于最小优先级的媒体单元,以实现客户端对高优先级媒体单元的优先传送。In this embodiment, the client can obtain the most recently generated media unit by continuously submitting the media segment request and carrying the second type parameters such as the start sequence number or the start time to realize the real-time transmission of the media stream. When the client determines that the network cannot transmit all the media units in time, it can carry the second type of parameters in the media segment request-the maximum sequence offset and the maximum time offset. The server will only transmit the most recently generated media units, discarding the earlier generation The media unit that has not been delivered in time is implemented so as to realize the preferential delivery of the latest media content by the client. In addition, when the client judges that the network cannot transmit all the media units in time, it can also carry the second type of parameters in the media segment request-the minimum priority, and the server will only transmit media units with a priority higher than the minimum priority. Realize the priority transmission of high-priority media units by the client.
实施例4,在以下实施例中,将对服务器在生成媒体段时如何根据单元排序方式来对候选媒体单元排序并封装成媒体段进行说明。Embodiment 4 In the following embodiments, it will be described how the server sorts the candidate media units according to the unit sorting method and encapsulates them into media segments when generating media segments.
进一步地,在本发明的一个实施例中,所述的单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向。当媒体单元关联有一个优先级时,基本排序方式还包括高优先级优先和低优先级优先两种。Further, in an embodiment of the present invention, the unit sorting method is one of the following basic sorting methods: sequence number forward, sequence number reverse, generation time forward, and generation time reverse. When a priority is associated with a media unit, the basic sorting method also includes two types: high priority priority and low priority priority.
可以理解的是,当单元排序方式为序号正向时,候选媒体单元按照序号指示的先后顺序封装到所述媒体段中,即序号越前的媒体单元在媒体段中的位置越靠前;单元排序方式为序号反向时,序号越后的媒体单元在媒体段中的位置越靠前;单元排序方式为产生时间正向时,产生时间越早的媒体单元在媒体段中的位置越靠前;单元排序方式为产生时间反向时,产生时间越晚的媒体单元在媒体段中的位置越靠前;单元排序方式为高优先级优先时,高优先级媒体单元排在低优先级媒体单元前面;单元排序方式为低优先级优先时,低优先级媒体单元排在高优先级媒体单元前面。It can be understood that, when the unit sorting mode is the sequence number forward, the candidate media units are encapsulated into the media segment according to the sequence indicated by the sequence number, that is, the media unit with the earlier serial number is located in the media segment in the front; the unit is sorted When the serial number is reversed, the media unit with the later serial number is positioned higher in the media segment; when the unit sorting method is positive generation time, the media unit with the earlier generation time is positioned higher in the media segment; When the unit sorting method is reversed in generation time, the later the generation time, the higher the position of the media unit in the media segment; when the unit sorting method is high priority, the high priority media unit is ranked in front of the low priority media unit. ; When the unit sorting method is low priority first, the low priority media unit is ranked in front of the high priority media unit.
对于某些媒体流来说,存在以下情况,多个序号连续的媒体单元的产生时间甚至优先级都可能相同。因此,如果只采用一种基本排序方式(如产生时间反向或高优先级优先)时,仍然存在排序位置相同的多个媒体单元,对于这些媒体单元来说,可以选择一个缺省的基本排序方式(比如序号正向)再排序。另一种实施方法时,单元排序方式可以是多个基本排序方式的级联:第一基本排序方式+第二基本排序方式+第三基本排序方式等等。此时,所述的将候选媒体单元按单元排序方式指定的顺序排序包括:首先将所述的候选媒体单元按照第一基本排序方式排序,然后将排序后位置相同的候选媒体单元按照第二基本排序方式排序,依此类推。如果按照指定的多个基本排序方式排序后,还存在位置相同的媒体单元,则将这些媒体单元按照一个缺省的基本排序方式(序号正向)排序。For some media streams, there are cases where the generation time and even priority of multiple media units with consecutive serial numbers may be the same. Therefore, if only one basic sorting method is used (such as reverse time or high priority), there are still multiple media units with the same sorting position. For these media units, a default basic sorting can be selected. The method (such as the serial number is positive) and then sort. In another implementation method, the unit sorting method may be a cascade of multiple basic sorting methods: first basic sorting method + second basic sorting method + third basic sorting method, and so on. At this time, the sorting of the candidate media units in the order specified by the unit sorting method includes: first sorting the candidate media units according to the first basic sorting method, and then sorting the candidate media units with the same position after sorting according to the second basic Sort by sorting, and so on. If there are still media units in the same position after sorting according to the specified multiple basic sorting methods, the media units are sorted according to a default basic sorting method (sequence number forward).
下述实施过程以带优先级的RTP流为例,媒体单元为一个RTP包,每个RTP包都携带一个包序号,并且根据RTP包携带的净荷内容关联了一个优先级。每个媒体单 元的优先级可以根据具体情况来定义,例如,当RTP包为一个多媒体数据流时,可以将RTP包分为三个优先级:优先级1、优先级2和优先级3。假定最新产生的RTP包的包序号为1020,从包序号为1000的RTP包开始,每个RTP包关联的优先级如表1所示。服务器接收到如下媒体段请求时:The following implementation process takes the RTP stream with priority as an example, the media unit is an RTP packet, each RTP packet carries a packet sequence number, and a priority is associated according to the payload content carried by the RTP packet. The priority of each media unit can be defined according to the specific situation. For example, when the RTP packet is a multimedia data stream, the RTP packet can be divided into three priorities: priority 1, priority 2, and priority 3. Assuming that the packet sequence number of the newly generated RTP packet is 1020, starting from the RTP packet with the packet sequence number 1000, the associated priority of each RTP packet is shown in Table 1. When the server receives the following media segment request:
1)GET“http://www.xxx-server.com/msreq?1) GET "http://www.xxx-server.com/msreq?
unitSortMode=SEQ_BACKWARD”[req9]unitSortMode = SEQ_BACKWARD ”[req9]
该请求中不携带第一类参数和第二类参数,因此,所述的目的媒体流为缺省指定的媒体流;所述的候选媒体单元为缺省指定的媒体单元,设第一预设值为20,则缺省指定的媒体单元包括目标媒体流中最近产生的20个RTP包(包序号从1001到1020)。该请求中携带的单元排序方式为序号反向,因此,将这20个RTP包封装到媒体段时,序号越后的媒体单元在媒体段中的位置越靠前,即候选媒体单元封装到媒体段中的顺序如图3所示。The request does not carry parameters of the first type and parameters of the second type. Therefore, the target media stream is a media stream designated by default; the candidate media unit is a media unit designated by default, and a first preset is set If the value is 20, the media unit specified by default includes the 20 most recently generated RTP packets in the target media stream (packet sequence numbers from 1001 to 1020). The ordering of the units carried in this request is the reverse sequence number. Therefore, when the 20 RTP packets are encapsulated into the media segment, the media unit with the later sequence number is positioned higher in the media segment, that is, the candidate media unit is encapsulated into the media The sequence in the segment is shown in Figure 3.
2)GET“http://www.xxx-server.com/msreq?timeBegin=31000&2) GET "http://www.xxx-server.com/msreq?timeBegin=31000&
unitSortMode=TIME_BACKWARD”[req13]unitSortMode = TIME_BACKWARD ”[req13]
该请求中携带了一个第二类参数:起始时间,因此,所述的候选媒体单元需要满足的约束条件是:RTP包的产生时间在起始时间之后。满足上述约束条件的RTP包共有16个(包序号从1005到1020)。该请求中携带的单元排序方式为时间反向,因此,产生时间越晚(即最新产生)的RTP包在媒体段中的位置越靠前,另外,对于产生时间相同的RTP包,默认的缺省排序方式为序号正向,最终候选媒体单元封装到媒体段中的顺序如图4所示。The request carries a second type of parameter: the start time. Therefore, the constraint condition that the candidate media unit needs to meet is that the generation time of the RTP packet is after the start time. There are 16 RTP packets that satisfy the above constraints (packet sequence numbers from 1005 to 1020). The ordering of the units carried in the request is reversed in time. Therefore, the later the generation time (ie, the latest generation) of the RTP packet is in the media segment, the more advanced, in addition, for RTP packets with the same generation time, the default is The province sorting method is that the sequence number is positive, and the order in which the final candidate media units are packed into the media segment is shown in FIG. 4.
3)GET“http://www.xxx-server.com/msreq?maxTimeOffset=2000&3) GET "http://www.xxx-server.com/msreq?maxTimeOffset=2000&
unitSortMode=HIGH_PRIORITY_FIRST+TIME_BACKWARD”[req15]unitSortMode = HIGH_PRIORITY_FIRST + TIME_BACKWARD "[req15]
该请求中携带了一个第二类参数,最大时偏,因此,所述的候选媒体单元需要满足的约束条件是:RTP包的时偏应小于或等于最大时偏。由于最新媒体单元的产生时间为33000,最大时偏为2000,因此,候选媒体单元的产生时间范围应该为产生时间Tp在范围(31000<=Tp<=33000)内的所有RTP包。该请求中携带的单元排序方式为两个基本排序方式的级联:其中第一基本排序方式为高优先级优先,第二基本排序方式为时间反向,因此,首先按照高优先级优先来对候选单元进行排序,然后,对排序后位置相同的候选单元按照时间反向的方式来排序,最后,如果还有位置相同的候选单元,则按照缺省的序号正向来排序,最终候选媒体单元封装到媒体段中的顺序如图5所示。The request carries a second type of parameter, the maximum time offset. Therefore, the constraint condition that the candidate media unit needs to meet is that the time offset of the RTP packet should be less than or equal to the maximum time offset. Since the generation time of the latest media unit is 33000 and the maximum time offset is 2000, the generation time range of the candidate media unit should be all RTP packets whose generation time Tp is within the range (31000 <= Tp <= 33000). The unit sorting method carried in the request is a concatenation of two basic sorting modes: the first basic sorting mode is high priority first, and the second basic sorting mode is time reversal, therefore, the priority is Candidate units are sorted. Then, the candidate units with the same position after sorting are sorted in reverse time. Finally, if there are candidate units with the same position, they are sorted according to the default sequence number. The final candidate media unit is packaged. The sequence into the media segment is shown in Figure 5.
当网络传送条件较差时,可以通过将请求中的单元排序方式设为序号反向或产生 时间反向,这样,可以将最新产生的媒体单元先递送给客户端,保证对最新媒体单元的优先传送。另一方面,还可以通过将单元排序方式设为高优先级优先,将高优先级的媒体单元封装在媒体段的前面,保证客户端对高优先级的媒体单元的优先递送。When the network transmission conditions are poor, you can set the unit sorting method in the request to reverse the serial number or reverse the generation time, so that the newly generated media unit can be delivered to the client first, ensuring priority for the latest media unit Send. On the other hand, it is also possible to encapsulate the high-priority media unit in front of the media segment by setting the unit sorting mode to high-priority priority to ensure the client's priority delivery of the high-priority media unit.
根据本发明实施例提出的媒体流的实时递送方法,根据客户端的请求来实时生成媒体段,并返回给客户端,以实现按客户端需求分段的实时媒体流递送,媒体分段的时长将自动适应网络传输带宽的变化,客户端可以通过主动请求来控制媒体分段的时长,当客户端与服务器之间的传输带宽充足且延时较小时,客户端可以更快速的提出请求,从而得到时长更短的媒体段,降低实时传输延时;当客户端与服务器之间的传输带宽不足且延时较大时,客户端可以延长提交请求的间隔,从而得到更长的媒体段,减少请求次数以降低传输开销;由于每个媒体段是由客户端的请求触发产生的,不再需要清单文件,客户端也不需要请求和解析清单文件,一方面客户端可以更快速的获得最新的媒体流,减少了实时媒体流的传输延时,另一方面,也降低了清单文件带来的传输开销和处理开销,最后,客户端还可以通过请求来控制媒体段中媒体单元的产生时间及排列顺序,在网络传输条件较差时尽可能保证及时发送最新产生的媒体单元或优先级较高的媒体单元,从而有效降低媒体流传输延时和开销,并支持对最新媒体单元和高优先级媒体单元的优先传送。According to the real-time delivery method of the media stream provided by the embodiment of the present invention, the media segment is generated in real time according to the request of the client and returned to the client, so as to realize the real-time media stream delivery segmented according to the client's needs. The duration of the media segment will be Automatically adapt to changes in network transmission bandwidth, the client can control the length of the media segmentation through active requests. When the transmission bandwidth between the client and the server is sufficient and the delay is small, the client can make a request more quickly, thereby obtaining Shorter media segments reduce real-time transmission delay; when the transmission bandwidth between the client and the server is insufficient and the delay is large, the client can extend the interval for submitting requests, thereby obtaining a longer media segment and reducing requests Times to reduce the transmission overhead; because each media segment is triggered by the request of the client, the manifest file is no longer needed, and the client does not need to request and parse the manifest file. On the one hand, the client can get the latest media stream more quickly , Reducing the transmission delay of real-time media streams, on the other hand, it also reduces the transmission overhead and processing overhead caused by the manifest file. Finally, the client can also control the generation time and arrangement order of the media units in the media segment by request , When the network transmission conditions are poor, ensure that the newly generated media unit or the media unit with higher priority is sent in time as much as possible, thereby effectively reducing the media stream transmission delay and overhead, and supporting the latest media unit and high priority media unit Priority transmission.
其次参照附图描述根据本发明实施例提出的媒体流的实时递送服务器。Next, a real-time delivery server for media streams according to an embodiment of the present invention will be described with reference to the drawings.
图6是本发明实施例的媒体流的实时递送服务器的结构示意图。6 is a schematic structural diagram of a media stream real-time delivery server according to an embodiment of the present invention.
如图6所示,该媒体流的实时递送服务器10包括:客户端接口组件100和媒体段生成组件200。As shown in FIG. 6, the real-time delivery server 10 of the media stream includes: a client interface component 100 and a media segment generation component 200.
其中,客户端接口组件100用于接收客户端发送的媒体段请求并返回相应的媒体段,其中,媒体段请求不携带或携带至少一个控制参数,且控制参数包括指示待传送的目标媒体流的第一类参数、指示待传送的候选媒体单元的第二类参数和单元排序方式。媒体段生成组件200根据媒体段请求生成媒体段,其中,根据第一类参数确定待传送的目标媒体流,根据第二类参数确定待传送的候选媒体单元,并将待传送的候选媒体单元按单元排序方式指定的顺序排序并封装成媒体段,并通过客户端接口组件100发送媒体段至客户端。本发明实施例的服务器10可以根据客户端的请求来实时生成媒体段,并返回给客户端,以实现按客户端需求分段的实时媒体流递送,从而有效降低媒体流传输延时和开销,并支持对最新媒体单元和高优先级媒体单元的优先传送。The client interface component 100 is used to receive the media segment request sent by the client and return the corresponding media segment, where the media segment request does not carry or carries at least one control parameter, and the control parameter includes a target media stream to be transmitted. The first type of parameter, the second type of parameter indicating the candidate media unit to be transmitted and the unit sorting manner. The media segment generation component 200 generates a media segment according to the media segment request, wherein the target media stream to be transmitted is determined according to the first type of parameter, the candidate media unit to be transmitted is determined according to the second type of parameter, and the candidate media unit to be transmitted is The order specified by the unit sorting method is sorted and packaged into media segments, and the media segments are sent to the client through the client interface component 100. The server 10 according to the embodiment of the present invention can generate media segments in real time according to the request of the client and return them to the client, so as to realize real-time media stream delivery segmented according to the needs of the client, thereby effectively reducing the media stream transmission delay and overhead, and Support the priority transmission of the latest media unit and high priority media unit.
具体而言,客户端接口组件100用于接收客户端的媒体段请求,以及将生成的媒体段发送给客户端;媒体段请求可以携带0个、1个或多个控制参数;控制参数包括以下类别:第一类参数、第二类参数和单元排序方式;第一类参数用于指示待传送的目 标媒体流;第二类参数用于指示待传送的候选媒体单元。客户端接口组件可以采用任何指定的协议来接收媒体段请求,例如,当采用HTTP协议时,客户端接口组件可以是一个Web服务器,可以接收任何采用http协议的媒体段请求并且通过HTTP响应来返回媒体段;当采用TCP协议时,客户端接口组件是一个TCP服务器,并提供一个固定的服务端口。Specifically, the client interface component 100 is used to receive the client's media segment request and send the generated media segment to the client; the media segment request can carry 0, 1 or more control parameters; the control parameters include the following categories : First-type parameters, second-type parameters, and unit sorting method; first-type parameters are used to indicate the target media stream to be transmitted; second-type parameters are used to indicate the candidate media unit to be transmitted. The client interface component can use any specified protocol to receive media segment requests. For example, when the HTTP protocol is used, the client interface component can be a Web server that can receive any media segment request using the http protocol and return it through an HTTP response. Media segment; when the TCP protocol is used, the client interface component is a TCP server and provides a fixed service port.
媒体段生成组件200用于根据客户端的媒体段请求来生成所需的媒体段。从客户端接口组件获取媒体段请求及其控制参数,根据第一类参数来确定待传送的目标媒体流,根据第二类参数来确定待传送的候选媒体单元,从媒体流存储单元中提取出待传送的候选媒体单元,将其按照单元排序方式指定的顺序封装成媒体段,然后直接交由客户端接口组件来发送。The media segment generation component 200 is used to generate the required media segment according to the client's media segment request. Obtain the media segment request and its control parameters from the client interface component, determine the target media stream to be transmitted according to the first type of parameters, determine the candidate media unit to be transmitted according to the second type of parameters, and extract it from the media stream storage unit The candidate media units to be transmitted are encapsulated into media segments in the order specified by the unit sorting method, and then directly sent to the client interface component for sending.
进一步地,在本发明的一个实施例中,媒体段生成组件200进一步用于在媒体段请求不携带第一类参数时,待传送的目标媒体流为缺省指定的媒体流,且在媒体段请求中不携带第二类参数时,候选媒体单元包括缺省指定的媒体单元,缺省指定的媒体单元为目标媒体流中所有和最新媒体单元的序号间隔小于第一预设值的媒体单元,或者为目标媒体流中所有和最新媒体单元的产生时间间隔小于第二预设值的媒体单元,以及在媒体段请求中不携带单元排序方式时,将候选媒体单元按照缺省指定的单元排序方式来封装成媒体段。Further, in an embodiment of the present invention, the media segment generation component 200 is further configured to: when the media segment request does not carry the first type of parameters, the target media stream to be transmitted is the media stream specified by default, and in the media segment When the request does not carry the second type of parameters, the candidate media unit includes a media unit designated by default, and the media unit designated by default is a media unit in which the sequence number interval of all and latest media units in the target media stream is less than the first preset value, Or for all media units in the target media stream whose generation time interval is less than the second preset value, and when the media segment request does not carry the unit sorting mode, the candidate media units are sorted according to the default specified unit sorting mode To encapsulate into media segments.
进一步地,在本发明的一个实施例中,媒体段生成组件200进一步用于在媒体段请求携带至少一个第二类参数,其中,每个第二类参数对应着候选媒体单元的至少一个约束条件时,待传送的候选媒体单元包括目标媒体流中同时满足第二类参数对应的全部约束条件的所有媒体单元。Further, in an embodiment of the present invention, the media segment generation component 200 is further configured to carry at least one second type parameter in the media segment request, where each second type parameter corresponds to at least one constraint condition of the candidate media unit At this time, the candidate media units to be transmitted include all media units in the target media stream that simultaneously satisfy all the constraint conditions corresponding to the parameters of the second type.
进一步地,在本发明的一个实施例中,每个媒体单元关联有一个序偏,序偏是指媒体单元与最新媒体单元的序号间隔,第二类参数包括起始序号和/或最大序偏,其中,起始序号对应的约束条件为:如果起始序号有效,则候选媒体单元的序号在起始序号之后;最大序偏对应的约束条件为:如果最大序偏有效,则候选媒体单元的序偏小于或等于最大序偏。Further, in an embodiment of the present invention, each media unit is associated with a sequence offset. The sequence offset refers to the interval between the sequence number of the media unit and the latest media unit. The second type of parameters includes the starting sequence number and / or the maximum sequence offset. , Where the constraint condition corresponding to the starting sequence number is: if the starting sequence number is valid, the sequence number of the candidate media unit is after the starting sequence number; the constraint condition corresponding to the maximum sequence deviation is: if the maximum sequence deviation is valid, the candidate media unit's The order deviation is less than or equal to the maximum order deviation.
进一步地,在本发明的一个实施例中,每个媒体单元关联有一个时偏,时偏是指媒体单元与最新媒体单元的产生时间间隔,第二类参数包括起始时间和/或最大时偏,其中,起始时间对应的约束条件为:如果起始时间有效,则候选媒体单元的产生时间在起始时间之后;最大时偏对应的约束条件为:如果最大时偏有效,则候选媒体单元的时偏小于或等于最大时偏。Further, in an embodiment of the present invention, each media unit is associated with a time offset. Time offset refers to the time interval between the generation of the media unit and the latest media unit. The second type of parameters includes the start time and / or the maximum time. Where the constraint condition corresponding to the start time is: if the start time is valid, the generation time of the candidate media unit is after the start time; the constraint condition corresponding to the maximum time offset is: if the maximum time offset is valid, the candidate media The time offset of the unit is less than or equal to the maximum time offset.
进一步地,在本发明的一个实施例中,每个媒体单元关联有一个优先级,第二类参数包括最小优先级,最小优先级对应的约束条件包括:如果最小优先级有效,则候选媒体单元的优先级大于或等于最小优先级;如果媒体段请求携带的其他第二类参数未限定候选媒 体单元的范围,则候选媒体单元的范围为缺省指定。Further, in an embodiment of the present invention, each media unit is associated with a priority. The second type of parameter includes a minimum priority, and the constraint conditions corresponding to the minimum priority include: if the minimum priority is valid, the candidate media unit The priority of is greater than or equal to the minimum priority; if the other second-type parameters carried in the media segment request do not define the range of candidate media units, the range of candidate media units is specified by default.
可选地,在本发明的一个实施例中,单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向。Optionally, in an embodiment of the present invention, the unit sorting mode is one of the following basic sorting modes: serial number forward, serial number reverse, generation time forward, and generation time reverse.
可选地,在本发明的一个实施例中,每个媒体单元关联有一个优先级,单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向、高优先级优先、低优先级优先。Optionally, in an embodiment of the present invention, each media unit is associated with a priority, and the unit sorting mode is one of the following basic sorting modes: sequence number forward, sequence number reverse, generation time forward, and generation time reverse Direction, high priority first, low priority first.
可选地,在本发明的一个实施例中,单元排序方式为多个基本排序方式的级联,将候选媒体单元按单元排序方式指定的顺序排序包括:将候选媒体单元按照第一基本排序方式排序,且将排序后位置相同的候选媒体单元按照第二基本排序方式排序,依此类推直至完成排序。Optionally, in an embodiment of the present invention, the unit sorting mode is a cascade of multiple basic sorting modes, and sorting the candidate media units in the order specified by the unit sorting mode includes: sorting the candidate media units according to the first basic sorting mode Sort, and sort the candidate media units in the same position after sorting according to the second basic sorting manner, and so on until sorting is completed.
需要说明的是,前述对媒体流的媒体流的实时递送方法实施例的解释说明也适用于该实施例的媒体流的实时递送服务器,此处不再赘述。It should be noted that the foregoing explanation of the embodiment of the method for real-time delivery of media streams of media streams is also applicable to the real-time delivery server for media streams of this embodiment, and details are not described herein.
根据本发明实施例提出的媒体流的实时递送服务器,根据客户端的请求来实时生成媒体段,并返回给客户端,以实现按客户端需求分段的实时媒体流递送,媒体分段的时长将自动适应网络传输带宽的变化,客户端可以通过主动请求来控制媒体分段的时长,当客户端与服务器之间的传输带宽充足且延时较小时,客户端可以更快速的提出请求,从而得到时长更短的媒体段,降低实时传输延时;当客户端与服务器之间的传输带宽不足且延时较大时,客户端可以延长提交请求的间隔,从而得到更长的媒体段,减少请求次数以降低传输开销;由于每个媒体段是由客户端的请求触发产生的,不再需要清单文件,客户端也不需要请求和解析清单文件,一方面客户端可以更快速的获得最新的媒体流,减少了实时媒体流的传输延时,另一方面,也降低了清单文件带来的传输开销和处理开销,最后,客户端还可以通过请求来控制媒体段中媒体单元的产生时间及排列顺序,在网络传输条件较差时尽可能保证及时发送最新产生的媒体单元或优先级较高的媒体单元,从而有效降低媒体流传输延时和开销,并支持对最新媒体单元和高优先级媒体单元的优先传送。According to the real-time delivery server of the media stream provided by the embodiment of the present invention, the media segment is generated in real time according to the request of the client and returned to the client, so as to realize the real-time media stream delivery according to the client's needs. The length of the media segment will be Automatically adapt to changes in network transmission bandwidth, the client can control the length of the media segmentation through active requests. When the transmission bandwidth between the client and the server is sufficient and the delay is small, the client can make a request more quickly, thereby obtaining Shorter media segments reduce real-time transmission delay; when the transmission bandwidth between the client and the server is insufficient and the delay is large, the client can extend the interval for submitting requests, thereby obtaining a longer media segment and reducing requests Times to reduce the transmission overhead; because each media segment is triggered by the request of the client, the manifest file is no longer needed, and the client does not need to request and parse the manifest file. On the one hand, the client can get the latest media stream more quickly , Reducing the transmission delay of real-time media streams, on the other hand, it also reduces the transmission overhead and processing overhead caused by the manifest file. Finally, the client can also control the generation time and arrangement order of the media units in the media segment by request , When the network transmission conditions are poor, ensure that the newly generated media unit or the media unit with higher priority is sent in time as much as possible, thereby effectively reducing the media stream transmission delay and overhead, and supporting the latest media unit and high priority media unit Priority transmission.
为了实现上述实施例,本发明实施例还提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时,实现如上述实施例描述的媒体流的实时递送方法。In order to implement the above embodiments, the embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above embodiment is implemented. Describes the real-time delivery method of media streams.
为了实现上述实施例,本发明实施例还提出了一种非临时性计算机可读存储介质,该程序被处理器执行时实现如上述实施例描述的媒体流的实时递送方法。In order to implement the above-mentioned embodiments, an embodiment of the present invention also proposes a non-transitory computer-readable storage medium. When the program is executed by a processor, the method for real-time delivery of media streams as described in the above embodiments is implemented.
为了实现上述实施例,本发明实施例还提出了一种计算机程序产品,当计算机程序产品中的指令由处理器执行时,执行如上述实施例描述的媒体流的实时递送方法。In order to implement the above embodiments, an embodiment of the present invention also proposes a computer program product. When instructions in the computer program product are executed by a processor, a real-time delivery method of media streams as described in the above embodiments is executed.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms “first” and “second” are used for description purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined with "first" and "second" may include at least one of the features either explicitly or implicitly. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless specifically defined otherwise.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the description referring to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means specific features described in conjunction with the embodiment or examples , Structure, material or characteristic is included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. In addition, without contradicting each other, those skilled in the art may combine and combine different embodiments or examples and features of the different embodiments or examples described in this specification.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。Although the embodiments of the present invention have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and cannot be construed as limitations to the present invention, and those of ordinary skill in the art can The embodiments are changed, modified, replaced, and modified.

Claims (21)

  1. 一种媒体流的实时递送方法,其特征在于,所述媒体流为实时产生的媒体单元的序列,其中,每个媒体单元关联有一个产生时间和/或一个指示产生顺序的序号,所述方法包括:A method for real-time delivery of media streams, characterized in that the media stream is a sequence of media units generated in real time, wherein each media unit is associated with a generation time and / or a sequence number indicating the generation order, the method include:
    接收客户端发送的媒体段请求,其中,所述媒体段请求不携带或携带至少一个控制参数,且控制参数包括指示待传送的目标媒体流的第一类参数、指示待传送的候选媒体单元的第二类参数和单元排序方式;Receiving a media segment request sent by a client, where the media segment request does not carry or carries at least one control parameter, and the control parameter includes a first type parameter indicating a target media stream to be transferred, and a candidate media unit indicating to be transferred The second type of parameters and unit sorting method;
    根据所述媒体段请求生成媒体段,其中,根据所述第一类参数确定所述待传送的目标媒体流,根据所述第二类参数确定所述待传送的候选媒体单元,将所述待传送的候选媒体单元按所述单元排序方式指定的顺序排序并封装成所述媒体段;以及Generate a media segment according to the media segment request, wherein the target media stream to be transmitted is determined according to the first-type parameter, the candidate media unit to be transmitted is determined according to the second-type parameter, and the The transmitted candidate media units are sorted and packaged into the media segments in the order specified by the unit sorting manner; and
    发送所述媒体段至所述客户端。Send the media segment to the client.
  2. 根据权利要求1所述的媒体流的实时递送方法,其特征在于,所述根据所述媒体段请求生成媒体段,进一步包括:The real-time delivery method of the media stream according to claim 1, wherein the generating a media segment according to the media segment request further comprises:
    如果所述媒体段请求不携带所述第一类参数,则所述待传送的目标媒体流为缺省指定的媒体流;If the media segment request does not carry the first type of parameters, the target media stream to be transmitted is a media stream specified by default;
    如果所述媒体段请求中不携带所述第二类参数,则所述候选媒体单元包括缺省指定的媒体单元,所述缺省指定的媒体单元为所述目标媒体流中所有和最新媒体单元的序号间隔小于第一预设值的媒体单元,或者为所述目标媒体流中所有和最新媒体单元的产生时间间隔小于第二预设值的媒体单元;If the second segment parameter is not carried in the media segment request, the candidate media unit includes a media unit designated by default, and the media unit designated by default is all and latest media units in the target media stream A media unit whose sequence number interval is less than the first preset value, or a media unit whose generation time interval of all and latest media units in the target media stream is less than the second preset value;
    如果所述媒体段请求中不携带所述单元排序方式,则将所述候选媒体单元按照缺省指定的单元排序方式来封装成所述媒体段。If the media segment request does not carry the unit sorting mode, the candidate media unit is encapsulated into the media segment according to the unit sorting mode specified by default.
  3. 根据权利要求1所述的媒体流的实时递送方法,其特征在于,所述根据媒体段请求生成媒体段,进一步包括:The real-time delivery method of the media stream according to claim 1, wherein the generating the media segment according to the media segment request further comprises:
    如果所述媒体段请求携带至少一个所述第二类参数,其中,所述每个第二类参数对应着候选媒体单元的至少一个约束条件,则所述待传送的候选媒体单元包括所述目标媒体流中同时满足所述第二类参数对应的全部约束条件的所有媒体单元。If the media segment request carries at least one parameter of the second type, wherein each parameter of the second type corresponds to at least one constraint condition of the candidate media unit, the candidate media unit to be transmitted includes the target All media units in the media stream that simultaneously satisfy all the constraint conditions corresponding to the parameters of the second type.
  4. 根据权利要求3所述的媒体流的实时递送方法,其特征在于,所述每个媒体单元关联有一个序偏,所述序偏是指所述媒体单元与最新媒体单元的序号间隔,所述第二类参数包括起始序号和/或最大序偏,其中,The method for real-time delivery of media streams according to claim 3, characterized in that each media unit is associated with a sequence offset, and the sequence offset refers to the interval between the sequence number of the media unit and the latest media unit. The second type of parameters include the starting sequence number and / or maximum sequence deviation, where,
    所述起始序号对应的约束条件为:如果所述起始序号有效,则所述候选媒体单元的序号在所述起始序号之后;The constraint condition corresponding to the starting sequence number is: if the starting sequence number is valid, the sequence number of the candidate media unit is after the starting sequence number;
    所述最大序偏对应的约束条件为:如果所述最大序偏有效,则所述候选媒体单元的序偏小于或等于所述最大序偏。The constraint condition corresponding to the maximum order offset is: if the maximum order offset is valid, the order offset of the candidate media unit is less than or equal to the maximum order offset.
  5. 根据权利要求3所述的媒体流的实时递送方法,其特征在于,所述每个媒体单元关联有一个时偏,所述时偏是指所述媒体单元与最新媒体单元的产生时间间隔,所述第二类参数包括起始时间和/或最大时偏,其中,The method for real-time delivery of media streams according to claim 3, wherein each media unit is associated with a time offset, and the time offset refers to a time interval between the generation of the media unit and the latest media unit. The second type of parameters includes the start time and / or the maximum time offset, where,
    所述起始时间对应的约束条件为:如果所述起始时间有效,则所述候选媒体单元的产生时间在所述起始时间之后;The constraint condition corresponding to the start time is: if the start time is valid, the generation time of the candidate media unit is after the start time;
    所述最大时偏对应的约束条件为:如果所述最大时偏有效,则所述候选媒体单元的时偏小于或等于所述最大时偏。The constraint condition corresponding to the maximum time offset is: if the maximum time offset is valid, the time offset of the candidate media unit is less than or equal to the maximum time offset.
  6. 根据权利要求3所述的媒体流的实时递送方法,其特征在于,所述每个媒体单元关联有一个优先级,所述第二类参数包括最小优先级,所述最小优先级对应的约束条件包括:The method for real-time delivery of media streams according to claim 3, wherein each media unit is associated with a priority level, and the second type of parameters includes a minimum priority level, and a constraint condition corresponding to the minimum priority level include:
    如果所述最小优先级有效,则所述候选媒体单元的优先级大于或等于最小优先级;If the minimum priority is valid, the priority of the candidate media unit is greater than or equal to the minimum priority;
    如果所述媒体段请求携带的其他第二类参数未限定候选媒体单元的范围,则所述候选媒体单元的范围为缺省指定。If the other second-type parameters carried in the media segment request do not define the range of candidate media units, the range of the candidate media units is specified by default.
  7. 根据权利要求1所述的媒体流的实时递送方法,其特征在于,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向。The real-time delivery method of the media stream according to claim 1, wherein the unit sorting method is one of the following basic sorting methods: sequence number forward, sequence number reverse, generation time forward, and generation time reverse.
  8. 根据权利要求1所述的媒体流的实时递送方法,其特征在于,所述每个媒体单元关联有一个优先级,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向、高优先级优先、低优先级优先。The method for real-time delivery of media streams according to claim 1, wherein each media unit is associated with a priority, and the unit sorting method is one of the following basic sorting methods: serial number forward, serial number reverse , Forward time, reverse time, high priority, low priority.
  9. 根据权利要求7或8所述的媒体流的实时递送方法,其特征在于,所述单元排序方式为多个基本排序方式的级联,所述将候选媒体单元按单元排序方式指定的顺序排序包括:将所述候选媒体单元按照第一基本排序方式排序,且将排序后位置相同的候选媒体单元按照第二基本排序方式排序,依此类推直至完成排序。The method for real-time delivery of media streams according to claim 7 or 8, wherein the unit sorting method is a cascade of multiple basic sorting methods, and the sorting of candidate media units in the order specified by the unit sorting method includes : Sort the candidate media units according to the first basic sorting method, and sort the candidate media units with the same position after sorting according to the second basic sorting method, and so on until the sorting is completed.
  10. 一种媒体流的实时递送服务器,其特征在于,所述媒体流为实时产生的媒体单元的序列,其中,每个媒体单元关联有一个产生时间和/或一个指示产生顺序的序号,所述服务器包括:A media stream real-time delivery server, characterized in that the media stream is a sequence of media units generated in real time, wherein each media unit is associated with a generation time and / or a sequence number indicating the generation order, the server include:
    客户端接口组件,用于接收客户端发送的媒体段请求并返回相应的媒体段,其中,所述媒体段请求不携带或携带至少一个控制参数,且控制参数包括指示待传送的目标媒体流的第一类参数、指示待传送的候选媒体单元的第二类参数和单元排序方式;The client interface component is used to receive the media segment request sent by the client and return the corresponding media segment, where the media segment request does not carry or carries at least one control parameter, and the control parameter includes a message indicating the target media stream to be transmitted The first type of parameters, the second type of parameters indicating the candidate media units to be transmitted and the unit sorting manner;
    媒体段生成组件,根据所述媒体段请求生成媒体段,其中,根据所述第一类参数确定所述待传送的目标媒体流,根据所述第二类参数确定所述待传送的候选媒体单元,将所述待传送的候选媒体单元按单元排序方式指定的顺序排序并封装成所述媒体段,并通过所述 客户端接口组件发送所述媒体段至所述客户端。A media segment generation component generates a media segment according to the media segment request, wherein the target media stream to be transmitted is determined according to the first-type parameter, and the candidate media unit to be transmitted is determined according to the second-type parameter , Sort and encapsulate the candidate media units to be transmitted in the order specified by the unit sorting manner into the media segments, and send the media segments to the client through the client interface component.
  11. 根据权利要求10所述的媒体流的实时递送服务器,其特征在于,所述媒体段生成组件进一步用于在所述媒体段请求不携带所述第一类参数时,所述待传送的目标媒体流为缺省指定的媒体流,且在所述媒体段请求中不携带所述第二类参数时,所述候选媒体单元包括缺省指定的媒体单元,所述缺省指定的媒体单元为所述目标媒体流中所有和最新媒体单元的序号间隔小于第一预设值的媒体单元,或者为所述目标媒体流中所有和最新媒体单元的产生时间间隔小于第二预设值的媒体单元,以及在所述媒体段请求中不携带所述单元排序方式时,将所述候选媒体单元按照缺省指定的单元排序方式来封装成所述媒体段。The real-time delivery server for media streams according to claim 10, wherein the media segment generation component is further configured to: when the media segment request does not carry the first type of parameters, the target media to be transmitted The stream is a media stream designated by default, and when the media segment request does not carry the second-type parameter, the candidate media unit includes a media unit designated by default, and the media unit designated by default is A media unit whose serial number interval between all and latest media units in the target media stream is less than a first preset value, or a media unit whose generation time interval between all and latest media units in the target media stream is less than a second preset value, And when the media segment request does not carry the unit sorting mode, the candidate media unit is encapsulated into the media segment according to the unit sorting mode specified by default.
  12. 根据权利要求10所述的媒体流的实时递送服务器,其特征在于,所述媒体段生成组件进一步用于在所述媒体段请求携带至少一个所述第二类参数,其中,所述每个第二类参数对应着候选媒体单元的至少一个约束条件时,所述待传送的候选媒体单元包括所述目标媒体流中同时满足所述第二类参数对应的全部约束条件的所有媒体单元。The real-time delivery server for media streams according to claim 10, wherein the media segment generation component is further configured to carry at least one parameter of the second type in the media segment request, wherein, each of the first When the second-type parameter corresponds to at least one constraint condition of the candidate media unit, the candidate media unit to be transmitted includes all media units in the target media stream that simultaneously satisfy all the constraint conditions corresponding to the second-type parameter.
  13. 根据权利要求12所述的媒体流的实时递送服务器,其特征在于,所述每个媒体单元关联有一个序偏,所述序偏是指所述媒体单元与最新媒体单元的序号间隔,所述第二类参数包括起始序号和/或最大序偏,其中,The real-time delivery server of the media stream according to claim 12, wherein each media unit is associated with a sequence offset, and the sequence offset refers to a sequence number interval between the media unit and the latest media unit, the The second type of parameters include the starting sequence number and / or maximum sequence deviation, where,
    所述起始序号对应的约束条件为:如果所述起始序号有效,则所述候选媒体单元的序号在所述起始序号之后;The constraint condition corresponding to the starting sequence number is: if the starting sequence number is valid, the sequence number of the candidate media unit is after the starting sequence number;
    所述最大序偏对应的约束条件为:如果所述最大序偏有效,则所述候选媒体单元的序偏小于或等于所述最大序偏。The constraint condition corresponding to the maximum order offset is: if the maximum order offset is valid, the order offset of the candidate media unit is less than or equal to the maximum order offset.
  14. 根据权利要求12所述的媒体流的实时递送服务器,其特征在于,所述每个媒体单元关联有一个时偏,所述时偏是指所述媒体单元与最新媒体单元的产生时间间隔,所述第二类参数包括起始时间和/或最大时偏,其中,The real-time delivery server for media streams according to claim 12, wherein each media unit is associated with a time offset, and the time offset refers to a time interval between the generation of the media unit and the latest media unit. The second type of parameters includes the start time and / or the maximum time offset, where,
    所述起始时间对应的约束条件为:如果所述起始时间有效,则所述候选媒体单元的产生时间在所述起始时间之后;The constraint condition corresponding to the start time is: if the start time is valid, the generation time of the candidate media unit is after the start time;
    所述最大时偏对应的约束条件为:如果所述最大时偏有效,则所述候选媒体单元的时偏小于或等于所述最大时偏。The constraint condition corresponding to the maximum time offset is: if the maximum time offset is valid, the time offset of the candidate media unit is less than or equal to the maximum time offset.
  15. 根据权利要求12所述的媒体流的实时递送服务器,其特征在于,所述每个媒体单元关联有一个优先级,所述第二类参数包括最小优先级,所述最小优先级对应的约束条件包括:The real-time delivery server for media streams according to claim 12, wherein each media unit is associated with a priority, and the second type of parameter includes a minimum priority, and the minimum priority corresponds to a constraint condition include:
    如果所述最小优先级有效,则所述候选媒体单元的优先级大于或等于最小优先级;If the minimum priority is valid, the priority of the candidate media unit is greater than or equal to the minimum priority;
    如果所述媒体段请求携带的其他第二类参数未限定候选媒体单元的范围,则所述候选媒体单元的范围为缺省指定。If the other second-type parameters carried in the media segment request do not define the range of candidate media units, the range of the candidate media units is specified by default.
  16. 根据权利要求10所述的媒体流的实时递送服务器,其特征在于,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向。The real-time delivery server for media streams according to claim 10, wherein the unit sorting method is one of the following basic sorting methods: sequence number forward, sequence number reverse, generation time forward, and generation time reverse.
  17. 根据权利要求10所述的媒体流的实时递送服务器,其特征在于,所述每个媒体单元关联有一个优先级,所述单元排序方式为以下基本排序方式之一:序号正向、序号反向、产生时间正向、产生时间反向、高优先级优先、低优先级优先。The real-time delivery server for media streams according to claim 10, wherein each media unit is associated with a priority, and the unit sorting mode is one of the following basic sorting modes: serial number forward, serial number reverse , Forward time, reverse time, high priority, low priority.
  18. 根据权利要求16或17所述的媒体流的实时递送服务器,其特征在于,所述单元排序方式为多个基本排序方式的级联,所述将候选媒体单元按单元排序方式指定的顺序排序包括:将所述候选媒体单元按照第一基本排序方式排序,且将排序后位置相同的候选媒体单元按照第二基本排序方式排序,依此类推直至完成排序。The real-time delivery server for media streams according to claim 16 or 17, wherein the unit sorting mode is a cascade of multiple basic sorting modes, and the sorting of candidate media units in the order specified by the unit sorting mode includes : Sort the candidate media units according to the first basic sorting method, and sort the candidate media units with the same position after sorting according to the second basic sorting method, and so on until the sorting is completed.
  19. 一种计算机设备,其特征在于,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如权利要求1-9中任一所述的方法。A computer device, characterized in that it includes a memory, a processor, and a computer program stored on the memory and that can be run on the processor, wherein when the processor executes the program, it is implemented as claimed in claim 1- The method of any one of 9.
  20. 一种非临时性计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-9中任一所述的方法。A non-transitory computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the method according to any one of claims 1-9 is implemented.
  21. 一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,执行如权利要求1-9中任一所述的方法。A computer program product, when instructions in the computer program product are executed by a processor, execute the method according to any one of claims 1-9.
PCT/CN2019/112324 2018-11-14 2019-10-21 Method for real-time delivery of media stream and server WO2020098455A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811351129.1 2018-11-14
CN201811351129.1A CN111193684B (en) 2018-11-14 2018-11-14 Real-time delivery method and server of media stream

Publications (1)

Publication Number Publication Date
WO2020098455A1 true WO2020098455A1 (en) 2020-05-22

Family

ID=70710503

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/112324 WO2020098455A1 (en) 2018-11-14 2019-10-21 Method for real-time delivery of media stream and server

Country Status (2)

Country Link
CN (1) CN111193684B (en)
WO (1) WO2020098455A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113873343B (en) * 2020-06-30 2023-02-24 北京开广信息技术有限公司 Self-adaptive real-time delivery method of media stream and server
CN114173145A (en) * 2021-12-08 2022-03-11 四川启睿克科技有限公司 HLS protocol-based dynamic code rate low-delay live broadcast method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013030852A2 (en) * 2011-08-29 2013-03-07 Sling Media Pvt Ltd. Systems and methods for controlling the encoding of a segmented media stream using segment transmit times
CN106961613A (en) * 2017-03-30 2017-07-18 上海七牛信息技术有限公司 A kind of streaming real-time transcoding order method and system
CN107920108A (en) * 2016-10-11 2018-04-17 华为技术有限公司 A kind of method for pushing of media resource, client and server
CN107959667A (en) * 2016-10-18 2018-04-24 华为技术有限公司 A kind of method for pushing of media slicing, server and client

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055773B (en) * 2009-11-09 2013-10-09 华为技术有限公司 Method for realizing HTTP-based stream media service, system and network equipment
JP6419173B2 (en) * 2013-07-12 2018-11-07 キヤノン株式会社 An Adaptive Data Streaming Method with Push Message Control
US20160134672A1 (en) * 2014-11-11 2016-05-12 Qualcomm Incorporated Delivering partially received segments of streamed media data
CN107040505B (en) * 2016-02-04 2021-01-26 中兴通讯股份有限公司 Media data transmission method and device
CN106657143A (en) * 2017-01-20 2017-05-10 中兴通讯股份有限公司 Streaming media transmission method and device, server and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013030852A2 (en) * 2011-08-29 2013-03-07 Sling Media Pvt Ltd. Systems and methods for controlling the encoding of a segmented media stream using segment transmit times
CN107920108A (en) * 2016-10-11 2018-04-17 华为技术有限公司 A kind of method for pushing of media resource, client and server
CN107959667A (en) * 2016-10-18 2018-04-24 华为技术有限公司 A kind of method for pushing of media slicing, server and client
CN106961613A (en) * 2017-03-30 2017-07-18 上海七牛信息技术有限公司 A kind of streaming real-time transcoding order method and system

Also Published As

Publication number Publication date
CN111193684B (en) 2021-12-21
CN111193684A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
US11477262B2 (en) Requesting multiple chunks from a network node on the basis of a single request message
CN106233735B (en) Method for managing multicast video transmission
KR101846382B1 (en) Systems and methods for signaling request acceleration in the transport layer
US20140095593A1 (en) Method and apparatus for transmitting data file to client
US20170127147A1 (en) Multicast streaming
WO2011100901A2 (en) Method, device and system for transmitting and processing media content
WO2020034082A1 (en) Slicing-based rtp stream transmission method, device, terminal and server
WO2013170835A2 (en) System and method for distributing live broadcast content
WO2018166320A1 (en) Channel changing method, and apparatus
TW201540031A (en) Transport accelerator implementing client side transmission functionality
WO2020098455A1 (en) Method for real-time delivery of media stream and server
CN107920072B (en) Multimedia sharing method and system based on data characteristics
WO2012161652A1 (en) Methods for transmitting and receiving a digital signal, transmitter and receiver
CN110072128B (en) Real-time pushing method of media stream and server
CN110086797B (en) Real-time receiving method of media stream, client, computer device and storage medium
WO2020078388A1 (en) Streaming media data transmission method, device, and apparatus, and computer storage medium
CN111193686B (en) Media stream delivery method and server
CN110881018B (en) Real-time receiving method and client of media stream
CN104469538B (en) RTP video streaming data packet recombination methods towards picture image quality compared with small loss
WO2021017958A1 (en) Video transcoding method and apparatus
CN112203105A (en) New media mobile live broadcasting method and system
CN110545492B (en) Real-time delivery method and server of media stream
CN111654725B (en) Real-time receiving method and client of media stream
WO2020048268A1 (en) Real-time transmitting method and real-time receiving method for media stream, server, and client
US10893303B1 (en) Streaming chunked media segments

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 06/09/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19884792

Country of ref document: EP

Kind code of ref document: A1