WO2016090916A1 - 码流传输方法和装置 - Google Patents

码流传输方法和装置 Download PDF

Info

Publication number
WO2016090916A1
WO2016090916A1 PCT/CN2015/084130 CN2015084130W WO2016090916A1 WO 2016090916 A1 WO2016090916 A1 WO 2016090916A1 CN 2015084130 W CN2015084130 W CN 2015084130W WO 2016090916 A1 WO2016090916 A1 WO 2016090916A1
Authority
WO
WIPO (PCT)
Prior art keywords
code stream
key frame
double
pat
speed
Prior art date
Application number
PCT/CN2015/084130
Other languages
English (en)
French (fr)
Inventor
王洁
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016090916A1 publication Critical patent/WO2016090916A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream

Definitions

  • This document relates to the field of communications, and in particular, to a code stream transmission method and apparatus.
  • IPTV Interactive Personality TV
  • IPTV uses a telecom bandwidth network as a transmission channel and a TV as a playback terminal to provide home users with a variety of video services including on-demand, live broadcast, look back, and time shift.
  • the implementation of IPTV is mainly to use a streaming media server to send a code stream, the set top box receives and parses the code stream, and finally the television terminal displays the mode of the video data.
  • IPTV is different from the traditional TV mode. Its main feature is that in its interactivity, the initiative is given to the user, and the user selects the program and the playback mode.
  • On-demand is mainly to play a fixed length of transport stream (TS, Transport Stream), the original TS is generally provided by the content provider.
  • TS transport stream
  • Streaming media servers need to be processed before they can be used to order such sources.
  • the time shift and look back are mainly to store the live stream from the live broadcast code server, and perform certain processing on the live stream. Whether it is on-demand, time-shift or look-back, it can provide normal playback, fast forward and backward.
  • the data sent by the server to the Set Top Box is a key frame. These key frames are actually one TS.
  • the set-top box receives the TSs and performs decoding of the following process: 1) acquiring a program association table (PAT, Program Association Table) in the TS, and then finding a program identifier (Program Identity, PID) of the program source from the PAT, generally the program
  • PAT Program Association Table
  • the source is composed of multiple ES (Elementary Stream) and is described in the Program Map Table (PMT). 2)
  • the PID of the ES is retrieved in the PMT table by the PID of the program source.
  • the decoder distinguishes the packets on the TS according to the PID in the ES stream in the PMT table, and decodes them according to different ESs. Therefore, the premise of the set-top box decoding is that the PAT and PMT information of the program must be obtained. Because normal playback is usually performed before double speed playback, the PAT and PMT information of the program will be sent to the set top box in advance. Therefore, the related technical solution can correctly decode the set top box when the key frame information is only transmitted at the double speed.
  • this solution has the following problems: for example, when the live incoming code stream changes, that is, when the PAT/PMT changes, The current user has been playing at a double speed, and the key frame information after the code stream change is sent to the set top box. At this time, since the set top box cannot obtain the changed PAT/PMT information, all the data after the code stream change fails to be decoded. The performance of the black screen eventually leads to the user's time shift failure, which seriously affects the user experience.
  • the embodiment of the invention provides a code stream transmission method and device, including:
  • the program association table PAT or the program map PMT information corresponding to the key frame is inserted in the double-speed code stream before the key frame.
  • the transmission double speed code stream includes:
  • PAT or PMT information is available before each key frame.
  • the transmission double speed code stream includes:
  • the changed PAT or PMT information is transmitted only before the key frame in which the PAT or PMT information is changed is transmitted.
  • the method before the step of receiving the double speed play request, the method further includes:
  • the transmission double speed code stream includes:
  • a double-speed code stream file containing PAT or PMT information is transmitted from the start key frame in the double-speed code stream file.
  • a code stream transmission device comprising:
  • Requesting a receiving module set to: receive a double speed play request
  • the code stream sending module is configured to: transmit a double speed code stream according to the double speed play request, wherein, in the double speed code stream, a program association table PAT or a program map table PMT corresponding to the key frame is inserted before a key frame information.
  • the code stream sending module includes:
  • the first starting position determining unit is configured to: determine, according to the double speed playing request, a starting key frame of the double speed code stream to be transmitted;
  • the first information insertion unit is configured to insert PAT or PMT information before each key frame from the start key frame.
  • the code stream sending module includes:
  • the second starting position determining unit is configured to: determine, according to the double speed playing request, a starting key frame of the double speed code stream to be transmitted;
  • the information change checking unit is configured to: determine whether the PAT or PMT information corresponding to each key frame changes from the initial key frame;
  • the second information insertion unit is configured to insert the changed PAT/PMT information only before the key frame in which the PAT/PMT information changes.
  • the device further includes:
  • the double-speed file management module is configured to: process the code stream stored in the real-time, obtain and save at least one double-speed code stream file, wherein PAT is inserted before each key frame of the double-speed code stream file.
  • PAT is inserted before each key frame of the double-speed code stream file
  • the PMT information or the PAT or PMT information is inserted only before the key frame in which the PAT or PMT information of the double speed code stream file changes.
  • the code stream sending module includes:
  • a third starting position determining unit configured to: determine a corresponding double-speed code stream file and a starting key frame according to the double-speed playing code stream request;
  • the double-speed code stream transmitting unit is configured to: transmit a double-speed code stream file including PAT or PMT information from the start key frame in the double-speed code stream file.
  • a computer readable storage medium storing program instructions that, when executed, implement the methods described above.
  • An embodiment of the present invention provides a code stream transmission method and apparatus, which receives a double-speed broadcast code stream request, and inserts PAT/PMT information transmission before a key frame according to the double-speed broadcast code stream request.
  • the PAT/PMT information is timely notified to the client, and the efficient and reliable code stream double speed playback is realized, which solves the problem of double speed playback failure.
  • 1 is an explanatory diagram of a live time shift storage code stream
  • FIG. 2 is a diagram for explaining information of each key frame at the same time when the live stream is stored
  • FIG. 3 is a diagram showing an example of data transmitted between a server and an STB during double speed playback in Embodiments 1 and 3 of the present invention
  • FIG. 4 is a diagram showing an example of data transmitted between a server and an STB during double speed playback in the second and fourth embodiments of the present invention
  • FIG. 5 is an explanatory diagram of a double-speed code stream saved in Embodiment 3 of the present invention.
  • FIG. 6 is a diagram for explaining information of each key frame at the same time when the double-speed code stream is stored in the embodiment of the present invention.
  • FIG. 7 is an explanatory diagram of a double-speed code stream saved in Embodiment 4 of the present invention.
  • FIG. 8 is a flowchart of a code stream transmission method according to Embodiment 5 of the present invention.
  • FIG. 9 is a schematic structural diagram of a code stream transmission apparatus according to Embodiment 6 of the present invention.
  • FIG. 10 is a schematic structural diagram of the code stream sending module 1102 of FIG. 9.
  • the related technical solution can correctly decode the set top box when the key frame information is only transmitted at the double speed.
  • this solution has the following problems: for example, the live incoming code stream changes, that is, PAT/PMT is sent.
  • PAT/PMT the live incoming code stream changes
  • the key frame information after the code stream change is sent to the set-top box.
  • the set-top box cannot obtain the changed PAT/PMT information, the data after the code stream change is caused. All decoding fails, and the screen displays a black screen, which eventually leads to user time-lapse failure, which seriously affects the user experience.
  • the STB sends fast forward and backward signaling to the server, and the server will send the double-speed playback code stream to the STB.
  • the TS is composed of an I frame, a B frame, and a P frame. If the STB knows the PAT/PMT information of a code stream, the I frame information can be independently decoded based on this information. In general, PAT/PMT information in a TS is fixedly inserted into the TS every few tens of milliseconds. Generally, when the user requests double speed playback, the streaming server parses the original TS stream and extracts the intermediate I frame to the STB.
  • the PAT/PMT may be removed because the I frame information sent by the streaming server to the STB, or in extreme cases, the I frame sent to the STB by the streaming server has no PAT/PMT information. .
  • the PAT/PMT of the code stream changes during the fast forward or backward process, if the changed PAT/PMT information is not sent to the STB in time, the STB end parsing the code stream fails.
  • the essence of this problem is that the PAT/PMT in the TS changes, so there are similar problems in theory, on-demand, time shift and look back.
  • the embodiment of the invention provides a code stream transmission method, and the code stream is stored in real time according to a certain strategy during live broadcast recording, as shown in FIG. 1 .
  • PAT/PMT information is inserted in front of each key frame, as shown in FIG. 2 .
  • the streaming media server processes the live stream, and identifies the main information of each key frame in the code stream, such as a key frame time stamp, a key frame offset in the code stream, and the like.
  • the key frame may also identify the most recent PAT/PMT information in front of the key frame or only identify the PAT/PMT information in front of the changed key frame.
  • the user requests double speed playback.
  • the streaming media server finds the offset of the current key frame according to the attribute of each key frame identified (the live stream is parsed when the stream is stored, and the key frame of the stream can be parsed in one file at this time)
  • the information is recorded, including the time stamp of the key frame, and the position of the I frame in the stored code stream, which is equivalent to an index.
  • the user requests the double speed playback to actually send a time, according to the time sent by the user.
  • the timestamp of the keyframe determines the starting keyframe of the transmitted stream).
  • the streaming media server finds the corresponding PAT/PMT according to the PAT/PMT information identified by the key frame; or searches for the latest PAT/PMT information from the located key frame position and transmits it.
  • the streaming server sends the currently located key frame.
  • the streaming media server finds the PAT/PMT information corresponding to the next key frame according to step 4, and transmits it.
  • the streaming server sends the next keyframe.
  • the embodiment of the invention provides a code stream transmission method, and the code stream is stored in real time according to a certain strategy during live broadcast recording, as shown in FIG. 1 .
  • the code stream is stored in real time according to a certain strategy during live broadcast recording, as shown in FIG. 1 .
  • the user requests double speed playback, only the changed PAT/PMT information is inserted at the key frame after the PAT/PMT change, as shown in FIG. 2 .
  • the streaming media server processes the live stream, and identifies the main information of each key frame in the code stream, such as a key frame time stamp, a key frame offset in the code stream, and the like. It is also necessary to identify whether the PAT/PMT changes on the key frame. If the PAT/PMT changes, the changed PAT/PMT information can be saved in the index.
  • the user requests double speed playback.
  • the streaming media finds the offset of the current key frame according to the attribute of each key frame identified.
  • the streaming media determines whether there is a PAT/PMT change in the key frame that is located according to the PAT/PMT information of the key frame identifier; if the PAT/PMT changes, the changed PAT/PMT information may be obtained from the index or from the located location.
  • the key frame position is searched for forward. Or compare the previous PAT/PMT in real time to determine if a change has occurred. This step mainly sends the changed PAT/PMT to the set-top box, and the PAT/PMT does not change without sending.
  • the streaming media sends the currently located key frames.
  • the code stream is stored in real time according to a certain strategy, and the corresponding double-speed code stream file is saved for the existing double speed value.
  • the live stream may be parsed while the live stream is saved, such as identifying the frame information therein, or generating multiple speed code streams according to the configuration.
  • the double speed file needs to insert PAT/PMT information before storing each key frame information.
  • the streaming media server processes the live stream, and saves the corresponding double-speed stream file for the existing double speed value, as shown in FIG. 5 .
  • the double-speed code stream file needs to insert PAT/PMT information in front of storing each key frame information, and also identifies key information of each key frame, such as key frame time stamp, offset, etc., as shown in FIG. 6.
  • the offset can refer to the starting position of the current key frame in the double speed file, and can also refer to the starting position of the PAT/PMT in front of the key frame in the double speed file. Also available on key frames To identify whether the PAT/PMT changes or related information.
  • the user requests double speed playback.
  • the streaming media finds the offset of the current key frame according to the attribute of each key frame identified.
  • the embodiment of the invention provides a code stream transmission method.
  • the code stream is stored in real time according to a certain strategy, and the corresponding double speed code stream file is saved for the existing double speed value, as shown in FIG. 7 .
  • the double-speed code stream file needs to insert PAT/PMT information in front of the changed frame when storing key frame information.
  • the streaming media server processes the live stream, and saves the corresponding double speed file for the existing double speed value.
  • the double-speed code stream file needs to insert PAT/PMT information before the PAT/PMT changed frame information when storing key frame information.
  • identify key information of each key frame such as key frame time stamp, offset, etc., as shown in Figure 6.
  • the offset can refer to the starting position of the current key frame in the double speed file, and can also refer to the starting position of the PAT/PMT in front of the key frame in the double speed stream file.
  • the user requests double speed playback.
  • the streaming media finds the offset of the current key frame according to the attribute of each key frame identified.
  • the embodiment of the invention provides a code stream transmission method, and uses the method to complete a stream delivered by a code stream. As shown in Figure 8, it includes:
  • Step 1001 The server stores the code stream in real time
  • the server stores the code stream in real time, and can perform periodic storage according to a preset period; while storing the code stream, the stored code stream can also be processed to obtain at least one double speed value double speed code.
  • the stream file is saved and inserted, and PAT/PMT information is inserted before each key frame of the double-speed code stream file or PAT/PMT information is inserted before a key frame in which the PAT/PMT information of the double-speed code stream file changes.
  • Step 1002 The server receives a double speed play request.
  • the server receives the double speed play request sent by the STB, and requests the current code stream to be played at a double speed.
  • Step 1003 Transmit a double-speed code stream according to the double-speed play request, where PAT/PMT information transmission is inserted before the key frame;
  • the method of inserting PAT/PMT information includes at least:
  • Method 1 Insert PAT/PMT information before each key frame
  • Manner 2 insert the changed PAT/PMT information before the key frame where the PAT/PMT information changes;
  • the PAT/PMT information is transmitted before the key frame of the /PMT information change is inserted.
  • determining, according to the double-speed playing code stream request, a corresponding double-speed code stream file and a starting key frame of the sending code stream, starting from the starting key frame in the double-speed code stream file sending, including Multi-speed code stream file for PAT/PMT information.
  • the embodiment of the invention provides a code stream transmission device, and the structure thereof is as shown in FIG. 9 and includes:
  • the request receiving module 1101 is configured to receive a double speed play request
  • the code stream sending module 1102 is configured to transmit the double speed code stream according to the double speed play request, wherein the PAT/PMT information corresponding to the key frame is inserted before the key frame in the double speed code stream.
  • the structure of the code stream sending module 1102 is as shown in FIG. 10, and includes:
  • the first starting position determining unit 1201 is configured to determine a starting key frame of the to-be-transmitted code stream according to the double-speed playing request;
  • the first information insertion unit 1202 is arranged to insert PAT/PMT information before each key frame from the start key frame.
  • the code stream sending module 1102 further includes:
  • the second starting position determining unit 1203 is configured to determine a starting key frame of the to-be-transmitted code stream according to the double-speed playing request;
  • the information change checking unit 1204 is configured to determine whether the PAT/PMT information corresponding to each key frame changes from the initial key frame;
  • the second information insertion unit 1205 is arranged to insert the changed PAT/PMT information transmission only before the key frame in which the PAT/PMT information changes.
  • the device further includes:
  • the double-speed file management module 1103 is configured to process the code stream stored in the real-time, to obtain and save at least one double-speed code stream file, wherein PAT/ is inserted before each key frame of the double-speed code stream file.
  • PAT/ is inserted before each key frame of the double-speed code stream file
  • the PMT information or the PAT/PMT information is inserted only before the key frame in which the PAT/PMT information of the double-speed code stream file changes.
  • the code stream sending module 1102 further includes:
  • the third home position determining unit 1206 is configured to determine, according to the double speed broadcast code stream request, Corresponding double speed stream file and starting key frame;
  • the double-speed code stream transmitting unit 1207 is configured to transmit a double-speed code stream file including PAT/PMT information from the start key frame in the double-speed code stream file.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • Embodiments of the present invention also provide a streaming media server, including a processor and a memory, the memory storing instructions to enable the streaming media server to perform the method described above when the instruction is executed.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the embodiment of the invention realizes efficient and reliable code stream double speed playback, and solves the problem of double speed playback failure.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种码流传输方法和装置,该方法包括:接收倍速播放请求;根据所述倍速播放请求,传输倍速码流;其中,所述倍速码流中,关键帧前插入了与所述关键帧对应的节目关联表PAT或节目映射表PMT信息。

Description

码流传输方法和装置 技术领域
本文涉及通信领域,尤其涉及一种码流传输方法和装置。
背景技术
交互式网络电视(Interactive Personality TV,IPTV),是以电信带宽网络为传输通道,以电视机为播放终端,向家庭用户提供包括点播、直播、回看以及时移等在内的多种视频服务。目前IPTV的实现主要是采用流媒体服务器发送码流,机顶盒接收并解析码流,最终电视机终端显示视频数据的模式。IPTV区别于传统的电视模式,其主要特点是在其交互性,将主动权交给了用户,由用户选择节目和播放方式。
点播主要是播放一段固定长度的传输流(TS,Transport Stream),原始TS一般是内容提供商提供。流媒体服务器在点播这类片源前都需要经过一定的处理。时移和回看主要是存储直播编码服务器过来的直播流,并对直播流进行一定的处理。无论是点播、时移还是回看都能提供正常播放、快进和后退等功能。
用户在快进后退时,服务器发送到机顶盒(Set Top Box,简称STB)的数据都是关键帧,这些关键帧实际上是一个个TS。机顶盒收到这些TS,进行如下过程的解码:1)获取TS中的节目关联表(PAT,Program Association Table,),然后从PAT中找到节目源的节目标识(Program Identity,PID),一般此节目源都由多个ES(Elementary Stream,基本流)组成,并描述在节目映射表(PMT,Program Map Table)里面。2)通过节目源的PID,在PMT表里检索到ES的PID。3)解码器根据PMT表中的ES流中的PID,将TS上的包进行区分,并按不同的ES进行解码。所以机顶盒解码的前提是必须要获取到节目的PAT和PMT信息。因为在倍速播放前一般会先进行正常播放,此时节目的PAT和PMT信息就会提前发送到机顶盒。所以相关技术方案在倍速播放只发送关键帧信息时,机顶盒也能正确解码。但是这种方案存在如下问题:比如直播入向码流发生变化,即PAT/PMT发生变化时,如果 当前用户一直在进行倍速播放,那么码流变化后的关键帧信息发送到机顶盒后,此时由于机顶盒无法获取到变化后的PAT/PMT信息,所以导致码流变化后的数据全部解码失败,画面表现黑屏,最终导致用户时移失败,严重影响用户体验。
发明内容
本发明实施例提供了一种码流传输方法和装置,包括:
接收倍速播放请求;
根据所述倍速播放请求,传输倍速码流;
其中,所述倍速码流中,关键帧前插入了与所述关键帧对应的节目关联表PAT或节目映射表PMT信息。
可选地,根据所述倍速播放请求,传输倍速码流包括:
根据所述倍速播放请求,确定待传输的倍速码流的起始关键帧;
自所述起始关键帧起,在每个关键帧前均PAT或PMT信息。
可选地,根据所述倍速播放请求,传输倍速码流包括:
根据所述倍速播放请求,确定待传输的倍速码流的起始关键帧;
自所述起始关键帧起,判定每个关键帧对应的PAT或PMT信息是否发生变化;
仅在发送所述PAT或PMT信息发生变化的关键帧前发送变化后的PAT或PMT信息。
可选地,所述接收倍速播放请求的步骤之前,还包括:
对实时存储的码流进行处理,得到并保存至少一个倍速值的倍速码流文件,其中,在所述倍速码流文件的每个关键帧前均插入了PAT或PMT信息或仅在所述倍速码流文件的PAT或PMT信息发生变化的关键帧前插入了PAT或PMT信息。
可选地,根据所述倍速播放请求,传输倍速码流包括:
根据所述倍速播放码流请求,确定相应的倍速码流文件和起始关键帧;
从所述倍速码流文件中的所述起始关键帧起,传输包含PAT或PMT信息的倍速码流文件。
一种码流传输装置,包括:
请求接收模块,设置为:接收倍速播放请求;以及
码流发送模块,设置为:根据所述倍速播放请求,传输倍速码流,其中,所述倍速码流中,关键帧前插入了与所述关键帧对应的节目关联表PAT或节目映射表PMT信息。
可选地,所述码流发送模块包括:
第一起始位置判定单元,设置为:根据所述倍速播放请求,确定待传输的倍速码流的起始关键帧;
第一信息插入单元,设置为:自所述起始关键帧起,在每个关键帧前插入PAT或PMT信息。
可选地,所述码流发送模块包括:
第二起始位置判定单元,设置为:根据所述倍速播放请求,确定待传输倍速码流的起始关键帧;
信息变化检查单元,设置为:自所述起始关键帧起,判定每个关键帧对应的PAT或PMT信息是否发生变化;
第二信息插入单元,设置为:仅在所述PAT/PMT信息发生变化的关键帧前插入变化后的PAT/PMT信息。
可选地,该装置还包括:
倍速文件管理模块,设置为:对实时存储的码流进行处理,得到并保存至少一个倍速值的倍速码流文件,其中,在所述倍速码流文件的每个关键帧前均插入了PAT或PMT信息或仅在所述倍速码流文件的PAT或PMT信息发生变化的关键帧前插入PAT或PMT信息。
可选地,所述码流发送模块包括:
第三起始位置确定单元,设置为:根据所述倍速播放码流请求,确定相应的倍速码流文件和起始关键帧;
倍速码流发送单元,设置为:从所述倍速码流文件中的所述起始关键帧起,发送包含PAT或PMT信息的倍速码流文件。
一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上面所述的方法。
本发明实施例提供了一种码流传输方法和装置,接收倍速播放码流请求,根据所述倍速播放码流请求,在关键帧前插入PAT/PMT信息发送。将PAT/PMT信息及时告知客户端,实现了高效可靠的码流倍速播放,解决了倍速播放失败的问题。
附图概述
图1为直播时移存储码流说明图;
图2为直播码流存储时,同时标识每个关键帧信息说明图;
图3为本发明的实施例一、三中倍速播放时,服务器与STB之间传输的数据示例图;
图4为本发明的实施例二、四中倍速播放时,服务器与STB之间传输的数据示例图;
图5为本发明的实施例三中保存的倍速码流说明图;
图6为本发明的实施例中倍速码流存储时,同时标识每个关键帧信息说明图;
图7为本发明的实施例四中保存的倍速码流说明图;
图8为本发明的实施例五提供的一种码流传输方法的流程图;
图9为本发明的实施例六提供的一种码流传输装置的结构示意图;
图10为图9中码流发送模块1102的结构示意图。
本发明的实施方式
相关技术方案在倍速播放只发送关键帧信息时,机顶盒也能正确解码。但是这种方案存在如下问题:比如直播入向码流发生变化,即PAT/PMT发 生变化时,如果当前用户一直在进行倍速播放,那么码流变化后的关键帧信息发送到机顶盒后,此时由于机顶盒无法获取到变化后的PAT/PMT信息,所以导致码流变化后的数据全部解码失败,画面表现黑屏,最终导致用户时移失败,严重影响用户体验。如果当前用户进行快进后退操作,那么STB就向服务器发送快进后退信令,这时候服务器就会发倍速播放的码流到STB。对于TS来说,TS是由I帧、B帧以及P帧组成的。STB如果知道一个码流的PAT/PMT信息后,根据这个信息就可以独立解码出I帧信息。一般来说,一段TS中的PAT/PMT信息是每隔几十毫秒固定插入到TS中的。通常来说用户请求倍速播放,流媒体服务器就会对原始TS流进行解析提取出中间的I帧发送到STB。当PAT/PMT未发生变化时,因为流媒体服务器发给STB的I帧信息有可能把PAT/PMT给去掉了,或者极端情况,流媒体服务器发给STB的I帧正好都没有PAT/PMT信息。此时如果在快进或后退的过程中,如果码流的PAT/PMT发生变化,如果这种变化后的PAT/PMT信息未及时发送到STB,就会导致STB端解析码流失败。本问题的实质是TS中的PAT/PMT发生变化,所以理论上点播、时移和回看等都存在类似问题。
为了解决上述问题,本发明的实施例提供了一种码流传输方法和装置。下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
首先,对本发明的实施例一进行说明。
本发明实施例提供了一种码流传输方法,流媒体直播录制时按照一定的策略实时存储码流,如图1所示。用户请求倍速播放时每个关键帧前面插入PAT/PMT信息,如图2所示。
1、流媒体服务器对直播码流进行处理,并标识码流中每个关键帧的主要信息,比如关键帧时戳、关键帧在码流中的偏移等。关键帧上还可以标识出关键帧前面最近的PAT/PMT信息或者只在变化的关键帧前面标识PAT/PMT信息。
2、用户请求倍速播放。
3、流媒体服务器根据标识的每个关键帧的属性找到当前关键帧的偏移(直播码流在存储时会对码流进行解析,此时可以在一个文件中将这段码流的关键帧信息记录下来,包括这个关键帧的时戳、以及这个I帧在存储下来的码流中的位置,相当于一个索引。用户请求倍速播放实际上也是下发一个时间,根据用户下发的时间对比关键帧的时戳即可确定发送码流的起始关键帧)。
4、流媒体服务器根据关键帧标识的PAT/PMT信息找到相应的PAT/PMT;或者从定位到的关键帧位置往前搜索最近的PAT/PMT信息,并进行发送。
5、流媒体服务器发送当前定位到的关键帧。
6、查找下一个关键帧位置。
7、流媒体服务器根据步骤4找到下一个关键帧对应的PAT/PMT信息,并进行发送。
8、流媒体服务器发送下一个关键帧。
9、循环6-8过程。
在倍速播放过程中,流媒体服务器与STB间数据传输如图3所示。
下面,对本发明的实施例二进行说明。
本发明实施例提供了一种码流传输方法,流媒体直播录制时按照一定的策略实时存储码流,如图1所示。用户请求倍速播放时只在PAT/PMT变化后的关键帧处插入变化后的PAT/PMT信息,如图2所示。
具体实施如下:
1、流媒体服务器对直播码流进行处理,并标识码流中每个关键帧的主要信息,比如关键帧时戳、关键帧在码流中的偏移等。关键帧上还需要标识出PAT/PMT是否变化,如果PAT/PMT发生变化可以在索引中对变化后的PAT/PMT信息进行保存。
2、用户请求倍速播放。
3、流媒体根据标识的每个关键帧的属性找到当前关键帧的偏移。
4、流媒体根据关键帧标识的PAT/PMT信息确定定位到的关键帧是否存在PAT/PMT变化;如果PAT/PMT发生变化,变化后的PAT/PMT信息可以从索引中获取或者从定位到的关键帧位置往前搜索获取。或者每次实时比较上一个PAT/PMT,判断是否发生变化。此步骤主要是将变化后的PAT/PMT发送到机顶盒,PAT/PMT不变化则不发送。
5、流媒体发送当前定位到的关键帧。
6、查找下一个关键帧位置。
7、重复过程4。
8、流媒体发送下一个关键帧。
9、循环6-8过程。
在倍速播放过程中,服务器与STB间数据传输如图4所示。
下面,对本发明的实施例三进行说明。
流媒体直播录制时按照一定的策略实时存储码流,并针对已有的倍速值保存相应的倍速码流文件。如,可在保存直播码流的同时,对直播码流进行解析,比如标识出里面的帧信息,或者按配置分别生成多个倍速码流文件。这样用户在切换过程中,能快速的找到待播位置,然后发送相应的倍速码流。倍速文件在存储每个关键帧信息时前面都需要插入PAT/PMT信息。
具体实施如下:
1、流媒体服务器对直播码流进行处理,并针对已有的倍速值保存相应的倍速码流文件,如图5所示。倍速码流文件在存储每个关键帧信息时前面都需要插入PAT/PMT信息,同时标识每个关键帧的关键信息,比如关键帧时戳、偏移等,如图6所示。偏移可以指当前关键帧在倍速文件中的起始位置,也可以指关键帧前面的PAT/PMT在倍速文件中的起始位置。关键帧上也可 以标识出PAT/PMT是否变化或相关信息。
2、用户请求倍速播放。
3、流媒体根据标识的每个关键帧的属性找到当前关键帧的偏移。
4、根据该偏移,确定相应的倍速码流文件中的起始关键帧位置,并从该关键帧开始读倍速码流并发送到机顶盒。
在倍速播放过程中,服务器与STB间数据传输如图3所示。
下面,对本发明的实施例四进行说明。
本发明实施例提供了一种码流传输方法,流媒体直播录制时按照一定的策略实时存储码流,并针对已有的倍速值保存相应的倍速码流文件,如图7所示。倍速码流文件在存储关键帧信息时需要在变化后的帧前面均插入PAT/PMT信息。
具体实施如下:
1、流媒体服务器对直播码流进行处理,并针对已有的倍速值保存相应的倍速文件。倍速码流文件在存储关键帧信息时需要在PAT/PMT变化后的帧信息前均插入PAT/PMT信息。同时标识每个关键帧的关键信息,比如关键帧时戳、偏移等,如图6所示。偏移可以指当前关键帧在倍速文件中的起始位置,也可以指关键帧前面的PAT/PMT在倍速码流文件中的起始位置。
2、用户请求倍速播放。
3、流媒体根据标识的每个关键帧的属性找到当前关键帧的偏移。
4、根据该偏移,确定相应的倍速码流文件中的起始关键帧位置,并从该关键帧开始读倍速码流发送到机顶盒。
在倍速播放过程中,服务器与STB间数据传输如图4所示。
下面,对本发明的实施例五进行说明。
本发明实施例提供了一种码流传输方法,使用该方法完成码流下发的流 程如图8所示,包括:
步骤1001、服务器实时存储码流;
本步骤中,服务器对码流进行实时存储,可根据一个预置的周期进行周期性的存储;在存储码流的同时,还可对存储的码流进行处理,获得至少一个倍速值的倍速码流文件并保存,在所述倍速码流文件的每个关键帧前均插入PAT/PMT信息或在所述倍速码流文件的PAT/PMT信息发生变化的关键帧前插入PAT/PMT信息。
具体参见本发明的实施例一至四,在此不再赘述。
步骤1002、服务器接收倍速播放请求;
本步骤中,服务器接收STB发送的倍速播放请求,请求倍速播放当前码流。
步骤1003、根据所述倍速播放请求,传输倍速码流,其中,在关键帧前插入了PAT/PMT信息发送;
本步骤中,插入PAT/PMT信息的方式至少包含:
1、在实时存储码流时,并未生成倍速码流文件情况下的方式一和方式二:
方式一:在每个关键帧前均插入PAT/PMT信息;
可选的,首先根据所述倍速播放码流请求,确定待发送码流的起始关键帧,自所述起始关键帧起,在每个关键帧前插入PAT/PMT信息发送。
方式二:在PAT/PMT信息发生变化的关键帧前插入变化后的PAT/PMT信息;
可选的,根据所述倍速播放请求,确定待发送码流的起始关键帧,然后自所述起始关键帧起,判定每关键帧对应的PAT/PMT信息是否发生变化,在所述PAT/PMT信息发生变化的关键帧前插入变化后的PAT/PMT信息发送。
2、在实时存储码流时,同时生成倍速码流文件情况下的方式三:
可选的,根据所述倍速播放码流请求,确定相应的倍速码流文件和发送码流的起始关键帧,从所述倍速码流文件中的所述起始关键帧起,发送包含 PAT/PMT信息的倍速码流文件。
下面结合附图,对本发明的实施例六进行说明。
本发明实施例提供了一种码流传输装置,其结构如图9所示,包括:
请求接收模块1101,设置为接收倍速播放请求;
码流发送模块1102,设置为根据所述倍速播放请求,传输倍速码流,其中,所述倍速码流中,在关键帧前插入了与所述关键帧对应的PAT/PMT信息。
可选的,所述码流发送模块1102的结构如图10所示,包括:
第一起始位置判定单元1201,设置为根据所述倍速播放请求,确定待发送码流的起始关键帧;
第一信息插入单元1202,设置为自所述起始关键帧起,在每个关键帧前插入PAT/PMT信息。
可选的,所述码流发送模块1102还包括:
第二起始位置判定单元1203,设置为根据所述倍速播放请求,确定待发送码流的起始关键帧;
信息变化检查单元1204,设置为自所述起始关键帧起判定每个关键帧对应的PAT/PMT信息是否发生变化;
第二信息插入单元1205,设置为仅在所述PAT/PMT信息发生变化的关键帧前插入变化后的PAT/PMT信息发送。
可选的,该装置还包括:
倍速文件管理模块1103,设置为对实时存储的码流进行处理,得到并保存至少一个倍速值的倍速码流文件,其中,在所述倍速码流文件的每个关键帧前均插入了PAT/PMT信息或仅在所述倍速码流文件的PAT/PMT信息发生变化的关键帧前插入了PAT/PMT信息。
可选的,所述码流发送模块1102还包括:
第三起始位置确定单元1206,设置为根据所述倍速播放码流请求,确定 相应的倍速码流文件和起始关键帧;
倍速码流发送单元1207,设置为从所述倍速码流文件中的所述起始关键帧起,发送包含PAT/PMT信息的倍速码流文件。
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上面所述的方法。
本发明实施例还提供一种流媒体服务器,包括处理器和存储器,所述存储器存储有指令当该指令被执行时,可使得所述流媒体服务器执行上面所述的方法。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。
工业实用性
本发明实施例实现了高效可靠的码流倍速播放,解决了倍速播放失败的问题。

Claims (11)

  1. 一种码流传输方法,包括:
    接收倍速播放请求;
    根据所述倍速播放请求,传输倍速码流;
    其中,所述倍速码流中,关键帧前插入了与所述关键帧对应的节目关联表PAT或节目映射表PMT信息。
  2. 根据权利要求1所述的码流传输方法,其中,根据所述倍速播放请求,传输倍速码流包括:
    根据所述倍速播放请求,确定待传输的倍速码流的起始关键帧;
    自所述起始关键帧起,在每个关键帧前均PAT或PMT信息。
  3. 根据权利要求1所述的码流传输方法,其中,根据所述倍速播放请求,传输倍速码流包括:
    根据所述倍速播放请求,确定待传输的倍速码流的起始关键帧;
    自所述起始关键帧起,判定每个关键帧对应的PAT或PMT信息是否发生变化;
    仅在发送所述PAT或PMT信息发生变化的关键帧前发送变化后的PAT或PMT信息。
  4. 根据权利要求1所述的码流传输方法,所述接收倍速播放请求的步骤之前,还包括:
    对实时存储的码流进行处理,得到并保存至少一个倍速值的倍速码流文件,其中,在所述倍速码流文件的每个关键帧前均插入了PAT或PMT信息或仅在所述倍速码流文件的PAT或PMT信息发生变化的关键帧前插入了PAT或PMT信息。
  5. 根据权利要求4所述的码流传输方法,其中,根据所述倍速播放请求,传输倍速码流包括:
    根据所述倍速播放码流请求,确定相应的倍速码流文件和起始关键帧;
    从所述倍速码流文件中的所述起始关键帧起,传输包含PAT或PMT信息的倍速码流文件。
  6. 一种码流传输装置,包括:
    请求接收模块,设置为:接收倍速播放请求;以及
    码流发送模块,设置为:根据所述倍速播放请求,传输倍速码流,其中,所述倍速码流中,关键帧前插入了与所述关键帧对应的节目关联表PAT或节目映射表PMT信息。
  7. 根据权利要求6所述的码流传输装置,其中,所述码流发送模块包括:
    第一起始位置判定单元,设置为:根据所述倍速播放请求,确定待传输的倍速码流的起始关键帧;
    第一信息插入单元,设置为:自所述起始关键帧起,在每个关键帧前插入PAT或PMT信息。
  8. 根据权利要求6所述的码流传输装置,其中,所述码流发送模块包括:
    第二起始位置判定单元,设置为:根据所述倍速播放请求,确定待传输倍速码流的起始关键帧;
    信息变化检查单元,设置为:自所述起始关键帧起,判定每个关键帧对应的PAT或PMT信息是否发生变化;
    第二信息插入单元,设置为:仅在所述PAT/PMT信息发生变化的关键帧前插入变化后的PAT/PMT信息。
  9. 根据权利要求6所述的码流传输装置,该装置还包括:
    倍速文件管理模块,设置为:对实时存储的码流进行处理,得到并保存至少一个倍速值的倍速码流文件,其中,在所述倍速码流文件的每个关键帧前均插入了PAT或PMT信息或仅在所述倍速码流文件的PAT或PMT信息发生变化的关键帧前插入PAT或PMT信息。
  10. 根据权利要求9所述的码流传输装置,其中,所述码流发送模块包 括:
    第三起始位置确定单元,设置为:根据所述倍速播放码流请求,确定相应的倍速码流文件和起始关键帧;
    倍速码流发送单元,设置为:从所述倍速码流文件中的所述起始关键帧起,发送包含PAT或PMT信息的倍速码流文件。
  11. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-5任一项所述的方法。
PCT/CN2015/084130 2014-12-12 2015-07-15 码流传输方法和装置 WO2016090916A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410768193.5A CN105744297A (zh) 2014-12-12 2014-12-12 码流传输方法和装置
CN201410768193.5 2014-12-12

Publications (1)

Publication Number Publication Date
WO2016090916A1 true WO2016090916A1 (zh) 2016-06-16

Family

ID=56106591

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/084130 WO2016090916A1 (zh) 2014-12-12 2015-07-15 码流传输方法和装置

Country Status (2)

Country Link
CN (1) CN105744297A (zh)
WO (1) WO2016090916A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412741A (zh) * 2022-08-31 2022-11-29 北京奇艺世纪科技有限公司 数据封装、解析方法、装置、电子设备及可读存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131881B (zh) * 2019-12-30 2022-09-02 深圳Tcl数字技术有限公司 Pvr录制方法、智能电视及计算机可读存储介质
CN114579152B (zh) * 2022-05-06 2022-07-29 中科亿海微电子科技(苏州)有限公司 一种fpga下载器及其下载速度调节方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060117357A1 (en) * 2004-11-30 2006-06-01 Surline Jack E Methods and systems for controlling trick mode play speeds
CN101980533A (zh) * 2010-11-12 2011-02-23 中国华录集团有限公司 一种基于索引文件实现传输流文件特技模式功能的方法
CN102025956A (zh) * 2009-09-23 2011-04-20 华为技术有限公司 网络流媒体快进快退播放的处理方法、装置和系统
CN102487458A (zh) * 2010-12-02 2012-06-06 中兴通讯股份有限公司 Ts文件的播放处理方法及装置
CN103067745A (zh) * 2011-10-24 2013-04-24 北大方正集团有限公司 一种视频数据的切分方法及装置、在线编辑方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7620180B2 (en) * 2003-11-03 2009-11-17 Sony Corporation Preparation of content for multiple conditional access methods in video on demand
CN101268692A (zh) * 2005-04-26 2008-09-17 皇家飞利浦电子股份有限公司 处理加密的数据流用于特技播放的设备和方法
US8526612B2 (en) * 2006-01-06 2013-09-03 Google Inc. Selective and persistent application level encryption for video provided to a client
CN101977326B (zh) * 2010-11-22 2012-05-09 天柏宽带网络科技(北京)有限公司 一种基于mpeg-2传输流的特技流生成方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060117357A1 (en) * 2004-11-30 2006-06-01 Surline Jack E Methods and systems for controlling trick mode play speeds
CN102025956A (zh) * 2009-09-23 2011-04-20 华为技术有限公司 网络流媒体快进快退播放的处理方法、装置和系统
CN101980533A (zh) * 2010-11-12 2011-02-23 中国华录集团有限公司 一种基于索引文件实现传输流文件特技模式功能的方法
CN102487458A (zh) * 2010-12-02 2012-06-06 中兴通讯股份有限公司 Ts文件的播放处理方法及装置
CN103067745A (zh) * 2011-10-24 2013-04-24 北大方正集团有限公司 一种视频数据的切分方法及装置、在线编辑方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412741A (zh) * 2022-08-31 2022-11-29 北京奇艺世纪科技有限公司 数据封装、解析方法、装置、电子设备及可读存储介质

Also Published As

Publication number Publication date
CN105744297A (zh) 2016-07-06

Similar Documents

Publication Publication Date Title
KR102267861B1 (ko) 대화형 텔레비전을 위한 트리거 파라미터 테이블의 확장
KR102004006B1 (ko) 대화형 텔레비전을 위한 트리거 파라미터 테이블의 확장
US9591361B2 (en) Streaming of multimedia data from multiple sources
US8473997B2 (en) Channel changing method, apparatus, and system
US20160066007A1 (en) Video playback method, media device, playback device, and multimedia system
KR101946861B1 (ko) 멀티미디어 방송 서비스의 미디어 데이터 동기화 방법 및 장치
US11930250B2 (en) Video assets having associated graphical descriptor data
WO2012096372A1 (ja) コンテンツ再生装置、コンテンツ再生方法、配信システム、コンテンツ再生プログラム、記録媒体、およびデータ構造
KR101939296B1 (ko) 양방향 서비스를 처리하는 장치 및 방법
CN107634930B (zh) 一种媒体数据的获取方法和装置
CN105681912A (zh) 一种视频播放方法和装置
US20180376195A1 (en) Live streaming quick start method and system
KR20110053178A (ko) 적응적인 스트리밍 방법 및 장치
CN106791988B (zh) 多媒体数据轮播方法和终端
KR20150048669A (ko) 양방향 서비스를 처리하는 장치 및 방법
US11356749B2 (en) Track format for carriage of event messages
CA2842810C (en) Fragmenting media content
US20230421867A1 (en) Systems and methods for summarizing missed portions of storylines
TWI577186B (zh) 第二內容串流在第二裝置上描繪時間之控制方法及控制裝置
WO2016050113A1 (zh) 一种业务实现方法、设备及存储介质
CN108494792A (zh) 一种flash播放器播放hls视频流的转换系统及其工作方法
WO2021050376A1 (en) Use of in-band metadata as basis to access reference fingerprints to facilitate content-related action
WO2016090916A1 (zh) 码流传输方法和装置
CN106331763B (zh) 无缝播放分片媒体文件的方法及实现该方法的装置
CN110087116B (zh) 多码率直播视频流剪辑方法、装置、终端及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15867217

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15867217

Country of ref document: EP

Kind code of ref document: A1