[go: up one dir, main page]

CN106341713B - Multimedia synchronous playing method, device, system and terminal - Google Patents

Multimedia synchronous playing method, device, system and terminal Download PDF

Info

Publication number
CN106341713B
CN106341713B CN201610882817.5A CN201610882817A CN106341713B CN 106341713 B CN106341713 B CN 106341713B CN 201610882817 A CN201610882817 A CN 201610882817A CN 106341713 B CN106341713 B CN 106341713B
Authority
CN
China
Prior art keywords
media data
system clock
playback device
data packet
playback
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610882817.5A
Other languages
Chinese (zh)
Other versions
CN106341713A (en
Inventor
谭春宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610882817.5A priority Critical patent/CN106341713B/en
Publication of CN106341713A publication Critical patent/CN106341713A/en
Application granted granted Critical
Publication of CN106341713B publication Critical patent/CN106341713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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
    • 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/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4122Peripherals receiving signals from specially adapted client devices additional display device, e.g. video projector
    • 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/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Landscapes

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

Abstract

The embodiment of the invention provides a multimedia synchronous playing method, a device, a system and a terminal; the embodiment of the invention adopts the media data packet which is played and cached, then detects whether the system clock is synchronous with the system clock of the reference playing device, if not, the current playing progress information of the reference playing device is obtained, the target media data packet which needs to be played currently is determined from the cached media data packet according to the playing progress information, and the target media data packet is played. The scheme can improve the synchronism of multimedia playing among the multimedia playing devices.

Description

一种多媒体同步播放方法、装置、系统及终端A multimedia synchronous playback method, device, system and terminal

技术领域technical field

本发明涉及同步播放技术领域,具体涉及一种多媒体同步播放方法、装置、系统及终端。The present invention relates to the technical field of synchronous playback, in particular to a multimedia synchronous playback method, device, system and terminal.

背景技术Background technique

随着生活水平的提高,家庭影音设备在人们的生活中扮演着重要的角色。当前,将多个多媒体播放设备(例如,音箱、播放器等)以及控制设备通过有线或无线网络互相连接,组成一个多媒体播放系统,同步播放相同的多媒体如音乐,已经得到广泛的应用。With the improvement of living standards, home audio-visual equipment plays an important role in people's lives. At present, it has been widely used to connect multiple multimedia playback devices (for example, speakers, players, etc.) and control devices to each other through a wired or wireless network to form a multimedia playback system, and to play the same multimedia such as music synchronously.

上述多媒体播放系统中,每个多媒体播放设备都具有独立的时钟系统。各个播放设备根据其自身的时钟系统来播放多媒体。然而,各个多媒体播放设备以及参考设备(一般为控制设备)的时钟系统并不总是同步的。各个多媒体播放设备以及参考设备彼此之间可能存在细微的时差。当多个多媒体播放设备播放相同的音乐时,上述细微的时差导致各个多媒体播放设备的播放进度不一致,由此造成多媒体播放设备之间播放多媒体的同步性比较低。In the above multimedia playing system, each multimedia playing device has an independent clock system. Each playback device plays multimedia according to its own clock system. However, the clock systems of various multimedia playback devices and reference devices (generally control devices) are not always synchronized. There may be a slight time difference between each multimedia playback device and the reference device. When multiple multimedia playback devices play the same music, the above-mentioned slight time difference leads to inconsistencies in the playback progress of each multimedia playback device, thus resulting in relatively low synchronization of multimedia playback among multimedia playback devices.

发明内容Contents of the invention

本发明实施例提供一种多媒体同步播放方法、装置、系统及终端,可以提高多媒体播放设备之间播放多媒体的同步性。Embodiments of the present invention provide a multimedia synchronous playing method, device, system and terminal, which can improve the synchronization of playing multimedia between multimedia playing devices.

本发明实施例提供一种多媒体同步播放方法,包括:An embodiment of the present invention provides a multimedia synchronous playback method, including:

播放缓存的媒体数据包;Play buffered media packets;

检测系统时钟与参考播放设备的系统时钟是否同步;Detect whether the system clock is synchronized with the system clock of the reference playback device;

若否,则获取所述参考播放设备当前的播放进度信息;If not, then obtain the current playback progress information of the reference playback device;

根据所述播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放所述目标媒体数据包。From the buffered media data packets according to the playing progress information, determine a target media data packet currently to be played, and play the target media data packet.

相应的,本发明实施例还提供一种多媒体同步播放装置,包括:Correspondingly, the embodiment of the present invention also provides a multimedia synchronous playback device, including:

播放单元,用于播放缓存的媒体数据包;A playback unit, configured to play the cached media packets;

检测单元,用于检测系统时钟与参考播放设备的系统时钟是否同步;A detection unit is used to detect whether the system clock is synchronized with the system clock of the reference playback device;

获取单元,用于在检测单元检测系统时钟与参考播放设备的系统时钟不同步时,获取所述参考播放设备当前的播放进度信息;An acquisition unit, configured to acquire the current playback progress information of the reference playback device when the detection unit detects that the system clock is not synchronized with the system clock of the reference playback device;

同步单元,用于根据所述播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放所述目标媒体数据包。The synchronizing unit is configured to determine a target media data packet currently to be played from the buffered media data packets according to the playing progress information, and play the target media data packet.

相应的,本发明实施例还提供一种终端,包括:Correspondingly, the embodiment of the present invention also provides a terminal, including:

存储有可执行程序代码的存储器;a memory storing executable program code;

与所述存储器耦合的处理器;a processor coupled to the memory;

所述处理器调用所述存储器中存储的所述可执行程序代码,执行本发明实施例提供的任一多媒体同步播放方法。The processor invokes the executable program code stored in the memory to execute any multimedia synchronous playing method provided by the embodiments of the present invention.

相应的,本发明实施例还提供了一种多媒体同步播放系统,包括:控制设备和至少一个播放设备;所述控制设备与所述播放设备连接;所述播放设备用于执行本发明实施例提供的任一多媒体同步播放方法。Correspondingly, an embodiment of the present invention also provides a multimedia synchronous playback system, including: a control device and at least one playback device; the control device is connected to the playback device; Any multimedia synchronous playback method.

本发明实施例采用播放缓存的媒体数据包,然后,检测系统时钟与参考播放设备的系统时钟是否同步,若否,则获取所述参考播放设备当前的播放进度信息,根据所述播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放所述目标媒体数据包。该方案可以在与参考播放设备的系统时钟不同步时,根据参考设备当前的播放进度信息播放媒体数据包,从而实现与参考播放设备同步播放多媒体数据,因此,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。The embodiment of the present invention adopts playing buffered media data packets, then, detects whether the system clock is synchronized with the system clock of the reference playback device, if not, then obtains the current playback progress information of the reference playback device, according to the playback progress information from Among the buffered media data packets, determine the target media data packets that need to be played currently, and play the target media data packets. This solution can play the media data packet according to the current playback progress information of the reference device when it is not synchronized with the system clock of the reference playback device, so as to realize synchronous playback of multimedia data with the reference playback device. Therefore, compared with the prior art, it can Improve the synchronization of multimedia playback between multimedia playback devices.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to these drawings without creative work.

图1是本发明实施例一提供的多媒体同步播放方法的流程示意图。FIG. 1 is a schematic flowchart of a multimedia synchronous playing method provided by Embodiment 1 of the present invention.

图2是本发明实施例二提供的多媒体同步播放系统的场景示意图。FIG. 2 is a schematic diagram of a scene of a multimedia synchronous playback system provided by Embodiment 2 of the present invention.

图3是本发明实施例二提供的多媒体同步播放方法的流程示意图。FIG. 3 is a schematic flowchart of a method for synchronously playing multimedia provided by Embodiment 2 of the present invention.

图4是本发明实施例三提供的第一种多媒体同步播放装置的结构示意图。FIG. 4 is a schematic structural diagram of a first multimedia synchronous playback device provided by Embodiment 3 of the present invention.

图5是本发明实施例三提供的第二种多媒体同步播放装置的结构示意图。FIG. 5 is a schematic structural diagram of a second multimedia synchronous playback device provided by Embodiment 3 of the present invention.

图6是本发明实施例三提供的第三种多媒体同步播放装置的结构示意图。FIG. 6 is a schematic structural diagram of a third multimedia synchronous playback device provided by Embodiment 3 of the present invention.

图7是本发明实施例三提供的第四种多媒体同步播放装置的结构示意图。FIG. 7 is a schematic structural diagram of a fourth multimedia synchronous playback device provided by Embodiment 3 of the present invention.

图8是本发明实施例四提供的终端的结构示意图。FIG. 8 is a schematic structural diagram of a terminal provided in Embodiment 4 of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.

本发明的说明书和权利要求书以及上述附图中的术语“第一”、“第二”、“第三”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应当理解,这样描述的对象在适当情况下可以互换。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。例如,包含了一系列步骤的过程、方法或包含了一系列模块或单元的装置、终端、系统不必限于清楚地列出的那些步骤或模块或单元,还可以包括没有清楚地列出的步骤或模块或单元,也可以包括对于这些过程、方法、装置、终端或系统固有的其它步骤或模块或单元。The terms "first", "second", "third", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects and not necessarily to describe a specific order or sequentially. It should be understood that the items so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, a method comprising a series of steps, or a device, a terminal, a system comprising a series of modules or units are not necessarily limited to those steps or modules or units clearly listed, and may also include steps or units not clearly listed. A module or unit may also include other steps or modules or units inherent to these processes, methods, apparatuses, terminals or systems.

本发明实施例提供一种多媒体同步播放方法、装置、系统及终端,以下将分别进行详细说明。Embodiments of the present invention provide a multimedia synchronous playback method, device, system, and terminal, which will be described in detail below.

实施例一Embodiment one

本实施例将从多媒体同步播放装置的角度进行描述,该多媒体同步播放装置具体可以集成播放设备中,该播放设备可以为终端(智能手机、平板电脑等)、音箱等播放设备。This embodiment will be described from the perspective of a multimedia synchronous playback device. The multimedia synchronous playback device can specifically be integrated into a playback device, and the playback device can be a playback device such as a terminal (smart phone, tablet computer, etc.), a speaker, or the like.

一种多媒体同步播放方法,包括:播放缓存的媒体数据包,然后,检测系统时钟与参考播放设备的系统时钟是否同步,若否,则获取该参考播放设备当前的播放进度信息,根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放该目标媒体数据包。A multimedia synchronous playback method, comprising: playing buffered media packets, then detecting whether the system clock is synchronized with the system clock of a reference playback device, if not, obtaining the current playback progress information of the reference playback device, and according to the playback progress The information determines the current target media data package to be played from the cached media data package, and plays the target media data package.

如图1所示,该多媒体同步播放方法,具体流程可以包括:As shown in Figure 1, the multimedia synchronous playback method, the specific process may include:

101、播放缓存的媒体数据包。101. Play the buffered media data packet.

具体地,可以接收控制设备(如控制终端等)或者源设备(服务器等)发送的媒体数据包,并缓存媒体数据包,然后,播放缓存的媒体数据包。Specifically, a media data packet sent by a control device (such as a control terminal, etc.) or a source device (a server, etc.) may be received, the media data packet may be buffered, and then the buffered media data packet may be played.

其中,媒体数据包可以包括:数据包标识(序号或者编号)、数据包的播放时间信息(时间戳)以及媒体数据段;此时,步骤“播放缓存的媒体数据包”可以包括:Wherein, the media data packet can include: data packet identification (serial number or serial number), the playing time information (time stamp) and the media data segment of the data packet; at this time, the step "playing the buffered media data packet" can include:

根据媒体数据包中数据包标识(序号或者编号)、起始播放时间信息(时间戳)以及系统时钟,播放媒体数据段。Play the media data segment according to the data packet identification (serial number or serial number) in the media data packet, the start playing time information (time stamp) and the system clock.

本实施例中媒体数据包可以采用统一打包规则生成。In this embodiment, the media data packet may be generated using a unified packing rule.

该媒体数据段可以为原始媒体数据的一个片段或者一部分。The media data segment may be a fragment or a part of the original media data.

其中,媒体数据段的格式可以多种,比如,MP3(Moving Picture Experts GroupAudio Layer III)、WMA(Windows Media Audio)等格式。Among them, the format of the media data segment can be various, for example, MP3 (Moving Picture Experts Group Audio Layer III), WMA (Windows Media Audio) and other formats.

102、检测系统时钟与参考播放设备的系统时钟是否同步,若否,则执行步骤103。102. Detect whether the system clock is synchronized with the system clock of the reference playback device, and if not, perform step 103.

其中,参考播放设备可以由控制设备选定,比如,可以从多个播放设备中选取参考播放设备,应当注意的是:当控制设备若除分发媒体数据之外也接收自身分发的媒体数据播放时,该控制设备也为播放设备,此时,参考播放设备可以为播放设备,也可以为控制设备。Wherein, the reference playback device can be selected by the control device. For example, the reference playback device can be selected from multiple playback devices. It should be noted that: when the control device also receives the media data distributed by itself to play , the control device is also a playback device. At this time, the reference playback device may be a playback device or a control device.

具体地,可以先从参数播放设备获取参考设备的系统时钟,然后,检测自身的系统时钟与参考播放设备的系统时钟是否同步。Specifically, the system clock of the reference device may first be obtained from the parameter playback device, and then, whether the system clock of itself is synchronized with the system clock of the reference playback device is detected.

本实施例中,检测系统时钟与参考播放设备的系统时钟是否同步的方式可以有多种,比如,可以先获取两个系统时钟之间的时间差值,然后,基于时间差值来确定是否同步;也即步骤“检测系统时钟与参考播放设备的系统时钟是否同步”可以包括:In this embodiment, there are many ways to detect whether the system clock is synchronized with the system clock of the reference playback device. For example, the time difference between the two system clocks can be obtained first, and then, based on the time difference, it can be determined whether they are synchronized. ; That is, the step "detecting whether the system clock is synchronized with the system clock of the reference playback device" may include:

获取系统时钟与参考播放设备的系统时钟之间的时间误差;Obtain the time error between the system clock and the system clock of the reference playback device;

判断该时间误差是否大于预设阈值;judging whether the time error is greater than a preset threshold;

若大于预设阈值,则确定系统时钟与参考播放设备的系统时钟不同步;If it is greater than the preset threshold, it is determined that the system clock is not synchronized with the system clock of the reference playback device;

若不大于预设阈值,则确定系统时钟与参考播放设备的系统时钟同步。If not greater than the preset threshold, it is determined that the system clock is synchronized with the system clock of the reference playback device.

也即,在时间误差较小,不影响同步播放质量时,可认为播放设备的系统时钟与参考播放设备的时钟近似同步,此时无需进行同步播放调节;反之若时间误差较大,影响同步播放质量时,可以认为播放设备的系统时钟与参考时钟不同步,此时需要进行同步播放调节。That is to say, when the time error is small and does not affect the quality of synchronous playback, it can be considered that the system clock of the playback device is approximately synchronous with the clock of the reference playback device. At this time, there is no need to adjust the synchronous playback; otherwise, if the time error is large, it will affect the synchronous playback When the quality is high, it can be considered that the system clock of the playback device is not synchronized with the reference clock, and a synchronous playback adjustment is required at this time.

其中,预设阈值可以根据实际需求设定,比如可以根据用户同步差的忍耐度设置。Wherein, the preset threshold can be set according to actual needs, for example, it can be set according to the user's tolerance for synchronization difference.

可选地,为了提高播放响应速度以及缩短多媒体的播放完成时间,本实施例可以在缓存到一定数量之后进行同步检测;也即在步骤102之前,本实施例方法还可以包括:Optionally, in order to improve the playback response speed and shorten the multimedia playback completion time, this embodiment can perform synchronous detection after buffering a certain amount; that is, before step 102, the method of this embodiment may also include:

获取当前缓存的媒体数据包的数量;Get the number of currently cached media packets;

判断该数量是否大于预设数量;judging whether the quantity is greater than a preset quantity;

若是,则执行检测系统时钟与参考播放设备的系统时钟是否同步的步骤。If yes, perform the step of detecting whether the system clock is synchronized with the system clock of the reference playback device.

其中,获取当前缓存的媒体数据包的数量的方式可以有多种,比如,可以通过计数的方式来获取,即步骤“获取当前缓存的媒体数据包的数量”可以包括:Among them, there are many ways to obtain the number of currently cached media data packets, for example, it can be obtained by counting, that is, the step "obtaining the number of currently cached media data packets" may include:

对当前缓存的媒体数据包进行计数,得到计数值;Count the currently cached media packets to obtain the count value;

根据该计数值获取当前缓存的媒体数据包的数量。Obtain the number of currently buffered media packets according to the count value.

103、获取该参考播放设备当前的播放进度信息。103. Acquire current playback progress information of the reference playback device.

具体地,可以向参考播放设备发送播放进度获取请求,然后,接收参考播放设备根据该播放进度获取请求返回的播放进度信息;也可以由参考播放设备主动发送当前的播放进度信息,此时,多媒体同步播放装置即可对该播放进度信息进行接收。Specifically, a playback progress acquisition request may be sent to the reference playback device, and then the playback progress information returned by the reference playback device according to the playback progress acquisition request may be received; the current playback progress information may also be actively sent by the reference playback device. At this time, the multimedia The synchronous playback device can receive the playback progress information.

其中,播放进度信息可以包括:参考播放设备当前的起始播放时间信息(如媒体数据包的播放时间戳)、当前播放的媒体数据包的标识等等。Wherein, the playing progress information may include: refer to the current starting playing time information of the playing device (such as the playing time stamp of the media data packet), the identifier of the currently playing media data packet, and the like.

104、根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放该目标媒体数据包。104. Determine, from the buffered media data packets according to the playing progress information, a target media data packet that needs to be played currently, and play the target media data packet.

具体地,当该播放进度信息包括:该参考播放设备当前播放(正在播放或者将要播放)的媒体数据包的标识时,步骤“根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包”可以包括:Specifically, when the playback progress information includes: the identifier of the media data packet currently played (being played or about to be played) by the reference playback device, the step "determine the media data packet that needs to be played currently according to the playback progress information from the cached media data packet" The target media packet" can include:

从缓存的媒体数据包中确定与该标识对应的媒体数据包,并将与该标识对应的媒体数据包作为当前需要播放的目标媒体数据包。Determine the media data packet corresponding to the identifier from the buffered media data packets, and use the media data packet corresponding to the identifier as the target media data packet to be played currently.

例如,在参考设备的系统时钟为1分钟,此时参考播放设备将播放媒体数据包6,播放设备的系统时钟为1分1s,此时播放设备将播放媒体数据包7;播放设备检测到两个系统时钟之间的时间误差为1s大于预设阈值10ms,然后,播放设备获取参考播放设备当前播放的媒体数据包的编号,即6,此时,播放设备可以根据该编号重新确定需要播放的目标媒体数据包为媒体数据包6(原本需要播放媒体数据包7,此时改播媒体数据包6),即回跳到播放媒体数据包6;这样播放设备与参考设备可以实现同步播放。For example, when the system clock of the reference device is 1 minute, the reference playback device will play media packet 6 at this time, and the system clock of the playback device is 1 minute 1s, and the playback device will play media packet 7 at this time; the playback device detects two The time error between two system clocks is 1s greater than the preset threshold of 10ms. Then, the playback device obtains the number of the media data packet currently played by the reference playback device, which is 6. At this time, the playback device can re-determine the number to be played according to the number. The target media data packet is media data packet 6 (originally, media data packet 7 needs to be played, but now media data packet 6 is changed), that is, it jumps back to play media data packet 6; in this way, the playback device and the reference device can realize synchronous playback.

又比如,在参考设备的系统时钟为1分2s,此时参考播放设备将播放媒体数据包8,播放设备的系统时钟为1分1s,此时播放设备将播放媒体数据包7;播放设备检测到两个系统时钟之间的时间误差为1s大于预设阈值10ms,然后,播放设备获取参考播放设备当前播放的媒体数据包的编号,即8,此时,播放设备可以根据该编号重新确定需要播放的目标媒体数据包为媒体数据包8(原本需要播放媒体数据包7,此时改播媒体数据包8),即跳过媒体数据包7直接播放媒体数据包8;这样播放设备与参考设备可以实现同步播放。For another example, when the system clock of the reference device is 1 minute 2s, the reference playback device will play media packet 8 at this time, and the system clock of the playback device is 1 minute 1s, and the playback device will play media packet 7 at this time; the playback device detects When the time error between the two system clocks is 1s greater than the preset threshold of 10ms, the playback device obtains the number of the media data packet currently played by the reference playback device, which is 8. At this time, the playback device can re-determine the need based on the number The target media data packet to play is media data packet 8 (originally, media data packet 7 needs to be played, but now media data packet 8 is changed), that is, media data packet 7 is skipped and media data packet 8 is directly played; thus, the playback device and the reference device Can achieve synchronous playback.

具体地,当该播放进度信息包括:该参考播放设备当前播放(正在播放或者将要播放)的媒体数据包的起始播放时间信息(播放时间戳);此时步骤“根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包”可以包括:Specifically, when the playback progress information includes: the initial playback time information (playback timestamp) of the media data packet currently played (being played or to be played) by the reference playback device; In the media data packet, determine the current target media data packet that needs to be played" may include:

从缓存的媒体数据包中确定与该起始播放时间信息对应的媒体数据包,并将与该起始播放时间信息对应的媒体数据包作为当前需要播放的目标媒体数据包。Determine the media data packet corresponding to the initial playing time information from the buffered media data packets, and use the media data packet corresponding to the initial playing time information as the current target media data packet to be played.

本实施例中,每个媒体数据包均包括媒体数据包的起始播放时间信息,如时间戳,因此,可以根据参考播放设备当前播放的媒体数据包的起始播放时间信息从缓存的媒体数据包中找到相应的数据包,进行播放。In this embodiment, each media data packet includes the initial playback time information of the media data packet, such as a timestamp, therefore, the buffered media data can be retrieved according to the initial playback time information of the media data packet currently played by the reference playback device. Find the corresponding data package in the package and play it.

例如,播放设备当前播放媒体数据包4,参考播放设备当前播放的媒体数据包5的时间戳为0:06,播放设备在检测到与参考播放设备的系统时钟不同步时,获取该时间戳0:06,然后,在缓存的媒体数据包中查找与该时间戳0:06对应的媒体数据包,此时可以查到与该时间戳0:06对应的媒体数据包为媒体数据包5;此时,可以跳过媒体数据包4播放媒体数据包5。For example, the playback device is currently playing media data packet 4, and the timestamp of the media data packet 5 currently played by the reference playback device is 0:06. When the playback device detects that it is out of sync with the system clock of the reference playback device, it will obtain the timestamp 0 :06, then, search the media data packet corresponding to the time stamp 0:06 in the media data packet of the cache, at this moment, it can be found that the media data packet corresponding to the time stamp 0:06 is media data packet 5; , you can skip media data packet 4 and play media data packet 5.

可选地,在检测到系统时钟与参考播放设备的系统时钟同步时,可以正常播放缓存的媒体数据包,并且可以将上述计数值清零。之后,可以继续从零开始对缓存的媒体数据进行计数,以获取当前缓存的媒体数据包的数量,循环执行步骤102-104。Optionally, when it is detected that the system clock is synchronized with the system clock of the reference playback device, the buffered media data packets can be played normally, and the count value can be cleared. Afterwards, the buffered media data may continue to be counted from zero to obtain the number of currently buffered media data packets, and steps 102-104 are executed cyclically.

可选地,在播放该目标媒体数据包可以返回执行步骤102,以保证后续的媒体播放可以一直与参数播放设备保存同步。Optionally, the execution of step 102 may be returned after playing the target media data packet, so as to ensure that the subsequent media playing can always be synchronized with the storage of the parameter playing device.

由上可知,本发明实施例采用播放缓存的媒体数据包,然后,检测系统时钟与参考播放设备的系统时钟是否同步,若否,则获取该参考播放设备当前的播放进度信息,根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放该目标媒体数据包。该方案可以在与参考播放设备的系统时钟不同步时,根据参考设备当前的播放进度信息播放媒体数据包,从而实现与参考播放设备同步播放多媒体数据,因此,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, the embodiment of the present invention adopts the media data packet of playing cache, then, detects whether the system clock is synchronized with the system clock of the reference playback device, if not, then obtains the current playback progress information of the reference playback device, and according to the playback progress The information determines the current target media data package to be played from the cached media data package, and plays the target media data package. This solution can play the media data packet according to the current playback progress information of the reference device when it is not synchronized with the system clock of the reference playback device, so as to realize synchronous playback of multimedia data with the reference playback device. Therefore, compared with the prior art, it can Improve the synchronization of multimedia playback between multimedia playback devices.

此外,本发明实施例还可以在播放设备中选定参考播放设备,使得播放设备与参考播放设备之间播放同步,即在播放设备之间进行同步协调,可以减轻控制设备的负荷;并且本发明实施例播放设备可以一直处于播放状态,播放输出正常,降低了对播放输出模块或者后级设备的影响。In addition, in the embodiment of the present invention, a reference playback device can also be selected among the playback devices, so that the playback between the playback device and the reference playback device is synchronized, that is, synchronous coordination between the playback devices can reduce the load on the control device; and the present invention The playback device in the embodiment can always be in the playback state, and the playback output is normal, which reduces the impact on the playback output module or subsequent equipment.

实施例二Embodiment two

根据实施例一所描述的多媒体同步播放方法,以下将举例作进一步详细说明。According to the multimedia synchronous playing method described in the first embodiment, an example will be given below for further detailed description.

在本实施例中,将以实施例一所描述的多媒体同步播放装置集成在从属设备中为例进行详细描述。In this embodiment, a detailed description will be made by taking the integrated multimedia synchronous playing device described in the first embodiment in the slave device as an example.

参考图2,本实施例提供了一种多媒体同步播放系统,包括:源设备10、主控设备20、至少一个从属设备30;该源设备10、主控设备20、从属设备30之间可以通过网络相互连接。Referring to FIG. 2 , this embodiment provides a multimedia synchronous playback system, including: a source device 10, a master device 20, and at least one slave device 30; the source device 10, the master device 20, and the slave device 30 can be connected through Networks are interconnected.

其中,主控设备20用于控制从属设备,其可以为终端,如手机、平板电脑等,该主控设备也可以为播放设备,比如,音箱等播放设备;本实施例将以主控设备20为终端为例进行说明。Wherein, the main control device 20 is used to control the slave device, which can be a terminal, such as a mobile phone, a tablet computer, etc., and the main control device can also be a playback device, such as a playback device such as a speaker; this embodiment will use the main control device 20 The terminal is used as an example for description.

该从属设备30可以为受控于主控设备20的播放设备,该从属设备可以为音箱、具有播放功能的终端等播放设备。The slave device 30 may be a playback device controlled by the master device 20, and the slave device may be a playback device such as a sound box or a terminal with a playback function.

其中,源设备10用于提供待播放的多媒体数据,其可以服务器等网络设备。Wherein, the source device 10 is used to provide multimedia data to be played, which may be a network device such as a server.

下面将基于上述系统来介绍本发明提供的多媒体同步播放方法。The following will introduce the multimedia synchronous playing method provided by the present invention based on the above system.

在同步播放多媒体之前,本实施例可以从多个从属设备30中选取一个设备作为同步播放的参考设备,在同步播放过程中,所有从属设备的时钟均将与该参考设备的系统时钟保存同步。比如,可以由主控设备20从多个从属设备30中选取一个从属设备作为同步播放的参考设备,然后,将参考设备的标识发送给各个从属设备。Before playing multimedia synchronously, this embodiment can select a device from multiple slave devices 30 as a reference device for synchronous playback. During the process of synchronous playback, the clocks of all slave devices will be synchronized with the system clock of the reference device. For example, the master control device 20 may select a slave device from multiple slave devices 30 as a reference device for synchronous playback, and then send the identifier of the reference device to each slave device.

应当注意的是:当主控设备20若除分发媒体数据之外也接收自身分发的媒体数据播放时,该主控设备20也为从属设备。此时,可以选取主控设备20为参考播设备。It should be noted that: when the master device 20 also receives and plays the media data distributed by itself in addition to distributing media data, the master device 20 is also a slave device. At this time, the main control device 20 may be selected as the reference broadcast device.

如图3所示,该多媒体同步播放方法,具体流程可以如下:As shown in Figure 3, the multimedia synchronous playback method, the specific process can be as follows:

301、源设备10向主控设备20发送多媒体数据。301. The source device 10 sends multimedia data to the master control device 20.

比如,源设备10接收主控设备发送的数据获取请求,然后,根据该数据获取请求向主控设备20发送响应的多媒体数据。For example, the source device 10 receives the data acquisition request sent by the master device, and then sends corresponding multimedia data to the master device 20 according to the data acquisition request.

其中,该多媒体数据可以为音频数据、音视频数据等等。该音频数据包括但不限于CD、WAV、MP3(Moving Picture Experts Group Audio Layer III)、WMA(Windows MediaAudio)等格式的音频数据。Wherein, the multimedia data may be audio data, audio and video data, and so on. The audio data includes but not limited to CD, WAV, MP3 (Moving Picture Experts Group Audio Layer III), WMA (Windows Media Audio) and other formats.

在其他实施方式,主控设备20可以从本地存储中获取多媒体数据。In other implementation manners, the main control device 20 may acquire multimedia data from local storage.

302、主控设备20对多媒体数据进行打包,得到多个媒体数据包。302. The main control device 20 packs the multimedia data to obtain multiple media data packets.

主控设备20可以根据一定单位(以数据大小、媒体帧等作为单位)对媒体数据进行打包,以得到多个媒体数据包。比如,可以将媒体数据打包成多个数据大小相等的媒体数据包、或者播放时长相等的媒体数据包。例如,可以将该音频数据打包成音频长度为200ms的多个数据包。The master control device 20 may pack the media data according to a certain unit (with data size, media frame, etc. as the unit), so as to obtain multiple media data packets. For example, the media data may be packaged into multiple media data packets with equal data size, or media data packets with equal playing duration. For example, the audio data may be packed into multiple data packets with an audio length of 200ms.

其中,媒体数据包可以包括:数据包标识、数据包的起始播放时间信息(如时间戳)以及媒体数据段。Wherein, the media data packet may include: the data packet identifier, the starting playing time information (such as time stamp) of the data packet, and the media data segment.

303、主控设备20向各个从属设备30发送媒体数据包。303. The master control device 20 sends a media data packet to each slave device 30.

主控设备20可以根据媒体数据包的标识向各个从属设备30发送媒体数据包;比如,按照数据包的编号依次将媒体数据包发送给从属设备30。The master control device 20 may send media data packets to each slave device 30 according to the identifier of the media data packet; for example, send the media data packets to the slave devices 30 sequentially according to the numbers of the data packets.

304、从属设备30缓存媒体数据包并计数。304. The slave device 30 buffers and counts the media data packets.

305、从属设备30判断当前计数值是否大于预设阈值,若是,执行步骤306,若否,则返回执行步骤305。305. The slave device 30 judges whether the current count value is greater than a preset threshold, if yes, execute step 306, and if not, return to execute step 305.

该预设阈值可以根据实际需求设定,比如可以为7、8、9等。The preset threshold can be set according to actual needs, for example, it can be 7, 8, 9 and so on.

306、从属设备30检测自身系统时钟与参考设备的系统时钟之间的时间误差。306. The slave device 30 detects a time error between its own system clock and the system clock of the reference device.

比如,从属设备30可以向主控设备20请求参考设备的系统时钟(也称为参考时钟),然后,从属设备30将自身的系统时钟与该参考时钟进行部分,得到二两个时钟之间的时间误差,即时间误差。For example, the slave device 30 can request the system clock of the reference device (also referred to as a reference clock) from the master device 20, and then the slave device 30 divides its own system clock with the reference clock to obtain the difference between the two clocks. Time error, that is, time error.

307、从属设备30判断该时间误差是否小于预设误差,若否,执行步骤308,若是,则执行步骤310。307. The slave device 30 judges whether the time error is smaller than a preset error, if not, execute step 308, and if yes, execute step 310.

比如,时间误差为2ms,若预设误差是为1ms,此时可以判断该时间误差大于预设差值,此时,时钟误差较大,需要进行时钟同步,因此执行步骤308。For example, if the time error is 2 ms, if the preset error is 1 ms, it can be judged that the time error is greater than the preset difference. At this time, the clock error is relatively large, and clock synchronization needs to be performed, so step 308 is executed.

又比如,时间误差为0.5ms,若预设误差是为1ms,此时可以判断该时间误差小于预设差值,此时,时钟误差较小,可以不进行时钟同步,因此,可转到执行步骤310对计数清零,等待下一次的同步检测。For another example, if the time error is 0.5ms, if the preset error is 1ms, it can be judged that the time error is smaller than the preset difference. At this time, the clock error is small, and clock synchronization can not be performed. Therefore, it can be transferred to the execution Step 310 clears the count and waits for the next synchronization detection.

308、从属设备30获取参考设备当前的播放进度信息,并根据播放进度信息在缓存的媒体数据包中确定当前需要播放的目标媒体数据包。308. The slave device 30 obtains the current playback progress information of the reference device, and determines the target media data packet currently to be played in the buffered media data packets according to the playback progress information.

其中,播放进度信息可以包括:参考播放设备当前的起始播放时间信息(如媒体数据包的播放时间戳)、当前播放的媒体数据包的标识等等。Wherein, the playing progress information may include: refer to the current starting playing time information of the playing device (such as the playing time stamp of the media data packet), the identifier of the currently playing media data packet, and the like.

比如,该播放进度信息包括:该参考播放设备当前播放(正在播放或者将要播放)的媒体数据包的标识;此时,从属设备30可以从缓存的媒体数据包中确定与该标识对应的媒体数据包,并将与该标识对应的媒体数据包作为当前需要播放的目标媒体数据包。For example, the playback progress information includes: the identifier of the media data packet currently played (being played or about to be played) by the reference playback device; at this time, the slave device 30 can determine the media data corresponding to the identifier from the buffered media data packet packet, and use the media data packet corresponding to the identifier as the current target media data packet to be played.

例如,在参考设备的系统时钟为1:05,此时根据媒体数据包的起始时间信息1:05,参考设备将播放媒体数据包10,从属设备的系统时钟为1分钟,此时,根据播放设备将播放媒体数据包9;从属设备检测到两个系统时钟之间的时间误差为5s大于预设阈值20ms,然后,从属设备获取参考设备当前播放的媒体数据包的编号,即10,此时,从属设备可以根据该编号重新确定需要播放的目标媒体数据包为媒体数据包10(原本需要播放媒体数据包9,此时改播媒体数据包10),即回跳到播放媒体数据包10;这样从属设备与参考设备可以实现同步播放。For example, the system clock of the reference device is 1:05, at this time, according to the start time information of the media data packet at 1:05, the reference device will play the media data packet 10, and the system clock of the slave device is 1 minute, at this time, according to The playback device will play media data packet 9; the slave device detects that the time error between the two system clocks is 5s greater than the preset threshold of 20ms, then the slave device obtains the number of the media data packet currently played by the reference device, which is 10, this , the slave device can re-determine the target media data packet to be played as media data packet 10 according to the number (originally, media data packet 9 needs to be played, but now media data packet 10 should be played instead), that is, it will jump back to play media data packet 10 ; so that the slave device and the reference device can achieve synchronous playback.

具体地,当该播放进度信息包括:该参考播放设备当前播放(正在播放或者将要播放)的媒体数据包的起始播放时间信息(播放时间戳);此时,从属设备可以从缓存的媒体数据包中确定与该起始播放时间信息对应的媒体数据包,并将与该起始播放时间信息对应的媒体数据包作为当前需要播放的目标媒体数据包。Specifically, when the playback progress information includes: the starting playback time information (playing time stamp) of the media data packet currently played (being played or to be played) by the reference playback device; The media data packet corresponding to the initial playing time information is determined in the packet, and the media data packet corresponding to the initial playing time information is used as the current target media data packet to be played.

例如,从属设备当前播放媒体数据包7,参考播放设备当前播放的媒体数据包8的时间戳为0:09,从属设备在检测到与参考设备的系统时钟不同步时,获取该时间戳0:09,然后,在缓存的媒体数据包中查找与该时间戳0:09对应的媒体数据包,此时可以查到与该时间戳0:09对应的媒体数据包为媒体数据包8;此时,可以跳过媒体数据包7播放媒体数据包8。For example, the slave device currently plays media data packet 7, and the timestamp of the media data packet 8 currently played by the reference playback device is 0:09. When the slave device detects that it is not synchronized with the system clock of the reference device, it obtains the timestamp 0:0: 09, then, look for the media packet corresponding to the timestamp 0:09 in the cached media packet, and now it can be found that the media packet corresponding to the timestamp 0:09 is media packet 8; at this time , you can skip media data packet 7 and play media data packet 8.

309、从属设备30播放目标媒体数据包,返回执行步骤306。309. The slave device 30 plays the target media data packet, and returns to step 306.

比如,从属设备30原本需要播放媒体数据包8,此时可以跳到播放参考设备当前播放的媒体数据包9,或者媒体数据包7等。For example, the slave device 30 originally needs to play the media data package 8, at this time, it may skip to play the media data package 9 or the media data package 7 currently played by the reference device.

310、从属设备30将当前的计数清零,返回步骤304。310. The slave device 30 clears the current count, and returns to step 304.

具体实施时,本发明不受所描述的各个步骤的执行顺序的限制,在不产生冲突的情况下,某些步骤还可以采用其它顺序进行或者同时进行。During specific implementation, the present invention is not limited by the execution order of the described steps, and some steps may be performed in other orders or simultaneously if no conflict arises.

由上可知,本发明实施例采用从属设备30播放缓存的媒体数据包,然后,从属设备30检测系统时钟与参考设备的系统时钟是否同步,若否,则获取该参考设备当前的播放进度信息,根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放该目标媒体数据包。该方案可以在与参考播放设备的系统时钟不同步时,根据参考设备当前的播放进度信息播放媒体数据包,从而实现与参考播放设备同步播放多媒体数据,因此,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, the embodiment of the present invention uses the slave device 30 to play the buffered media data packets, and then the slave device 30 detects whether the system clock is synchronized with the system clock of the reference device, and if not, then obtains the current playback progress information of the reference device, From the buffered media data packets according to the playing progress information, determine the target media data packet currently to be played, and play the target media data packet. This solution can play the media data packet according to the current playback progress information of the reference device when it is not synchronized with the system clock of the reference playback device, so as to realize synchronous playback of multimedia data with the reference playback device. Therefore, compared with the prior art, it can Improve the synchronization of multimedia playback between multimedia playback devices.

此外,本发明实施例还可以在播放设备中选定参考设备,使得播放设备与参考播放设备之间播放同步,即在播放设备之间进行同步协调,可以减轻主控设备的负荷;并且本发明实施例播放设备可以一直处于播放状态,播放输出正常,降低了对播放输出模块或者后级设备的影响。In addition, in the embodiment of the present invention, a reference device can also be selected in the playback device, so that the playback between the playback device and the reference playback device is synchronized, that is, synchronous coordination between the playback devices can reduce the load on the master device; and the present invention The playback device in the embodiment can be in the playback state all the time, and the playback output is normal, which reduces the impact on the playback output module or subsequent equipment.

实施例三Embodiment three

为了更好地实施以上方法,本发明实施例还提供一种多媒体同步播放装置,该多媒体同步播放装置可以集成在播放设备中,该播放设备可以是智能手机、平板电脑、音箱等设备。In order to better implement the above method, an embodiment of the present invention also provides a multimedia synchronous playback device, which can be integrated into a playback device, and the playback device can be a smart phone, a tablet computer, a speaker, and the like.

如图4所示,多媒体同步播放装置400可以包括:播放单元401、检测单元402、获取单元403以及同步单元404,如下:As shown in Figure 4, the multimedia synchronous playback device 400 may include: a playback unit 401, a detection unit 402, an acquisition unit 403 and a synchronization unit 404, as follows:

播放单元401,用于播放缓存的媒体数据包;A playback unit 401, configured to play the buffered media packets;

检测单元402,用于检测系统时钟与参考播放设备的系统时钟是否同步;A detection unit 402, configured to detect whether the system clock is synchronized with the system clock of the reference playback device;

获取单元403,用于在检测单元402检测系统时钟与参考播放设备的系统时钟不同步时,获取该参考播放设备当前的播放进度信息;The obtaining unit 403 is used to obtain the current playback progress information of the reference playback device when the detection unit 402 detects that the system clock is not synchronized with the system clock of the reference playback device;

同步单元404,用于根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放该目标媒体数据包。The synchronizing unit 404 is configured to determine a target media data packet currently to be played from the buffered media data packets according to the playing progress information, and play the target media data packet.

其中,参考图5,该检测单元402可以包括:误差获取子单元4021和误差判断子单元4022;Wherein, referring to FIG. 5, the detection unit 402 may include: an error acquisition subunit 4021 and an error judgment subunit 4022;

该误差获取子单元4021,用于获取系统时钟与参考播放设备的系统时钟之间的时间误差;The error acquisition subunit 4021 is used to acquire the time error between the system clock and the system clock of the reference playback device;

该误差判断子单元4022,用于判断该时间误差是否大于预设阈值;The error judging subunit 4022 is used to judge whether the time error is greater than a preset threshold;

若大于预设阈值,则确定系统时钟与参考播放设备的系统时钟不同步;If it is greater than the preset threshold, it is determined that the system clock is not synchronized with the system clock of the reference playback device;

若不大于预设阈值,则确定系统时钟与参考播放设备的系统时钟同步。If not greater than the preset threshold, it is determined that the system clock is synchronized with the system clock of the reference playback device.

其中,该播放进度信息包括:该参考播放设备当前播放的媒体数据包的标识;此时,同步单元404,可以具体用于从缓存的媒体数据包中确定与该标识对应的媒体数据包,并将与该标识对应的媒体数据包作为当前需要播放的目标媒体数据包。Wherein, the playback progress information includes: the identification of the media data packet currently played by the reference playback device; at this time, the synchronization unit 404 can be specifically used to determine the media data packet corresponding to the identification from the buffered media data packets, and The media data packet corresponding to the identifier is used as the target media data packet to be played currently.

可选地,参考图6,本实施例多媒体同步播放装置400还可以包括:Optionally, referring to FIG. 6, the multimedia synchronous playback device 400 in this embodiment may also include:

数量获取单元405,用于在检测单元检测系统时钟与参考播放设备的系统时钟是否同步之前,获取当前缓存的媒体数据包的数量;Quantity acquisition unit 405, used to acquire the quantity of the media data packet of current cache before detection unit detects whether the system clock of the system clock is synchronized with the system clock of the reference playback device;

数量判断单元406,用于判断该数量是否大于预设数量;A quantity judging unit 406, configured to judge whether the quantity is greater than a preset quantity;

此时,该检测单元402,用于在数量判断单元406判断数量大于预设数量时,执行检测系统时钟与参考播放设备的系统时钟是否同步的步骤。At this time, the detection unit 402 is configured to perform the step of detecting whether the system clock is synchronized with the system clock of the reference playback device when the quantity judging unit 406 determines that the quantity is greater than the preset quantity.

其中,本实施例数量获取单元405可以具体用于:对当前缓存的媒体数据包进行计数,得到计数值;根据该计数值获取当前缓存的媒体数据包的数量。Wherein, the quantity obtaining unit 405 of this embodiment may be specifically configured to: count the currently cached media data packets to obtain a count value; obtain the number of currently cached media data packets according to the count value.

可选地,参考图7,本实施例多媒体同步播放装置400还可以包括:计数处理单元407;该计数处理单元407,用于当检测单元检测系统时钟与参考播放设备的系统时钟同步时,将该计数值清零。Optionally, referring to FIG. 7 , the multimedia synchronous playback device 400 of this embodiment may further include: a counting processing unit 407; the counting processing unit 407 is configured to, when the detection unit detects that the system clock is synchronized with the system clock of the reference playback device, set The count value is cleared to zero.

具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元的具体实施可参见前面的方法实施例,在此不再赘述。During specific implementation, each of the above units may be implemented as an independent entity, or may be combined arbitrarily as the same or several entities. The specific implementation of each of the above units may refer to the previous method embodiments, and will not be repeated here.

由上可知,本发明实施例采用播放单元401播放缓存的媒体数据包,然后,由检测单元402检测系统时钟与参考播放设备的系统时钟是否同步,若否,则由获取单元403获取该参考播放设备当前的播放进度信息,由同步单元404根据该播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放该目标媒体数据包。该方案可以在与参考播放设备的系统时钟不同步时,根据参考设备当前的播放进度信息播放媒体数据包,从而实现与参考播放设备同步播放多媒体数据,因此,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。As can be seen from the above, the embodiment of the present invention adopts the playback unit 401 to play the cached media data packets, and then, the detection unit 402 detects whether the system clock is synchronized with the system clock of the reference playback device, and if not, the acquisition unit 403 acquires the reference playback. Based on the current playing progress information of the device, the synchronization unit 404 determines the target media data package that needs to be played currently from the buffered media data packages according to the playing progress information, and plays the target media data package. This solution can play the media data packet according to the current playback progress information of the reference device when it is not synchronized with the system clock of the reference playback device, so as to realize synchronous playback of multimedia data with the reference playback device. Therefore, compared with the prior art, it can Improve the synchronization of multimedia playback between multimedia playback devices.

此外,本发明实施例还可以在播放设备中选定参考播放设备,使得播放设备与参考播放设备之间播放同步,即在播放设备之间进行同步协调,可以减轻控制设备的负荷;并且本发明实施例播放设备可以一直处于播放状态,播放输出正常,降低了对播放输出模块或者后级设备的影响。In addition, the embodiment of the present invention can also select a reference playback device among the playback devices, so that playback synchronization between the playback device and the reference playback device, that is, synchronous coordination between playback devices can reduce the load on the control device; and the present invention The playback device in the embodiment can be in the playback state all the time, and the playback output is normal, which reduces the impact on the playback output module or subsequent equipment.

实施例四Embodiment four

本发明实施例还提供一种终端,如图8所示,该终端500可以包括射频(RF,RadioFrequency)电路501、包括有一个或一个以上计算机可读存储介质的存储器502、输入单元503、显示单元504、传感器505、音频电路506、无线保真(WiFi,Wireless Fidelity)模块507、包括有一个或者一个以上处理核心的处理器508、以及电源509等部件。本领域技术人员可以理解,图8中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The embodiment of the present invention also provides a terminal. As shown in FIG. A unit 504 , a sensor 505 , an audio circuit 506 , a wireless fidelity (WiFi, Wireless Fidelity) module 507 , a processor 508 including one or more processing cores, and a power supply 509 and other components. Those skilled in the art can understand that the terminal structure shown in FIG. 8 does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.

射频电路501可用于收发信息,或通话过程中信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器508处理;另外,将涉及上行的数据发送给基站。通常,射频电路501包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM,Subscriber IdentityModule)卡、收发信机、耦合器、低噪声放大器(LNA,Low Noise Amplifier)、双工器等。此外,射频电路501还可以通过无线通信与网络和其他设备通信。该无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GSM,Global System of Mobile communication)、通用分组无线服务(GPRS,GeneralPacket Radio Service)、码分多址(CDMA,Code Division Multiple Access)、宽带码分多址(WCDMA,Wideband Code Division Multiple Access)、长期演进(LTE,Long TermEvolution)、电子邮件、短消息服务(SMS,Short Messaging Service)等。The radio frequency circuit 501 can be used to send and receive information, or to receive and send signals during a call. In particular, after receiving the downlink information of the base station, it is processed by one or more processors 508; in addition, the data related to the uplink is sent to the base station . Generally, the radio frequency circuit 501 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM, Subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, Low Noise Amplifier), duplexer, etc. In addition, the radio frequency circuit 501 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM, Global System of Mobile communication), General Packet Radio Service (GPRS, General Packet Radio Service), Code Division Multiple Access (CDMA, Code Division Multiple Access), Wideband Code Division Multiple Access (WCDMA, Wideband Code Division Multiple Access), Long Term Evolution (LTE, Long Term Evolution), email, Short Message Service (SMS, Short Messaging Service), etc.

存储器502可用于存储应用程序和数据。存储器502存储的应用程序中包含有可执行程序代码。应用程序可以组成各种功能模块。处理器508通过运行存储在存储器502的应用程序,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器508和输入单元503对存储器502的访问。Memory 502 may be used to store applications and data. The application programs stored in the memory 502 include executable program codes. Applications can be composed of various functional modules. The processor 508 executes various functional applications and data processing by running the application programs stored in the memory 502 . The memory 502 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created by the use of the terminal (such as audio data, phonebook, etc.) and the like. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 502 may further include a memory controller to provide access to the memory 502 by the processor 508 and the input unit 503 .

输入单元503可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元503可以包括指纹识别模组。在一些实施例中,输入单元503还可以包括触敏表面。触敏表面,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面上或在触敏表面附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器508,并能接收处理器508发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面。除了触敏表面,输入单元503还可以包括其他输入设备。具体地,其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 503 can be used to receive input numbers, character information or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 503 may include a fingerprint identification module. In some embodiments, the input unit 503 may also include a touch-sensitive surface. A touch-sensitive surface, also known as a touch display or trackpad, collects user touch operations on or near it (for example, the user uses a finger, stylus, etc. any suitable object or accessory on the touch-sensitive surface or on the touch-sensitive Operation near the surface), and drive the corresponding connection device according to the preset program. Optionally, the touch-sensitive surface may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 508, and can receive and execute commands sent by the processor 508. In addition, touch-sensitive surfaces can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to touch-sensitive surfaces, the input unit 503 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.

显示单元504可用于显示由用户输入的信息或提供给用户的信息以及终端的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元504可包括显示面板。可选的,可以采用液晶显示器(LCD,Liquid Crystal Display)、有机发光二极管(OLED,Organic Light-Emitting Diode)等形式来配置显示面板。进一步的,触敏表面可覆盖显示面板,当触敏表面检测到在其上或附近的触摸操作后,传送给处理器508以确定触摸事件的类型,随后处理器508根据触摸事件的类型在显示面板上提供相应的视觉输出。虽然在图8中,触敏表面与显示面板是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面与显示面板集成而实现输入和输出功能。The display unit 504 can be used to display information input by or provided to the user and various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. The display unit 504 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface can cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is sent to the processor 508 to determine the type of the touch event, and then the processor 508 displays on the display according to the type of the touch event. The corresponding visual output is provided on the panel. Although in FIG. 8, the touch-sensitive surface and the display panel are used as two independent components to realize the input and input functions, in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize the input and output functions.

终端还可包括至少一种传感器505,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在终端移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The terminal may also include at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and/or the backlight when the terminal moves to the ear . As a kind of motion sensor, the gravitational acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is stationary, and can be used for applications that recognize the attitude of mobile phones (such as horizontal and vertical screen switching, related Games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. repeat.

音频电路506可通过扬声器、传声器提供用户与终端之间的音频接口。音频电路506可将接收到的音频数据转换成电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路506接收后转换为音频数据,再将音频数据输出处理器508处理后,经射频电路501以发送给比如另一终端,或者将音频数据输出至存储器502以便进一步处理。音频电路506还可能包括耳塞插孔,以提供外设耳机与终端的通信。The audio circuit 506 can provide an audio interface between the user and the terminal through a speaker or a microphone. The audio circuit 506 can convert the received audio data into an electrical signal, transmit it to the speaker, and the speaker converts it into a sound signal output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is converted into The audio data, after being processed by the audio data output processor 508, is sent to another terminal through the radio frequency circuit 501, or the audio data is output to the memory 502 for further processing. The audio circuit 506 may also include an earplug jack to provide communication between an external earphone and the terminal.

无线保真(WiFi)属于短距离无线传输技术,终端通过无线保真模块507可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了无线保真模块507,但是可以理解的是,其并不属于终端的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。Wireless Fidelity (WiFi) is a short-distance wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 507. It provides users with wireless broadband Internet access. Although Fig. 8 shows the Wi-Fi module 507, it can be understood that it is not an essential component of the terminal, and can be completely omitted as required without changing the essence of the invention.

处理器508是终端的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或执行存储在存储器502内的应用程序,以及调用存储在存储器502内的数据,执行终端的各种功能和处理数据,从而对终端进行整体监控。可选的,处理器508可包括一个或多个处理核心;优选的,处理器508可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器508中。The processor 508 is the control center of the terminal. It uses various interfaces and lines to connect various parts of the entire terminal. By running or executing the application programs stored in the memory 502 and calling the data stored in the memory 502, various functions of the terminal are executed. function and process data, so as to monitor the terminal as a whole. Optionally, the processor 508 may include one or more processing cores; preferably, the processor 508 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 508 .

终端还包括给各个部件供电的电源509(比如电池)。优选的,电源可以通过电源管理系统与处理器508逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源509还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The terminal also includes a power source 509 (such as a battery) for powering various components. Preferably, the power supply can be logically connected to the processor 508 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 509 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

尽管图8中未示出,终端还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 8 , the terminal may also include a camera, a Bluetooth module, etc., which will not be repeated here.

具体在本实施例中,终端中的处理器508会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行程序代码加载到存储器502中,并由处理器508来运行存储在存储器502中的应用程序,从而实现各种功能:Specifically, in this embodiment, the processor 508 in the terminal loads the executable program code corresponding to the process of one or more application programs into the memory 502 according to the following instructions, and the processor 508 executes the executable program code stored in the The application program in memory 502, thereby realizes various functions:

播放缓存的媒体数据包,然后,检测系统时钟与参考播放设备的系统时钟是否同步,若否,则获取所述参考播放设备当前的播放进度信息,根据所述播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放所述目标媒体数据包。Play the media data packet of cache, then, detect whether the system clock of system clock and the system clock of reference playback device are synchronous, if not, then obtain the current playback progress information of described reference playback device, according to the media data packet of buffering according to described playback progress information , determine the target media data packet currently to be played, and play the target media data packet.

优选地,所述检测系统时钟与参考播放设备的系统时钟是否同步,包括:Preferably, the detecting whether the system clock is synchronized with the system clock of the reference playback device includes:

获取系统时钟与参考播放设备的系统时钟之间的时间误差;Obtain the time error between the system clock and the system clock of the reference playback device;

判断所述时间误差是否大于预设阈值;judging whether the time error is greater than a preset threshold;

若大于预设阈值,则确定系统时钟与参考播放设备的系统时钟不同步;If it is greater than the preset threshold, it is determined that the system clock is not synchronized with the system clock of the reference playback device;

若不大于预设阈值,则确定系统时钟与参考播放设备的系统时钟同步。If not greater than the preset threshold, it is determined that the system clock is synchronized with the system clock of the reference playback device.

优选地,所述播放进度信息包括:所述参考播放设备当前播放的媒体数据包的标识;Preferably, the playback progress information includes: the identifier of the media data packet currently played by the reference playback device;

所述根据所述播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,包括:According to the playing progress information, from the cached media data packets, determining the current target media data packets that need to be played includes:

从缓存的媒体数据包中确定与所述标识对应的媒体数据包,并将与所述标识对应的媒体数据包作为当前需要播放的目标媒体数据包。Determine the media data packet corresponding to the identifier from the cached media data packets, and use the media data packet corresponding to the identifier as the current target media data packet to be played.

优选地,该处理器508还可实现以下功能:Preferably, the processor 508 can also implement the following functions:

在检测系统时钟与参考播放设备的系统时钟是否同步之前,获取当前缓存的媒体数据包的数量;判断所述数量是否大于预设数量,若是,则执行检测系统时钟与参考播放设备的系统时钟是否同步的步骤。Before detecting whether the system clock of the system clock is synchronized with the system clock of the reference playback device, the quantity of the media data packets of the current buffer is obtained; whether the quantity is judged to be greater than the preset quantity, if so, whether the system clock of the detection system clock and the reference playback device is performed Synchronization steps.

其中,获取当前缓存的媒体数据包的数量,包括:Wherein, the number of currently cached media packets is obtained, including:

对当前缓存的媒体数据包进行计数,得到计数值;Count the currently cached media packets to obtain the count value;

根据所述计数值获取当前缓存的媒体数据包的数量;Obtain the number of currently buffered media packets according to the count value;

此时,处理器508还可以实现以下功能:At this point, the processor 508 can also implement the following functions:

当系统时钟与参考播放设备的系统时钟同步时,将所述计数值清零。When the system clock is synchronized with the system clock of the reference playback device, the count value is cleared to zero.

上述操作具体可参见前面的方法实施例,在此不再赘述。For details of the above operations, reference may be made to the foregoing method embodiments, and details are not repeated here.

由上可知,本发明实施例提供了一种终端,该终端采用播放缓存的媒体数据包,然后,检测系统时钟与参考播放设备的系统时钟是否同步,若否,则获取所述参考播放设备当前的播放进度信息,根据所述播放进度信息从缓存的媒体数据包中,确定当前需要播放的目标媒体数据包,并播放所述目标媒体数据包。该方案可以在与参考播放设备的系统时钟不同步时,根据参考设备当前的播放进度信息播放媒体数据包,从而实现与参考播放设备同步播放多媒体数据,因此,相对于现有技术而言,可以提高多媒体播放设备之间播放多媒体的同步性。It can be seen from the above that the embodiment of the present invention provides a terminal, the terminal uses the buffered media data packets to play, and then detects whether the system clock is synchronized with the system clock of the reference playback device, and if not, obtains the current clock of the reference playback device. According to the playback progress information, determine the target media data packet that needs to be played currently from the buffered media data packets according to the playback progress information, and play the target media data packet. This solution can play the media data packet according to the current playback progress information of the reference device when it is not synchronized with the system clock of the reference playback device, so as to realize synchronous playback of multimedia data with the reference playback device. Therefore, compared with the prior art, it can Improve the synchronization of multimedia playback between multimedia playback devices.

需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. The medium may include: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.

以上对本发明实施例所提供的一种播多媒体同步播放方法、装置、系统及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。Above, a method, device, system and terminal for synchronous broadcasting of multimedia provided by the embodiments of the present invention have been introduced in detail. In this paper, specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only It is used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, this specification The content should not be construed as a limitation of the invention.

Claims (9)

1.一种多媒体同步播放方法,其特征在于,适用于多媒体同步播放系统中的播放设备,包括:1. A kind of multimedia synchronous playing method is characterized in that, is applicable to the playing equipment in the multimedia synchronous playing system, comprises: 接收控制设备发送的媒体数据包,并缓存所述媒体数据包;receiving the media data packet sent by the control device, and buffering the media data packet; 播放缓存的媒体数据包;Play buffered media packets; 获取当前缓存的媒体数据包的数量;Get the number of currently cached media packets; 当所述数量大于预设数量时,检测系统时钟与参考播放设备的系统时钟是否同步,所述参考播放设备为所述多媒体同步播放系统中控制设备从多个播放设备中选取的参考播放设备;When the number is greater than the preset number, detect whether the system clock is synchronized with the system clock of the reference playback device, and the reference playback device is a reference playback device selected by the control device in the multimedia synchronous playback system from a plurality of playback devices; 若否,则获取所述参考播放设备当前的播放进度信息,所述播放进度信息包括:所述参考播放设备当前播放的媒体数据包的标识;If not, then obtain the current playback progress information of the reference playback device, and the playback progress information includes: the identifier of the media data packet currently played by the reference playback device; 从缓存的媒体数据包中确定与所述标识对应的媒体数据包,并将与所述标识对应的媒体数据包作为当前需要播放的目标媒体数据包;Determining the media data packet corresponding to the identifier from the cached media data packets, and using the media data packet corresponding to the identifier as the target media data packet currently to be played; 跳转播放所述目标媒体数据包。Skip and play the target media data packet. 2.如权利要求1所述的多媒体同步播放方法,其特征在于,所述检测系统时钟与参考播放设备的系统时钟是否同步,包括:2. The multimedia synchronous playing method as claimed in claim 1, wherein, whether said detection system clock is synchronous with the system clock of the reference playback device, comprises: 获取系统时钟与参考播放设备的系统时钟之间的时间误差;Obtain the time error between the system clock and the system clock of the reference playback device; 判断所述时间误差是否大于预设阈值;judging whether the time error is greater than a preset threshold; 若大于预设阈值,则确定系统时钟与参考播放设备的系统时钟不同步;If it is greater than the preset threshold, it is determined that the system clock is not synchronized with the system clock of the reference playback device; 若不大于预设阈值,则确定系统时钟与参考播放设备的系统时钟同步。If not greater than the preset threshold, it is determined that the system clock is synchronized with the system clock of the reference playback device. 3.如权利要求1所述的多媒体同步播放方法,其特征在于,所述获取当前缓存的媒体数据包的数量,包括:3. multimedia synchronous playing method as claimed in claim 1, is characterized in that, the quantity of the media packet of described acquisition current cache, comprises: 对当前缓存的媒体数据包进行计数,得到计数值;Count the currently cached media packets to obtain the count value; 根据所述计数值获取当前缓存的媒体数据包的数量;Obtain the number of currently buffered media packets according to the count value; 所述多媒体同步播放方法还包括:The multimedia synchronous playing method also includes: 当系统时钟与参考播放设备的系统时钟同步时,将所述计数值清零。When the system clock is synchronized with the system clock of the reference playback device, the count value is cleared to zero. 4.一种多媒体同步播放装置,其特征在于,适用于多媒体同步播放系统中的播放设备,包括:4. A multimedia synchronous playback device, characterized in that, is applicable to the playback equipment in the multimedia synchronous playback system, comprising: 播放单元,用于接收控制设备发送的媒体数据包,并缓存所述媒体数据包,播放缓存的媒体数据包;The playback unit is configured to receive the media data packet sent by the control device, buffer the media data packet, and play the buffered media data packet; 数量获取单元,用于在检测单元检测系统时钟与参考播放设备的系统时钟是否同步之前,获取当前缓存的媒体数据包的数量;A quantity acquisition unit, used to acquire the quantity of the currently cached media data packets before the detection unit detects whether the system clock is synchronized with the system clock of the reference playback device; 数量判断单元,用于判断所述数量是否大于预设数量;A quantity judging unit, configured to judge whether the quantity is greater than a preset quantity; 检测单元,用于当数量判断单元判断所述数量大于预设数量时,检测系统时钟与参考播放设备的系统时钟是否同步,所述参考播放设备为所述多媒体同步播放系统中控制设备从多个播放设备中选取的参考播放设备;The detection unit is used to detect whether the system clock is synchronized with the system clock of a reference playback device when the number judgment unit judges that the number is greater than a preset number, and the reference playback device is a control device in the multimedia synchronous playback system from multiple The reference playback device selected in the playback device; 获取单元,用于在检测单元检测系统时钟与参考播放设备的系统时钟不同步时,获取所述参考播放设备当前的播放进度信息,所述播放进度信息包括:所述参考播放设备当前播放的媒体数据包的标识;An acquisition unit, configured to acquire current playback progress information of the reference playback device when the detection unit detects that the system clock is out of sync with the system clock of the reference playback device, the playback progress information including: the media currently played by the reference playback device the identification of the packet; 同步单元,用于从缓存的媒体数据包中确定与所述标识对应的媒体数据包,并将与所述标识对应的媒体数据包作为当前需要播放的目标媒体数据包;跳转播放所述目标媒体数据包。A synchronization unit, configured to determine the media data packet corresponding to the identifier from the buffered media data packets, and use the media data packet corresponding to the identifier as the target media data packet that needs to be played currently; jump to play the target media packets. 5.如权利要求4所述的多媒体同步播放装置,其特征在于,所述检测单元包括:误差获取子单元和误差判断子单元;5. The multimedia synchronous player as claimed in claim 4, wherein the detection unit comprises: an error acquisition subunit and an error judgment subunit; 所述误差获取子单元,用于获取系统时钟与参考播放设备的系统时钟之间的时间误差;The error acquisition subunit is used to acquire the time error between the system clock and the system clock of the reference playback device; 所述误差判断子单元,用于判断所述时间误差是否大于预设阈值;The error judging subunit is used to judge whether the time error is greater than a preset threshold; 若大于预设阈值,则确定系统时钟与参考播放设备的系统时钟不同步;If it is greater than the preset threshold, it is determined that the system clock is not synchronized with the system clock of the reference playback device; 若不大于预设阈值,则确定系统时钟与参考播放设备的系统时钟同步。If not greater than the preset threshold, it is determined that the system clock is synchronized with the system clock of the reference playback device. 6.如权利要求5所述的多媒体同步播放装置,其特征在于,还包括:计数处理单元;6. The multimedia synchronous playing device as claimed in claim 5, further comprising: a counting processing unit; 所述数量获取单元,具体用于:对当前缓存的媒体数据包进行计数,得到计数值;根据所述计数值获取当前缓存的媒体数据包的数量;The quantity acquisition unit is specifically used to: count the currently cached media data packets to obtain a count value; obtain the quantity of the currently cached media data packets according to the count value; 所述计数处理单元,用于当检测单元检测系统时钟与参考播放设备的系统时钟同步时,将所述计数值清零。The count processing unit is configured to clear the count value to zero when the detection unit detects that the system clock is synchronized with the system clock of the reference playback device. 7.一种终端,其特征在于,包括:7. A terminal, characterized in that, comprising: 存储有可执行程序代码的存储器;a memory storing executable program code; 与所述存储器耦合的处理器;a processor coupled to the memory; 所述处理器调用所述存储器中存储的所述可执行程序代码,执行如权利要求1至权利要求3任一项所述的方法。The processor invokes the executable program code stored in the memory to execute the method according to any one of claims 1 to 3. 8.一种多媒体同步播放系统,其特征在于,包括:控制设备和至少一个播放设备;所述控制设备与所述播放设备连接;所述播放设备用于执行如权利要求1至权利要求3任一项所述的方法。8. A multimedia synchronous playback system, characterized in that it comprises: a control device and at least one playback device; the control device is connected to the playback device; and the playback device is used to perform any of claims 1 to 3 one of the methods described. 9.一种计算机可读存储介质,其存储用于多媒体同步播放的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1所述的方法。9. A computer-readable storage medium, which stores a computer program for multimedia synchronous playback, wherein the computer program causes a computer to execute the method according to claim 1.
CN201610882817.5A 2016-10-08 2016-10-08 Multimedia synchronous playing method, device, system and terminal Active CN106341713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610882817.5A CN106341713B (en) 2016-10-08 2016-10-08 Multimedia synchronous playing method, device, system and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610882817.5A CN106341713B (en) 2016-10-08 2016-10-08 Multimedia synchronous playing method, device, system and terminal

Publications (2)

Publication Number Publication Date
CN106341713A CN106341713A (en) 2017-01-18
CN106341713B true CN106341713B (en) 2017-11-28

Family

ID=57838723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610882817.5A Active CN106341713B (en) 2016-10-08 2016-10-08 Multimedia synchronous playing method, device, system and terminal

Country Status (1)

Country Link
CN (1) CN106341713B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113707B (en) * 2018-01-30 2024-03-22 四川中电昆辰科技有限公司 Multi-frequency point positioning data return system, positioning system and method thereof
TWI690878B (en) * 2018-11-02 2020-04-11 緯創資通股份有限公司 Synchronous playback system and synchronous playback method
US20220417619A1 (en) * 2019-09-24 2022-12-29 Guangzhou Huya Technology Co., Ltd Processing and playing control over interactive video
CN112637658A (en) * 2020-03-17 2021-04-09 西安诺瓦星云科技股份有限公司 Media playing control method, device and system and multi-terminal synchronous playing system
CN112055242A (en) * 2020-09-02 2020-12-08 中国第一汽车股份有限公司 Video synchronous playing method, device, system and storage medium
CN115314744A (en) * 2022-07-01 2022-11-08 深圳市丝路蓝创意展示有限公司 Synchronous playing method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872261A (en) * 2016-06-15 2016-08-17 维沃移动通信有限公司 Audio playing method and mobile terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1298157C (en) * 2004-11-30 2007-01-31 北京中星微电子有限公司 Audio and visual frequencies synchronizing method for IP network conference
CN103475908A (en) * 2013-07-23 2013-12-25 北京九华互联科技有限公司 Multi-screen synchronization play method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872261A (en) * 2016-06-15 2016-08-17 维沃移动通信有限公司 Audio playing method and mobile terminal

Also Published As

Publication number Publication date
CN106341713A (en) 2017-01-18

Similar Documents

Publication Publication Date Title
CN106373600B (en) Audio synchronous playing method, device, system and terminal
CN106341713B (en) Multimedia synchronous playing method, device, system and terminal
CN103905879B (en) The method, apparatus and equipment that a kind of video data and audio data are played simultaneously
CN103905876A (en) Video data and audio data synchronized playing method and device and equipment
CN106452643B (en) playing control method, device, terminal and playing system
CN103905881B (en) The method, apparatus and equipment that a kind of video data and audio data are played simultaneously
US9760998B2 (en) Video processing method and apparatus
CN106411447B (en) playing control method, device and terminal
CN103905878A (en) Video data and audio data synchronized playing method and device and equipment
CN106411448A (en) Play control method, device and terminal
CN106254924B (en) Multimedia data playing method, system and related equipment
CN106448714A (en) A method, device and system for synchronous playback of playback equipment
CN106453597B (en) Method, device and system for adjusting data synchronization period
CN107817988A (en) Push message management method and related products
CN106452644A (en) Play control method, device and terminal
CN106653068A (en) A method, device and terminal for playing audio data
CN106412625B (en) multimedia synchronous playing method, device, terminal and system
CN106412629B (en) Method, device and system for processing media data transmission and computer readable media
CN103458064A (en) Method, device and terminal equipment for transmitting address information of multimedia information
CN106454420B (en) Clock synchronization method and device
CN106454421B (en) A clock adjustment method, device, terminal and multimedia synchronous playback system
CN106375823B (en) Clock adjusting method, device, terminal and multimedia synchronous playing system
CN106445458B (en) Playing control method, device and terminal
CN103345930B (en) data synthesis method, device and terminal
CN112203116A (en) Video generation method, video playing method and related equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: Guangdong Opel Mobile Communications Co., Ltd.