WO2011038565A1 - 一种流媒体音视频同步方法及系统 - Google Patents

一种流媒体音视频同步方法及系统 Download PDF

Info

Publication number
WO2011038565A1
WO2011038565A1 PCT/CN2009/076353 CN2009076353W WO2011038565A1 WO 2011038565 A1 WO2011038565 A1 WO 2011038565A1 CN 2009076353 W CN2009076353 W CN 2009076353W WO 2011038565 A1 WO2011038565 A1 WO 2011038565A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
video
decoded
packet
output
Prior art date
Application number
PCT/CN2009/076353
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 WO2011038565A1 publication Critical patent/WO2011038565A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4392Processing of audio elementary streams involving audio buffer management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43072Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of multiple content streams on the same device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer

Definitions

  • the present invention relates to mobile phone streaming media technology, and in particular to a streaming media audio and video synchronization method and system. Background technique
  • RTP protocol Real-time transmission. Protocol, referred to as RTP protocol, which is defined to work in one-to-one or one-to-many transmission. The purpose is to provide time information and stream synchronization. The order in which the player displays the received RTP packets is based on the RTP header.
  • the timestamp in the (header) and the sequence number are determined by the sequence number, which is a time value stored in the video frame when the video program is created.
  • the player uses it to determine a certain video. What time to play.
  • the serial number represents the order of each video packet, which the player uses to sort all arriving packets.
  • the terminal continuously receives media data packets from the network after starting playback.
  • the processing flow at this time is as follows:
  • the present invention provides a method for synchronizing audio and video audio and video.
  • the specific steps of the method are as follows: a method for synchronizing streaming audio and video, which is used for controlling audio and video synchronization when a streaming media file is played on a client, and is characterized in that the method Specific steps are as follows:
  • the client receives the streaming audio and video packets from the server, and buffers the received audio and video packets into a buffer, and performs framing and sorting;
  • the video decoder decodes the first video frame and outputs the display
  • the audio decoder decodes the first audio packet
  • the DMA interrupt function controls the DMA to transmit the decoded audio data to the audio hardware for playing
  • step B3 After the first audio packet is decoded and output is completed, the second video frame decoded in step B3 is immediately output and displayed by the DMA interrupt function control;
  • step B2 At the same time as the output of the second video frame, the second audio data packet decoded in step B2 is immediately output to the audio hardware for playback by the DMA interrupt function;
  • the present invention further provides a system for streaming audio and video synchronization, the system is applied to a mobile phone terminal, and the method includes:
  • the cache module is divided into an audio buffer module and a video buffer module for pre-decoding and decoding, and the pre-decode buffer is used for buffering the received un-decoded audio and video data packets, pre-decoding the undecoded audio video packets, and decoding the decoding. Reading the pre-decoded audio video data from the pre-decode buffer, wherein the decoding audio buffer module is divided into a first audio buffer module and a second audio buffer module;
  • the decoding module is divided into an audio decoding module and a video decoding module, and decodes the received pre-decoded audio and video data packets, wherein the audio decoding module decodes the audio data packet in units of data packets between adjacent video frames, and the first audio buffer module and the The second audio buffer module respectively buffers adjacent decoded audio data packets;
  • An input/output control module configured to control output of the decoded audio and video data, wherein the control selects and outputs the audio data packet decoded by the first audio buffer module or the second audio buffer module, and controls the first audio buffer module or the second The audio buffer packet decoded by the audio buffer module outputs the output of the next adjacent decoded video frame after completion.
  • the invention has the beneficial effects that the video is played according to the video time stamp relative to the prior art CPU, and the prior art will waste a lot of CPU resources.
  • the present invention directly controls the audio through the DMA interrupt function.
  • the synchronization of the video can achieve high-quality audio and video synchronization effects.
  • the data transmission is controlled by the DMA method, thereby reducing the task of the CPU and greatly improving the battery life of the mobile phone.
  • Figure 3 is a schematic diagram of the transmission of the audio video package
  • FIG. 2 is a block diagram of a synchronization system for streaming audio and video according to the present invention. detailed description
  • DMA mode Direct Memory Access, also known as group data transfer.
  • a device interface attempts to send data directly to another device over the bus (typically a large amount of data:), which first sends a DMA request signal to the CPU.
  • the peripherals use a special interface circuit of the DMA, the DMA controller (DMAC), to propose to the CPU the bus that takes over the control of the bus. Therefore, after receiving the signal, the CPU responds to the DMA signal according to the priority of the DMA signal and the order in which the DMA request is made after the end of the current bus cycle.
  • the CPU responds to a DMA request to a device interface, it gives up control of the bus. Therefore, under the management of the DMA controller, the peripherals and the memory directly exchange data without CPU intervention. After the data transfer is completed, the device interface sends a DMA end signal to the CPU to return the bus control.
  • the peripheral can issue a DMA request to the CPU through the DMA controller:
  • An improvement of the present invention is to design a DMA interrupt function to trigger DMA mode transmission of data, including controlling the output of decoded video data by DMA, controlling the output of decoded audiovisual data, and controlling the transmission of undecoded audiovisual data for decoding.
  • a method for synchronizing audio and video audio and video is used to control audio and video synchronization of a streaming media file during playback by a client.
  • the specific steps of the method are as follows:
  • the mobile client receives the RTP data packet from the server, and judges the received data according to the payload type (Payload Type field), serial number (Sequence Number field), and time stamp (Time Stamp field) of the RTP data packet.
  • the packet type is an audio/video data packet or a video data packet
  • the packet type is an audio/video data packet or a video data packet
  • A1 respectively creating an audio stream data link table and a video stream data link table in the buffer;
  • A2 determining whether the type of the received data packet is an audio data packet or a video data packet;
  • A3 If it is an audio data packet, it is stored in the audio data link table, and if it is a video data packet, it is stored in the video data link table.
  • FIG. 2 is a schematic diagram of an audio frame and a video frame after buffering before buffer decoding, as shown in the figure, including time slots corresponding to video frames v1, v2, and v3, t1, t2, t3, v1, and v2 (
  • the playing time is t2-tl) including an audio data packet T1 from the audio frames al0, al l; v2, v3 playing time (playing time t2-tl) including an audio data packet T2 from audio frames a20, a21, a22 composition.
  • Bl decoding the first video frame v1 after the decoding of the video decoder is controlled by the DMA interrupt function and outputting the display, and decoding the first audio packet T1 data in the first buffer in units of audio data packets.
  • the DMA interrupt function is used to control the DMA mode to transmit the decoded audio data in the decoded audio data T1 (well known, this is the process of playing while decoding, not waiting for all the al0 and al1 in T1 to be decoded. Play), output to audio hardware for playback;
  • the data packet T2 is a unit for decoding the second audio packet data in the second buffer;
  • the video decoder decodes the second video frame v2, and the decoded second video frame v2 waits for an output instruction, that is, blocks the decoded second video frame output;
  • step B3 after the first audio packet is decoded and output is completed, the second video frame decoded in step B3 is immediately output and displayed by the DMA interrupt function in a DMA manner;
  • the second audio data packet T2 decoded in step B2 is immediately outputted to the audio hardware for playback by the DMA interrupt function, and the second one in the second buffer
  • the audio frames a20, a21, a22 included in the audio data packet T2 may all have been decoded or only partially decoded, but do not affect the output of the decoded portion, and it is also known to output while decoding.
  • the entire streaming media file is composed of a plurality of consecutive video frames, and the second video frame is followed by the third, fourth, and Nth video frames, and the above steps are repeated to decode the audio data packets and videos that are subsequently stored in the buffer area.
  • the frame, until the entire streaming media file is played, further includes inputting a pause, fast forward, and reverse command, the audio and video decoders corresponding to pause decoding, and decoding according to the fast forward and reverse time positions.
  • FIG. 3 is a system for streaming audio and video synchronization, the system is applied to a mobile phone terminal, and the method includes:
  • the cache module is divided into an audio buffer module and a video buffer module for pre-decoding and decoding, and the pre-decode buffer is used for buffering the received un-decoded audio and video data packets, pre-decoding the undecoded audio video packets, and decoding the decoding.
  • Reading the pre-decoded audio video data from the pre-decode buffer wherein the decoding audio buffer module is divided into a first audio buffer module and a second audio buffer module;
  • the decoding module is divided into an audio decoding module and a video decoding module, and decodes the received pre-decoded audio and video data packets, wherein the audio decoding module decodes the audio data packet in units of data packets between adjacent video frames, referring to FIG. 2,
  • the audio buffer module and the second audio buffer module respectively buffer adjacent decoded audio data packets T1 and T2;
  • An input/output control module configured to control output of the decoded audio and video data, wherein the control selects and outputs the audio data packet decoded by the first audio buffer module or the second audio buffer module, for example, after playing the first video frame vl
  • the first cache decoded T1 audio output controlling the output of the next adjacent decoded video frame after the audio data packet decoded by the first audio buffer module or the second audio buffer module is completed, for example, the first cache module is playing After the decoded T1, the control module controls the output of the decoded v2 of the adjacent video frame after T1.
  • the input/output control module further controls to decode the input pre-decoded audio data packet by the first audio buffer module or the second audio buffer module after the output of the audio data packet is completed, for example, when the T1 output decoded by the first audio buffer module is completed, due to T2
  • a pre-decoded audio packet T3 (not shown) should be input to the first buffer.
  • the input/output control module selects an audio data packet decoded from the first audio buffer module or the second audio buffer module according to the decoded previous adjacent video frame data, that is, for example, playing the decoded first frame video frame vl Then, T1 audio decoding data is outputted from the first buffer.

Landscapes

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

Description

说 明 书 一种流媒体音视频同步方法及系统 技术领域
本发明涉及手机流媒体技术, 具体地说,涉及一种流媒体音视频同步方法 及系统。 背景技术
随着网络电视、通信技术及多媒体产品的迅速发展,流媒体技术成为近年 来兴起的一种在线播放技术, 即边下载边播放, 播放器并不用等到多媒体文件 全部下载到本地储存后再播放, 而是下载的同时进行播放。播放器在客户端的 内存中开辟缓冲区,通常是几兆字节的空间, 播放器等到缓冲区有足够的数据 后开始解码播放, "流媒体"传输过程中,所使用的传输协议为实时传输协议, 简称 RTP协议, 该协议被定义在一对一或者一对多的传输情况下工作, 目的是 提供时间信息和实现流同步, 播放器对收到的 RTP数据包的显示顺序是根据 RTP包头 (header) 中的时间戳 (timestamp) 和序列号 ( sequence number ) 来 确定的, 时间戳是视频节目采集制作时存储到视频帧内的一种时间值, 播放器 利用它来决定某一视频在什么时间播放。 序列号则代表了每个视频包的顺序, 播放器利用它来对到达的所有数据包进行排序。
在流媒体播放技术中,如何能够在接收端正确的恢复音频和视频之之间的 关系, 即实现流媒体同步播放, 成为业内人士所共同关心的问题之一。
在现有的流媒体音视频同步播放的技术中,以一个 IP网络流媒体音视频同 步播放技术为例,终端在开始播放后,就不断的接收到来自网络的媒体数据包。 这时的处理流程如下:
( 1 ) 首先通过 RTP PayloadQ TP载荷)判断媒体类型, 得知其是那种格式 的音频或视频媒体;
(2 ) 媒体类型, 将媒体数据及其 pts (时间标签:)送到内存中的音频或视频 缓冲区;
(3 ) a.当视频续存区内视频数据达到一定数目后, 开启定时器, 根据视 频数据的 pts将其送到视频解码器处理, 并输出视频; b.当音频缓存区内音频数据达到一定数目后, 开启定时器, 根据音频数据 的 pts, 将音频缓存区内音频数据解码, 并把解码输出的 PCM数据送到音频芯 片 /声卡处理, 并输出音频。
我们会发现上述技术存在一个问题是不能确定出一次音频解码任务的解 码量, 和多长时段进行一次音频解码处理, 还有如何查询视频时间戳。显然如 果一次解码音频包过多,会耽误视频解码时间,手机资源有限,只有一个 CPU。 并且频繁的检查视频时间戳会增加无意义的任务切换率, 导致浪费 CPU利用 率, 对手机来说也将降低电池的续航能力。
鉴于此, 实有必要提出一种改进的方法以克服现有技术的缺陷。 发明内容
本发明一种流媒体音频视频同步的方法, 该方法具体步骤如下:一种流媒 体音频视频同步的方法, 用于控制流媒体文件在客户端播放时的音视频同步, 其特征在于, 该方法具体步骤如下:
A: 客户端从服务端接收流媒体音频、 视频包, 并将接收的音频、 视频包 缓存到缓冲区中, 并进行组帧和排序;
B1 : 视频解码器解码启动后解码第一视频帧并输出显示, 同时音频解码 器解码第一个音频包, 由 DMA中断函数来控制通过 DMA方式传输已解码的 音频数据输出至音频硬件进行播放;
B2: 在音频解码器解码第一个音频包并播放的同时, 音频解码器解码第 二个音频数据包,第二个音频数据包等待输出指令, 即阻塞已解码的第二个音 频数据输出;
B3 : 在音频解码器解码第一个音频包并播放的同时, 视频解码器解码第 二视频帧,解码后的第二帧频视频帧等待输出指令, 即阻塞已解码的第二视频 帧输出;
C1 : 当第一个音频包解码并输出完成之后, 由 DMA中断函数控制立即输 出步骤 B3中解码的第二视频帧并显示;
C2: 第二视频帧输出的同时, 由 DMA中断函数控制立即输出步骤 B2中 已解码的第二个音频数据包至音频硬件进行播放;
D: 重复上述步骤解码后续存入缓存区的音频数据包和视频帧, 直到播放 完整个流媒体文件。 另外, 本发明还提供一种流媒体音频视频同步的系统, 该系统应用于手机 终端, 其特征在于: 包括:
缓存模块, 分为预解码和解码时音频缓存模块与视频缓存模块, 预解码缓 存用于缓存接收到的未解码音视频数据包,对未解码的音频视频包进行预解码 处理,解码时缓存则从预解码缓存中读取经过预解码的音频视频数据,解码其 中解码时音频缓存模块分为第一音频缓存模块与第二音频缓存模块;
解码模块, 分为音频解码模块与视频解码模块,解码接收的预解码音视频 数据包, 其中音频解码模块以相邻视频帧之间的数据包为单位解码音频数据 包, 第一音频缓存模块与第二音频缓存模块分别缓存相邻的解码的音频数据 包;
输入输出控制模块,用于控制解码后的音频及视频数据的输出, 其中控制 选择输出所述第一音频缓存模块或第二音频缓存模块解码的音频数据包,控制 第一音频缓存模块或第二音频缓存模块解码的音频数据包输出完成后的下一 个相邻的解码的视频帧输出。
本发明的有益效果在于, 相对于现有技术 CPU要不断的轮询音频播放时 间来而根据视频时间戳来播放视频, 现有技术将大量浪费 CPU资源, 本发明 直接通过 DMA中断函数来控制音频视频的同步,可达到优质的音视频同步效 果, 别外, 通过 DMA方式控制数据传输, 以此减少 CPU的工作任务, 大大 提高手机电池的续航能力。 附图说明
图 1为本发明方法流媒体音频视频的同步流程图;
图 3为本音频视频包传输示意图;
图 2为本发明流媒体音频视频的同步系统框图。 具体实施方式
下面结合附图来说明本发明具体实施。
DMA方式, Direct Memory Access, 也称为成组数据传送方式。
工作原理: 一个设备接口试图通过总线直接向另一个设备发送数据 (一般 是大批量的数据:), 它会先向 CPU发送 DMA请求信号。外设通过 DMA的一种专 门接口电路一一 DMA控制器(DMAC), 向 CPU提出接管总线控制权的总线请 求, CPU收到该信号后, 在当前的总线周期结束后, 会按 DMA信号的优先级 和提出 DMA请求的先后顺序响应 DMA信号。 CPU对某个设备接口响应 DMA请 求时, 会让出总线控制权。 于是在 DMA控制器的管理下, 外设和存储器直接 进行数据交换, 而不需 CPU干预。 数据传送完毕后, 设备接口会向 CPU发送 DMA结束信号, 交还总线控制权。
实现 DMA传送的基本操作如下:
( 1 ) 外设可通过 DMA控制器向 CPU发出 DMA请求:
(2 ) CPU响应 DMA请求, 系统转变为 DMA工作方式, 并把总线控 制权交给 DMA控制器;
(3 ) 由 DMA控制器发送存储器地址, 并决定传送数据块的长度;
(4) 执行 DMA传送;
(5 ) DMA操作结束, 并把总线控制权交还 CPU。
本发明的改进在于设计一个 DMA中断函数来触发 DMA方式传输数据, 包括通过 DMA方式控制已解码视频数据的输出,控制已解码音视数据的输出 以及控制传输未解码的音视数据进行解码。
如图 1所示为一种流媒体音频视频同步的方法,用于控制流媒体文件在客 户端播放时的音视频同步, 该方法具体步骤如下:
A: 手机客户端从服务端接收 RTP数据包, 按照 RTP数据包的载荷类型 (Payload Type字段)、 序列号 (Sequence Number字段)以及时间戳 (Time Stamp 字段)的不同, 判断所收到的数据包类型是音视频数据包还是视频数据包, 并 将接收的音频、视频包缓存到缓冲区中, 并进行组帧和排序, 此过程为解码前 缓存, 只对数据包作预解码处理, 例如将音视数据包分为若干音频帧, 具体如 下;
A1: 在所述缓冲区中分别创建音频流数据链表和视频流数据链表; A2: 判断所收到的数据包的类型是音频数据包还是视频数据包;
A3: 如果是音频数据包则在所述音频数据链表中存入, 如果是视频数据 包则在所述视频数据链表中存入。
图 2所示为缓存解码前缓存后音频帧、视频帧的示意图, 如图所示包括视 频帧 vl、 v2、 v3分别对应的时间戳为 tl、 t2、 t3, vl、 v2之间播放时间 (播放 时间为 t2- tl)包括一个音频数据包 T1由音频帧 al0、 al l ; v2、 v3之间播放 时间 (播放时间为 t2- tl)包括一个音频数据包 T2由音频帧 a20、 a21、 a22组成。 Bl : 视频解码器解码启动后解码第一视频帧 vl由 DMA中断函数控制并 输出显示, 同时以音频数据包为单位在第一缓存中对第一个音频包 T1数据进 行解码,
由 DMA中断函数来控制以 DMA方式传输已解码的音频数据 T1中已解 码的音频数据 (公知的, 此为边解码边播放的过程, 并不是等 T1中的 al0、 al l全部解码完后才播放) , 输出至音频硬件进行播放;
B2: 在 T1被解码并播放的同时, 音频解码器解码第二个音频数据包 T2, 第二个音频数据包等待输出指令, 即阻塞已解码的第二个音频数据输出,在这 里也是以音频数据包 T2为单位在在第二缓存中对第二个音频包数据进行解 码;
B3 : 在 T1被解码并播放的同时, 视频解码器解码第二视频帧 v2, 解码后 的第二视频帧 v2等待输出指令, 即阻塞已解码的第二视频帧输出;
C1 :当第一个音频包解码并输出完成之后,由 DMA中断函数控制以 DMA 方式立即输出步骤 B3中解码的第二视频帧并显示;
C2: 解码的第二视频帧 v2并显示的同时, 由 DMA中断函数控制立即输 出步骤 B2中已解码的第二个音频数据包 T2至音频硬件进行播放, 此时第二 缓存中的第二个音频数据包 T2包含的音频帧 a20、 a21、 a22可能全部已被解 码完或者只有部分被解码,但并不影响已解码部分的输出, 公知地也可以边解 码边输出;
D: 公知的, 整个流媒体文件由若干连续视频帧组成, 第二视频帧之后为 第三、 第四、 、 、 第 N视频帧, 重复上述步骤解码后续存入缓存区的音频数 据包和视频帧, 直到播放完整个流媒体文件, 进一步还包括输入暂停、 快进、 倒退命令时, 音频、 视频解码器对应为暂停解码、 根据快进、 倒退的时间位置 进行解码。
图 3所示为, 一种流媒体音频视频同步的系统, 该系统应用于手机终端, 其特征在于: 包括:
缓存模块, 分为预解码和解码时音频缓存模块与视频缓存模块, 预解码缓 存用于缓存接收到的未解码音视频数据包,对未解码的音频视频包进行预解码 处理,解码时缓存则从预解码缓存中读取经过预解码的音频视频数据,解码其 中解码时音频缓存模块分为第一音频缓存模块与第二音频缓存模块; 解码模块, 分为音频解码模块与视频解码模块,解码接收的预解码音视频 数据包, 其中音频解码模块以相邻视频帧之间的数据包为单位解码音频数据 包, 参照图 2, 第一音频缓存模块与第二音频缓存模块分别缓存相邻的解码的 音频数据包 T1和 T2;
输入输出控制模块,用于控制解码后的音频及视频数据的输出, 其中控制 选择输出所述第一音频缓存模块或第二音频缓存模块解码的音频数据包,例如 在播放第一视频帧 vl后, 则第一缓存解码的 T1音频输出; 控制第一音频缓 存模块或第二音频缓存模块解码的音频数据包输出完成后的下一个相邻的解 码的视频帧输出, 例如第一缓存模块在播放解码后的 T1后, 则控制模块控制 T1后相邻的视频帧已解码的 v2的输出。输入输出控制模块还控制向音频数据 包输出完成后的第一音频缓存模块或第二音频缓存模块解码输入预解码的音 频数据包, 例如当第一音频缓存模块解码的 T1输出完成后, 由于 T2在第二 缓存中解码, 则应该向第一缓存输入预解码的音频数据包 T3 (未图示) 。 输 入输出控制模块根据解码的已输出的上一个相邻视频帧数据来选择从第一音 频缓存模块或第二音频缓存模块解码的音频数据包,即例如在播放已解码的第 一帧视频帧 vl则选择从第 1缓存输出 T1音频解码数据。
以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发 明的精神和原则之内所作的任何修改、等同替换和改进等, 均应包含在本发明 的保护范围之内。

Claims

权 利 要 求 书
1、 一种流媒体音频视频同步的方法, 用于控制流媒体文件在客户端播放 时的音视频同步, 其特征在于, 该方法具体步骤如下:
A: 客户端从服务端接收流媒体音频、 视频包, 并将接收的音频、 视频包 缓存到缓冲区中, 并进行组帧和排序;
B1 : 视频解码器解码解码收到的视频包中的第一视频帧并输出显示, 同 时音频解码器解码收到的音频包中的第一个音频包, 由 DMA中断函数来控制 通过 DMA方式传输已解码的音频数据输出至音频硬件进行播放;
B2: 在音频解码器解码第一个音频包并播放的同时, 音频解码器解码收 到的音频包中的第二个音频数据包并等待输出指令以阻塞已解码的第二个音 频数据输出;
B3 : 在音频解码器解码第一个音频包并播放的同时, 视频解码器解码收 到的音频包中的第二视频帧并等待输出指令以阻塞已解码的第二视频帧输出;
C1 : 当第一个音频包解码并输出完成之后, 由 DMA中断函数控制立即输 出步骤 B3中解码的第二视频帧并显示;
C2: 第二视频帧输出的同时, 由 DMA中断函数控制立即输出步骤 B2中 已解码的第二个音频数据包至音频硬件进行播放;
D: 重复上述步骤解码后续存入缓存区的音频包和视频帧, 直到播放完整 个流媒体文件。
2、 如权利要求 1所述的流媒体音频视频同步的方法, 其特征在于, 步骤 B1中以音频包为单位在第一缓存中对第一个音频包进行解码,步骤 B2中以音 频包为单位在第二缓存中对第二个音频包进行解码。
3、 如权利要求 2所述的流媒体音频视频同步的方法, 其特征在于, 所述 视频帧包括时间戳信息,第一个音频包为第二视频帧时间戳减去第一帧视频帧 时间戳所得播放时间内的音频包,第二个音频包为第三视频帧时间戳减去第二 视频帧的时间戳所得播放时间内的音频包。
4、 如权利要求 3所述的流媒体音频视频同步的方法, 其特征在于, 当第 一缓存解码的第一音频包输出完成后,继续解码收到的音频包中的第三个音频 包; 当第二缓存解码的第二音频包输出完成后, 继续解码收到的音频包中的第 四个音频包, 以此交替进行后续音频包的解码任务。
5、 如权利要求 1所述的流媒体音频视频同步的方法, 其特征在于, 所述 步骤 D进一步还包括输入暂停、 快进、 倒退命令时, 音频、 视频解码器对应 为暂停解码、 根据快进、 倒退的时间位置进行解码。
6、 如权利要求 1所述的流媒体音频视频同步的方法, 其特征在于, 步骤 A进一步分为:
A1: 在所述缓冲区中分别创建音频流数据链表和视频流数据链表; A2 : 判断所收到的数据包的类型是音频数据包还是视频数据包;
A3: 如果是音频包则在所述音频数据链表中存入, 如果是视频包则在所 述视频数据链表中存入。
7、 如权利要求 6所述的流媒体音频视频同步的方法, 其特征在于, 步骤 A中的组帧和排序过程根据对应音、视频数据包中的载荷类型、序列号和时间 戳进行。
8、 一种流媒体音频视频同步的系统, 该系统应用于手机终端, 其特征在 于: 包括:
缓存模块, 分为预解码和解码时音频缓存模块与视频缓存模块, 预解码缓 存用于缓存接收到的未解码音视频包, 对未解码的音频视频包进行预解码处 理,解码时缓存则从预解码缓存中读取经过预解码的音频视频包, 其中解码时 音频缓存模块分为第一音频缓存模块与第二音频缓存模块;
解码模块, 分为音频解码模块与视频解码模块,解码接收的预解码音视频 包, 其中音频解码模块以相邻视频帧之间的数据包为单位解码音频包,第一音 频缓存模块与第二音频缓存模块分别缓存相邻的解码的音频包;
输入输出控制模块,用于控制解码后的音频及视频包的输出, 其中控制选 择输出所述第一音频缓存模块或第二音频缓存模块解码的音频包,控制第一音 频缓存模块或第二音频缓存模块解码的音频包输出完成后的下一个相邻的解 码的视频帧输出。
9、 如权利要求 8所述的流媒体音频视频同步的系统, 其特征在于, 输入 输出控制模块还控制向音频包输出完成后的第一音频缓存模块或第二音频缓 存模块解码输入未解码的音频包。
10、如权利要求 8所述的流媒体音频视频同步的系统, 其特征在于, 输入 输出控制模块根据解码的已输出的上一个相邻视频帧数据来选择从第一音频 缓存模块或第二音频缓存模块解码的音频包。
PCT/CN2009/076353 2009-09-29 2009-12-31 一种流媒体音视频同步方法及系统 WO2011038565A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910190511.3 2009-09-29
CN2009101905113A CN101674486B (zh) 2009-09-29 2009-09-29 一种流媒体音视频同步方法及系统

Publications (1)

Publication Number Publication Date
WO2011038565A1 true WO2011038565A1 (zh) 2011-04-07

Family

ID=42021435

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/076353 WO2011038565A1 (zh) 2009-09-29 2009-12-31 一种流媒体音视频同步方法及系统

Country Status (2)

Country Link
CN (1) CN101674486B (zh)
WO (1) WO2011038565A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338386A (zh) * 2013-07-10 2013-10-02 航天恒星科技有限公司 基于简化时间戳的音视频同步方法
CN113825014A (zh) * 2021-09-10 2021-12-21 网易(杭州)网络有限公司 多媒体内容播放方法、装置、计算机设备和存储介质
CN114268830A (zh) * 2021-12-06 2022-04-01 咪咕文化科技有限公司 云导播同步方法、装置、设备及存储介质
CN115359810A (zh) * 2022-08-11 2022-11-18 维沃移动通信有限公司 数据处理方法、设备及可读存储介质

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674486B (zh) * 2009-09-29 2013-05-08 深圳市融创天下科技股份有限公司 一种流媒体音视频同步方法及系统
CN103281528A (zh) * 2013-04-10 2013-09-04 深圳康佳通信科技有限公司 一种流媒体解码方法、系统及移动终端
CN104853239B (zh) * 2015-04-27 2018-08-31 浙江生辉照明有限公司 音视频同步播放控制方法和系统
CN106331820B (zh) * 2015-06-29 2020-01-07 成都鼎桥通信技术有限公司 音视频的同步处理方法和装置
CN105916058B (zh) * 2016-05-05 2019-09-20 青岛海信宽带多媒体技术有限公司 一种流媒体缓冲播放方法、装置及显示设备
US10231001B2 (en) 2016-05-24 2019-03-12 Divx, Llc Systems and methods for providing audio content during trick-play playback
CN106792070B (zh) * 2016-12-19 2020-06-23 广东威创视讯科技股份有限公司 一种音视频数据dma传输方法及装置
CN108449617B (zh) * 2018-02-11 2020-04-03 浙江大华技术股份有限公司 一种控制音视频同步的方法及装置
CN108566552B (zh) * 2018-04-20 2021-05-25 四川长虹网络科技有限责任公司 适用于数字机顶盒的多媒体播放方法及系统
CN109981590A (zh) * 2019-02-28 2019-07-05 浙江工业大学 一种基于b/s架构的流媒体音视频同步播放方法
CN111726669B (zh) * 2019-03-18 2022-12-23 浙江宇视科技有限公司 一种分布式解码设备及其音视频同步的方法
CN111510759B (zh) * 2020-03-17 2023-10-13 视联动力信息技术股份有限公司 视频显示方法、装置及可读存储介质
CN112911365B (zh) * 2021-02-02 2024-03-29 卡莱特云科技股份有限公司 一种音频同步播放方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004052021A1 (en) * 2002-12-04 2004-06-17 Koninklijke Philips Electronics N.V. Method of automatically testing audio/video synchronization
US20070299983A1 (en) * 2006-06-21 2007-12-27 Brothers Thomas J Apparatus for synchronizing multicast audio and video
CN101271720A (zh) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 一种手机流媒体音视频的同步方法
CN101466044A (zh) * 2007-12-19 2009-06-24 康佳集团股份有限公司 一种流媒体音视频同步播放的方法及其系统
CN101674486A (zh) * 2009-09-29 2010-03-17 深圳市融创天下科技发展有限公司 一种流媒体音视频同步方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193311B (zh) * 2006-12-21 2010-10-13 腾讯科技(深圳)有限公司 一种p2p系统中音视频数据的同步方法
CN101188770A (zh) * 2007-12-17 2008-05-28 上海广电(集团)有限公司中央研究院 一种多进程控制的音视频同步输出方法
CN100579237C (zh) * 2007-12-29 2010-01-06 惠州华阳通用电子有限公司 一种地面广播数字电视接收装置、音视频同步方法及系统
CN101394469B (zh) * 2008-10-29 2011-04-06 北京创毅视讯科技有限公司 一种音视频同步方法、装置及一种数字电视芯片

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004052021A1 (en) * 2002-12-04 2004-06-17 Koninklijke Philips Electronics N.V. Method of automatically testing audio/video synchronization
US20070299983A1 (en) * 2006-06-21 2007-12-27 Brothers Thomas J Apparatus for synchronizing multicast audio and video
CN101466044A (zh) * 2007-12-19 2009-06-24 康佳集团股份有限公司 一种流媒体音视频同步播放的方法及其系统
CN101271720A (zh) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 一种手机流媒体音视频的同步方法
CN101674486A (zh) * 2009-09-29 2010-03-17 深圳市融创天下科技发展有限公司 一种流媒体音视频同步方法及系统

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338386A (zh) * 2013-07-10 2013-10-02 航天恒星科技有限公司 基于简化时间戳的音视频同步方法
CN103338386B (zh) * 2013-07-10 2016-01-13 航天恒星科技有限公司 基于简化时间戳的音视频同步方法
CN113825014A (zh) * 2021-09-10 2021-12-21 网易(杭州)网络有限公司 多媒体内容播放方法、装置、计算机设备和存储介质
CN113825014B (zh) * 2021-09-10 2024-06-11 网易(杭州)网络有限公司 多媒体内容播放方法、装置、计算机设备和存储介质
CN114268830A (zh) * 2021-12-06 2022-04-01 咪咕文化科技有限公司 云导播同步方法、装置、设备及存储介质
CN114268830B (zh) * 2021-12-06 2024-05-24 咪咕文化科技有限公司 云导播同步方法、装置、设备及存储介质
CN115359810A (zh) * 2022-08-11 2022-11-18 维沃移动通信有限公司 数据处理方法、设备及可读存储介质

Also Published As

Publication number Publication date
CN101674486A (zh) 2010-03-17
CN101674486B (zh) 2013-05-08

Similar Documents

Publication Publication Date Title
WO2011038565A1 (zh) 一种流媒体音视频同步方法及系统
WO2023024834A9 (zh) 一种游戏数据处理方法、装置及存储介质
WO2009039741A1 (fr) Procédé et dispositif permettant la commutation de chaînes iptv
US8244897B2 (en) Content reproduction apparatus, content reproduction method, and program
TW200820777A (en) System and method of audio/video streaming
WO2021179557A1 (zh) 视频流播放方法、系统、终端及存储介质
WO2018001184A1 (zh) 频道快速切换的方法、服务器和机顶盒
CA2908718C (en) System and method for streaming a media file from a server to a client device
WO2020001315A1 (zh) 一种视频播放质量检测方法和装置
WO2009137972A1 (zh) 视音频同流传输的方法、系统及相应的接收方法和设备
CN103475927A (zh) 在线视频实时变速播放方法及系统
WO2014079303A1 (zh) 一种视频多画面合成方法、装置和系统
TWI690202B (zh) 用於控制媒體播放器中之串流緩衝器的方法與相關的緩衝裝置
TW200926806A (en) Content reproduction apparatus, content reproduction method, and content reproduction system
JP5428734B2 (ja) ネットワーク機器、情報処理装置、ストリーム切替方法、情報処理方法、プログラムおよびコンテンツ配信システム
CN101729755B (zh) 一种多媒体终端
JP2003330496A (ja) オーディオストリームのバッファリング制御方法及びその装置
JP5562436B2 (ja) 映像信号出力方法及び映像情報再生装置
WO2018054349A1 (zh) 数据发送方法、数据接收方法及其装置和系统
JP2003209594A (ja) プログラム、記録媒体、並びに情報送信装置および方法
JP2003209823A (ja) ストリーム送受信システムおよびストリーム送受信方法
CN101720033B (zh) 一种视频传输设备及其usb传输的装置及方法
CN101997872B (zh) 降低流媒体码流发送抖动的方法及流媒体服务器
JP3749715B2 (ja) 画像データ送出装置および画像データ送出方法
JP2000083064A (ja) トランスポ―トストリ―ム処理装置

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

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 10/08/2012)

122 Ep: pct application non-entry in european phase

Ref document number: 09849973

Country of ref document: EP

Kind code of ref document: A1