CN101887739A - Method and device for media playback synchronization - Google Patents
Method and device for media playback synchronization Download PDFInfo
- Publication number
- CN101887739A CN101887739A CN 201010219621 CN201010219621A CN101887739A CN 101887739 A CN101887739 A CN 101887739A CN 201010219621 CN201010219621 CN 201010219621 CN 201010219621 A CN201010219621 A CN 201010219621A CN 101887739 A CN101887739 A CN 101887739A
- Authority
- CN
- China
- Prior art keywords
- synchronization
- data
- interval
- synchronization reference
- media
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/04—Synchronising
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/4302—Content synchronisation processes, e.g. decoder synchronisation
- H04N21/4305—Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Television Signal Processing For Recording (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
一种电子技术领域媒体播放同步的方法,实时获取媒体播放各同步基准的数据;以本地系统时钟为参考分析各同步基准的数据的波动;以波动最小的数据对应的同步基准作为当前同步基准,执行媒体播放同步操作。本发明实施例相应的提供一种媒体播放设备。本发明实施例实时的监控几种同步基准的可靠性,可以根据媒体播放的实际情况确定同步基准,实现了动态调整媒体播放同步基准,最大程度的消除因PTS、PCR常带来的音视频停顿、丢帧等问题,使得实际的播放效果达到最佳的流畅程度,改善用户体验。
A method for media playback synchronization in the field of electronic technology, which obtains the data of each synchronization reference in media playback in real time; uses the local system clock as a reference to analyze the fluctuation of the data of each synchronization reference; uses the synchronization reference corresponding to the data with the smallest fluctuation as the current synchronization reference, Perform media playback synchronization operations. Correspondingly, an embodiment of the present invention provides a media playing device. The embodiment of the present invention monitors the reliability of several synchronization references in real time, and can determine the synchronization reference according to the actual situation of media playback, realizes the dynamic adjustment of the synchronization reference of media playback, and eliminates the audio and video pauses often caused by PTS and PCR to the greatest extent. , frame loss and other issues, so that the actual playback effect reaches the best smoothness and improves the user experience.
Description
技术领域technical field
本发明涉及电子技术领域,尤其涉及媒体播放同步的方法及装置。The invention relates to the field of electronic technology, in particular to a method and device for synchronizing media playback.
背景技术Background technique
媒体播放设备一般都具有音视频播放的同步功能,即画面和声音是同步播放的,以对用户提供很好的观看体验,尤其在播放新闻类节目时,唇音同步对用户体验很关键。Media playback devices generally have the synchronization function of audio and video playback, that is, the picture and sound are played synchronously to provide users with a good viewing experience, especially when playing news programs, lip synchronization is critical to user experience.
目前,媒体播放设备的同步方式有如下几种:音频同步、节目时钟参考(PCR,Programe Clock Reference)同步、视频同步。所述音频同步,即视频和字幕跟随音频,以音频播放时戳(PTS,Play Time Stamp)为基准进行同步;所述PCR同步,即节目发送端提供的一个节目时钟参考,音视频和字幕以该时钟参考为基准进行同步;所述视频同步,即音频和字幕以视频PTS为基准实现同步。At present, the synchronization methods of media playback devices are as follows: audio synchronization, program clock reference (PCR, Program Clock Reference) synchronization, and video synchronization. The audio synchronization, that is, video and subtitles follow the audio, and synchronize with the audio playback time stamp (PTS, Play Time Stamp); the PCR synchronization, that is, a program clock reference provided by the program sending end, audio and video and subtitles with The clock reference is used as a reference for synchronization; the video synchronization, that is, audio and subtitles are synchronized based on the video PTS.
下面以图1中所示为例说明具体同步过程:The following uses the example shown in Figure 1 to illustrate the specific synchronization process:
1)首先,媒体设备播放器在开始播放媒体文件时指定一个同步基准,如音频。这个基准可以由开发者在开发时指定,或者用户通过播放器的界面指定。1) First, the media device player specifies a synchronization reference, such as audio, when starting to play a media file. This benchmark can be specified by the developer during development, or specified by the user through the player's interface.
2)然后,媒体设备播放器在播放过程中根据指定的同步基准从媒体数据流中提取音频的PTS,以该PTS生成一个参考时钟。2) Then, the media device player extracts the PTS of the audio from the media data stream according to the specified synchronization reference during playing, and generates a reference clock with the PTS.
3)当要播放非同步基准的数据(视频)时,首先,要播放的非同步基准的数据的PTS要和第2)步生成的参考时钟比较。如果要播放的数据的PTS与参考时钟基本相等,则播放,该基本相等是指,PTS落在参考时钟附近的区间内,在这个区间内,人眼一般不易察觉不同步的情况。如果播放的数据早于参考时钟,即PTS<参考时钟区间,就丢弃。反之,若晚于参考时钟区间就等待,等到PTS落在参考时钟区间内再播放。3) When the data (video) of the asynchronous reference is to be played, first, the PTS of the data of the asynchronous reference to be played is compared with the reference clock generated in step 2). If the PTS of the data to be played is substantially equal to the reference clock, then play. The substantially equal means that the PTS falls within a range near the reference clock. In this range, it is generally difficult for human eyes to detect out-of-sync conditions. If the played data is earlier than the reference clock, that is, PTS<reference clock interval, it is discarded. On the contrary, if it is later than the reference clock interval, it will wait until the PTS falls within the reference clock interval before playing.
发明人在实现本发明过程中发现,现有技术的同步方法至少存在如下缺点:The inventor found in the process of realizing the present invention that the synchronization method of the prior art has at least the following disadvantages:
在播放启动时就指定了同步基准,是通过开发者或者用户界面指定的,虽然用户可以在播放过程中再次指定,但是指定后,播放器就被动的使用这个同步基准,而播放过程中该指定的同步基准有可能不稳定,或者根本不存在,此时就无法实现各播放数据的同步,可能会造成音视频卡、顿、跳跃等现象。The synchronization reference is specified when the playback is started, which is specified by the developer or the user interface. Although the user can specify it again during the playback process, after the designation, the player will passively use this synchronization reference, and the specified synchronization reference during the playback process. The synchronization reference may be unstable, or may not exist at all. At this time, the synchronization of each playback data cannot be realized, which may cause audio and video freezes, stuttering, and jumping.
发明内容Contents of the invention
本发明实施例提供一种媒体播放同步的方法及装置,根据媒体播放的实际情况动态调整媒体播放同步基准。Embodiments of the present invention provide a method and device for synchronizing media playback, which dynamically adjusts a media playback synchronization reference according to the actual situation of media playback.
本发明实施例是通过以下技术方案实现的:Embodiments of the present invention are achieved through the following technical solutions:
本发明实施例提供一种媒体播放同步的方法,包括:An embodiment of the present invention provides a method for synchronizing media playback, including:
实时获取媒体播放各同步基准的数据;Real-time access to the data of each synchronization benchmark of media playback;
以本地系统时钟为参考分析各同步基准的数据的波动;Use the local system clock as a reference to analyze the data fluctuation of each synchronization benchmark;
以波动最小的数据对应的同步基准作为当前同步基准,执行媒体播放同步操作。The synchronization reference corresponding to the data with the smallest fluctuation is used as the current synchronization reference, and the media playback synchronization operation is performed.
本发明实施例提供一种媒体播放设备,包括:媒体播放单元、获取单元、分析单元、同步基准确定单元;An embodiment of the present invention provides a media playback device, including: a media playback unit, an acquisition unit, an analysis unit, and a synchronization reference determination unit;
所述媒体播放单元,用于播放媒体文件;The media playing unit is used to play media files;
所述获取单元,用于实时获取媒体播放各同步基准的数据;The acquisition unit is used to acquire the data of each synchronization reference of media playback in real time;
所述分析单元,用于以本地系统时钟为参考分析各同步基准的数据的波动;The analysis unit is used to analyze the data fluctuation of each synchronization reference with the local system clock as a reference;
所述同步基准确定单元,用于以波动最小的数据对应的同步基准作为当前执行媒体播放同步操作的同步基准;The synchronization reference determination unit is used to use the synchronization reference corresponding to the data with the smallest fluctuation as the synchronization reference for the current media playback synchronization operation;
所述媒体播放单元,还用于以所述同步基准确定单元确定的同步基准执行媒体播放同步操作。The media playing unit is further configured to perform a media playing synchronization operation based on the synchronization reference determined by the synchronization reference determination unit.
由上述本发明实施例提供的技术方案可以看出,本发明实施例实时的监控几种同步基准的可靠性,可以根据媒体播放的实际情况确定同步基准,实现了动态调整媒体播放同步基准,最大程度的消除因PTS、PCR常带来的音视频停顿、丢帧等问题,使得实际的播放效果达到最佳的流畅程度,改善用户体验。It can be seen from the technical solution provided by the above-mentioned embodiments of the present invention that the embodiment of the present invention monitors the reliability of several synchronization references in real time, and can determine the synchronization reference according to the actual situation of media playback, thereby realizing the dynamic adjustment of the synchronization reference of media playback. Eliminate the audio and video pauses and frame loss problems caused by PTS and PCR to a certain extent, so that the actual playback effect can reach the best smoothness and improve user experience.
附图说明Description of drawings
图1为现有技术音视频同步过程;Fig. 1 is prior art audio-video synchronization process;
图2为本发明实施例媒体播放同步的方法流程图;Fig. 2 is a flow chart of a method for synchronizing media playback in an embodiment of the present invention;
图3为本发明实施例区间划分示意图;FIG. 3 is a schematic diagram of interval division according to an embodiment of the present invention;
图4为本发明一个实施例媒体播放设备结构示意图;Fig. 4 is a schematic structural diagram of a media player device according to an embodiment of the present invention;
图5为本发明另一个实施例媒体播放设备结构示意图;5 is a schematic structural diagram of a media playback device according to another embodiment of the present invention;
图6为本发明实施例媒体播放设备中分析单元结构示意图;6 is a schematic structural diagram of an analyzing unit in a media player device according to an embodiment of the present invention;
图7为本发明实施例媒体播放设备中同步基准确定单元结构示意图;7 is a schematic structural diagram of a synchronization reference determination unit in a media playback device according to an embodiment of the present invention;
图8为本发明实施例媒体播放设备中各单元配合实现媒体同步示意图。Fig. 8 is a schematic diagram of cooperation of various units in a media player device according to an embodiment of the present invention to realize media synchronization.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,可以理解的是,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. It should be understood that the described embodiments are only some of the embodiments of the present invention, not all of them. example. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明一个实施例提供一种媒体播放同步的方法,以图2中所示为例,包括如下步骤:An embodiment of the present invention provides a method for synchronizing media playback, taking the example shown in Figure 2 as an example, including the following steps:
步骤10:实时获取媒体播放各同步基准的数据;Step 10: Obtain the data of each synchronization reference of media playback in real time;
步骤11:以本地系统时钟为参考分析各同步基准的数据的波动;Step 11: Taking the local system clock as a reference to analyze the data fluctuation of each synchronization benchmark;
步骤12:以波动最小的数据对应的同步基准作为当前同步基准,执行媒体播放同步操作。Step 12: Using the synchronization reference corresponding to the data with the smallest fluctuation as the current synchronization reference, perform a media playback synchronization operation.
其中,在步骤10中,所述媒体播放各同步基准的数据包括:节目时钟参考PCR、音频PTS或视频PTS中的一种或多种,即可以作为媒体播放同步基准的数据;Wherein, in
其中,在步骤11中,所述以本地系统时钟为参考分析各同步基准的数据的波动包括:Wherein, in
S110:将获取的所述各同步基准的数据与本地系统时钟(STC,SystemTime Clock)比较,记录各同步基准的数据的偏差值;S110: compare the acquired data of each synchronization reference with a local system clock (STC, SystemTime Clock), and record the deviation value of the data of each synchronization reference;
S111:获取所述各同步基准的数据的时间达到规定时间后,分别针对各同步基准计算所记录的各同步基准的数据的偏差值的平均值;例如,可以规定每采样1分钟后,分别计算所述各同步基准的数据的偏差值的平均值。S111: After the time for obtaining the data of each synchronization reference reaches the specified time, calculate the average value of the deviation value of the recorded data of each synchronization reference for each synchronization reference; The average value of deviation values of the data of each synchronization reference.
S112:分别统计各同步基准的数据的偏差值落在每个区间的点数,根据所述偏差值落在每个区间的点数以及各区间系数计算各同步基准的加权和;所述区间为以各同步基准的数据计算得到的所述平均值为中心定义的N个区间,N为大于零的自然数;S112: respectively counting the number of points where the deviation value of the data of each synchronization reference falls in each interval, and calculating the weighted sum of each synchronization reference according to the number of points where the deviation value falls in each interval and the coefficients of each interval; The average value calculated from the data of the synchronization benchmark is N intervals defined by the center, and N is a natural number greater than zero;
计算加权和的方法可以采用如下公式:The method of calculating the weighted sum can use the following formula:
加权和=区间1点数×区间1系数+区间2点数×区间2系数+...+区间N点数×区间N系数。Weighted sum = Points in Section 1 × Coefficient in Section 1 + Points in Section 2 x Coefficient in Section 2 + ... + Points in Section N x Coefficient in Section N.
其中,所述区间1到所述中心的距离<所述区间2到所述中心的距离<...<所述区间N到所述中心的距离;所述区间1系数>所述区间2系数>...>所述区间N系统。针对各种同步基准,所划分的区间以及各区间系数相同。Wherein, the distance from the interval 1 to the center<the distance from the interval 2 to the center<...<the distance from the interval N to the center; the interval 1 coefficient>the interval 2 coefficient > ... > the interval N system. The divided intervals and the coefficients for each interval are the same for various synchronization references.
S113:根据所述加权和确定波动大小,即波动随着加权和的减小而变大。S113: Determine the magnitude of the fluctuation according to the weighted sum, that is, the fluctuation becomes larger as the weighted sum decreases.
其中,在步骤12中,所述以波动最小的数据对应的同步基准作为当前同步基准,执行媒体播放同步操作包括:根据所述确定的同步基准生成参考时钟,并以所述参考时钟生成单元生成的参考时钟执行媒体播放同步操作。Wherein, in
本发明实施例实时的监控几种同步基准的可靠性,根据媒体播放的实际情况确定同步基准,实现了动态调整媒体播放同步基准,最大程度的消除因PTS、PCR常带来的音视频停顿、丢帧等问题,使得实际的播放效果达到最佳的流畅程度,改善用户体验。The embodiment of the present invention monitors the reliability of several synchronization references in real time, determines the synchronization reference according to the actual situation of media playback, realizes the dynamic adjustment of the synchronization reference of media playback, and eliminates audio and video pauses caused by PTS and PCR to the greatest extent. Problems such as frame loss make the actual playback effect reach the best fluency and improve user experience.
为进一步理解本发明,下面举例说明确定同步基准的过程,包括如下操作:In order to further understand the present invention, the following examples illustrate the process of determining the synchronization reference, including the following operations:
1)在媒体播放过程中,实时采样获得PCR、音频PTS和视频PTS;1) During media playback, real-time sampling to obtain PCR, audio PTS and video PTS;
2)将采样获得的PCR、音频PTS和视频PTS分别与本地系统时钟STC比较,记录偏差值;2) compare the obtained PCR, audio PTS and video PTS with the local system clock STC respectively, and record the deviation value;
例如,对于获得的音频PTS0,PTS 1,...,PTSn-1,记录的偏差值为PTSDELTA0,PTSDELTA1,...,PTSDELTAn-1;其中,For example, for the obtained audio PTS0, PTS 1, ..., PTSn-1, the recorded deviation value is PTSDELTA0, PTSDELTA1, ..., PTSDELTAn-1; where,
PTSDELTA0=PTS0-STC;PTSDELTA0=PTS0-STC;
PTSDELTA1=PTS1-STC;PTSDELTA1=PTS1-STC;
PTSDELTAn-1=PTSn-1-STC;PTSDELTAn-1 = PTSn-1-STC;
3)采样时间达到归定时间,如1分钟后,分别针对每个同步基准的数据记录的所有偏差计算平均值;3) After the sampling time reaches the set time, for example, after 1 minute, the average value is calculated for all deviations of the data records of each synchronization benchmark;
例如,对于记录的音频PTS的偏差值TSDELTA0,PTSDELTA1,...,PTSDELTAn-1,计算平均值Avg:For example, for deviation values TSDELTA0, PTSDELTA1, ..., PTSDELTAn-1 of the recorded audio PTS, calculate the average value Avg:
Avg=(PTSDELTA0+PTSDELTA1+...+PTSDELTAn-1)/n;Avg=(PTSDELTA0+PTSDELTA1+...+PTSDELTAn-1)/n;
可以理解的是,本发明实施例是以采样时间达到规定时间作为计算平均值的时机,但不排除其他判断计算平均值时机的方式,例如,也可以在采样达到规定次数时计算平均值。It can be understood that, in this embodiment of the present invention, the timing of calculating the average value is based on the sampling time reaching the specified time, but other methods of judging the timing of calculating the average value are not excluded. For example, the average value can also be calculated when the sampling time reaches the specified number of times.
对于PCR及视频PTS,根据与音频PTS计算偏差值同样的方法计算与本地系统时钟的偏差值。For PCR and video PTS, the deviation value from the local system clock is calculated in the same way as the calculation deviation value of the audio PTS.
4)以各平均值为中心,定义5个区间,统计落在每个区间的采样点数:S1,S2,S3,S4,S5;如图3中所示为以Avg为中心定义的区间形式;4) take each average value as the center, define 5 intervals, and count the number of sampling points falling in each interval: S1, S2, S3, S4, S5; as shown in Figure 3, it is the interval form defined as the center with Avg;
PCR、音频PTS和视频PTS所定义的区间形式相同,即各区间之间的时间差相同,各区间系统也相同,区间的中心为根据各同步基准的数据计算获得的Avg。The intervals defined by PCR, audio PTS, and video PTS have the same form, that is, the time difference between each interval is the same, and the interval system is also the same. The center of the interval is the Avg calculated based on the data of each synchronization reference.
5)根据所述落在每个区间的采样点数(S1,S2,S3,S4,S5)以及各区间系数计算各同步基准的加权和;本实例中设定区间1系数为16,落在区间1的采样点数为S1,区间2系数为8,落在区间2的采样点数为S2,区间3系数为4,落在区间3的采样点数为S3,区间4系数为2,落在区间4的采样点数为S4,区间5系数为1,落在区间5的采样点数为S5;则加权和计算公式为:5) Calculate the weighted sum of each synchronization reference according to the number of sampling points (S1, S2, S3, S4, S5) falling in each interval and the coefficients of each interval; set the interval 1 coefficient to be 16 in this example, and fall in the interval The number of sampling points of 1 is S1, the coefficient of interval 2 is 8, the number of sampling points falling in interval 2 is S2, the coefficient of interval 3 is 4, the number of sampling points falling in interval 3 is S3, the coefficient of interval 4 is 2, and the number of sampling points falling in interval 4 is The number of sampling points is S4, the coefficient of interval 5 is 1, and the number of sampling points falling in interval 5 is S5; then the weighted sum calculation formula is:
加权和=S1*16+S2*8+S3*4+S4*2+S5;Weighted sum=S1*16+S2*8+S3*4+S4*2+S5;
6)根据各同步基准的加权和大小判定波动大小,加权和大,采样点就集中,则认为波动较小。由此来确定PCR和音/频PTS的优劣,将波动最小的同步基准作为当前媒体播放的同步基准,并根据确定的同步基准生成参考时钟,进行媒体播放同步操作。6) Determine the magnitude of the fluctuation according to the weighted sum of each synchronization reference. If the weighted sum is large, the sampling points are concentrated, and the fluctuation is considered to be small. In this way, the advantages and disadvantages of PCR and audio/frequency PTS are determined, and the synchronization reference with the smallest fluctuation is used as the synchronization reference of current media playback, and a reference clock is generated according to the determined synchronization reference to perform media playback synchronization operations.
本发明实施例实现了动态调整媒体播放同步基准,最大程度的消除因PTS、PCR常带来的音视频停顿、丢帧等问题,使得实际的播放效果达到最佳的流畅程度,改善用户体验。The embodiment of the present invention realizes the dynamic adjustment of the media playback synchronization standard, and eliminates the audio and video pauses and frame loss problems caused by PTS and PCR to the greatest extent, so that the actual playback effect can achieve the best smoothness and improve user experience.
本发明实施例还提供一种媒体播放设备,以图4中所示为例,该媒体播放设备包括:媒体播放单元40、获取单元41、分析单元42、同步基准确定单元43;The embodiment of the present invention also provides a media playback device, taking the example shown in FIG. 4 , the media playback device includes: a
所述媒体播放单元40,用于播放媒体文件;The
所述获取单元41,用于实时获取媒体播放各同步基准的数据;所述媒体播放各同步基准的数据包括:节目时钟参考PCR、音频PTS和视频PTS,即可以作为媒体播放同步基准的数据;The
所述分析单元42,用于以本地系统时钟为参考分析各同步基准的数据的波动;The
所述同步基准确定单元43,用于以波动最小的数据对应的同步基准作为当前执行媒体播放同步操作的同步基准;The synchronization
所述媒体播放单元40,还用于以所述同步基准确定单元确定的同步基准执行媒体播放同步操作。The
如图5所示,所述媒体播放器,还可以包括:As shown in Figure 5, the media player may also include:
时钟监控单元44,用于监控所述获取单元获取所述各同步基准的数据的时间,提供给所述平均值计算子单元作为判定计算平均值的时机。The
如图6中所示,所述分析单元42可以进一步包括:As shown in Figure 6, the
偏差记录子单元421,用于将获取的所述各同步基准的数据与本地系统时钟比较,记录各同步基准的数据的偏差值;
平均值计算子单元422,用于在所述获取单元获取所述各同步基准的数据的时间达到规定时间后,分别针对所述记录的各同步基准的数据的偏差值计算平均值:The average
统计子单元423,用于统计每个同步基准的数据的偏差值落在每个区间的点数;所述区间为以每个所述平均值为中心定义的N个区间,N为大于零的自然数;The
加权和计算子单元424,用于根据所述偏差值落在每个区间的点数以及各区间系数计算各同步基准的加权和,波动随着加权和的减小而变大。The weighted
可以理解的是,本发明实施例所述分析单元的结构仅为发明人所列举的一种实施例,在实现分析单元当前功能的前提下,其他结构划分均在本发明保护范围内。It can be understood that the structure of the analysis unit described in the embodiment of the present invention is only an embodiment listed by the inventor, and other structural divisions are within the protection scope of the present invention on the premise of realizing the current function of the analysis unit.
如图7中所示,所述同步基准确定单元43可以进一步包括:As shown in FIG. 7, the synchronization
同步基准确定子单元431,用于以波动最小的数据对应的同步基准作为当前执行媒体播放同步操作的同步基准;The synchronization
参考时钟生成子单元432,用于根据确定的同步基准生成参考时钟。The reference
如图8中所示,为本发明实施例所述的媒体播放设备各单元之间配合实现媒体同步示意图,媒体数据经过前处理,该前处理过程本发明实施例对此不做限定,例如包括解复用的处理,前处理后,获取单元获取各同步基准的数据,例如包括:PCR、音频PTS和视频PTS。时钟监控单元监控获取单元获取所述各同步基准的数据的时间,将该时间提供给分析单元,在获取时间达到规定时间后,该分析单元开始执行分析操作,即以本地系统时钟为参考分析各同步基准的数据的波动,之后同步基准确定单元根据该分析单元的分析结果,获知各同步基准的优劣,确定以波动最小的数据对应的同步基准作为当前执行媒体播放同步操作的同步基准,根据该确定的同步基准计算出参考时钟,媒体播放单元根据该参考时钟执行媒体播放同步操作。As shown in FIG. 8 , it is a schematic diagram of media synchronization between the various units of the media player device described in the embodiment of the present invention. The media data is pre-processed, and the pre-processing process is not limited in this embodiment of the present invention. For example, it includes In the demultiplexing process, after the pre-processing, the acquisition unit acquires the data of each synchronization reference, including, for example, PCR, audio PTS and video PTS. The clock monitoring unit monitors the time when the acquisition unit acquires the data of each synchronization reference, and provides the time to the analysis unit. After the acquisition time reaches the specified time, the analysis unit starts to perform the analysis operation, that is, analyzes the data of each synchronization reference with the local system clock as a reference. The fluctuation of the data of the synchronous benchmark, then the synchronous benchmark determining unit knows the pros and cons of each synchronous benchmark according to the analysis result of the analysis unit, and determines the synchronous benchmark corresponding to the data with the smallest fluctuation as the synchronous benchmark for currently executing the media playback synchronous operation, according to The determined synchronization reference calculates a reference clock, and the media playback unit executes a media playback synchronization operation according to the reference clock.
本发明实施例所述媒体播放设备实时的监控几种同步基准的可靠性,可以根据媒体播放的实际情况确定同步基准,实现了动态调整媒体播放同步基准,最大程度的消除因PTS、PCR常带来的音视频停顿、丢帧等问题,使得实际的播放效果达到最佳的流畅程度,改善用户体验。The media playback device described in the embodiment of the present invention monitors the reliability of several synchronization references in real time, can determine the synchronization reference according to the actual situation of media playback, realizes the dynamic adjustment of the media playback synchronization reference, and eliminates the constant band caused by PTS and PCR to the greatest extent. Audio and video pauses, frame loss and other problems, so that the actual playback effect can achieve the best fluency and improve user experience.
综上所述,本发明实施例实时的监控几种同步基准的可靠性,可以根据媒体播放的实际情况确定同步基准,实现了动态调整媒体播放同步基准,最大程度的消除因PTS、PCR常带来的音视频停顿、丢帧等问题,使得实际的播放效果达到最佳的流畅程度,改善用户体验。In summary, the embodiment of the present invention monitors the reliability of several synchronization references in real time, can determine the synchronization reference according to the actual situation of media playback, realizes the dynamic adjustment of the synchronization reference of media playback, and eliminates the frequent bands caused by PTS and PCR to the greatest extent. Audio and video pauses, frame loss and other problems, so that the actual playback effect can achieve the best fluency and improve user experience.
本领域普通技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一计算机可读存储介质中,例如只读存储器(简称ROM)、随机存取存储器(简称RAM)、磁盘、光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory ( ROM for short), random access memory (RAM for short), magnetic disk, optical disk, etc.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010102196210A CN101887739B (en) | 2010-06-25 | 2010-06-25 | Method and device for synchronizing media play |
PCT/CN2011/074986 WO2011150826A1 (en) | 2010-06-25 | 2011-05-31 | Method and device for synchronization during media playback |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010102196210A CN101887739B (en) | 2010-06-25 | 2010-06-25 | Method and device for synchronizing media play |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101887739A true CN101887739A (en) | 2010-11-17 |
CN101887739B CN101887739B (en) | 2012-07-04 |
Family
ID=43073615
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010102196210A Expired - Fee Related CN101887739B (en) | 2010-06-25 | 2010-06-25 | Method and device for synchronizing media play |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN101887739B (en) |
WO (1) | WO2011150826A1 (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011150826A1 (en) * | 2010-06-25 | 2011-12-08 | 华为技术有限公司 | Method and device for synchronization during media playback |
CN105721920A (en) * | 2014-12-04 | 2016-06-29 | 中国移动通信集团公司 | Method and apparatus for cooperative playing of media on multi devices, and terminal |
CN106028066A (en) * | 2015-03-24 | 2016-10-12 | 英特尔公司 | Distributed media stream synchronization control |
CN107515825A (en) * | 2017-08-22 | 2017-12-26 | 网易(杭州)网络有限公司 | Fluency method of testing and device, storage medium, terminal |
CN110858922A (en) * | 2018-08-23 | 2020-03-03 | 晨星半导体股份有限公司 | Operation method of digital video and audio device |
CN114339353A (en) * | 2021-12-31 | 2022-04-12 | 晶晨半导体科技(北京)有限公司 | Audio and video synchronization method and device, electronic device and computer-readable storage medium |
CN114397671A (en) * | 2022-03-24 | 2022-04-26 | 智道网联科技(北京)有限公司 | Course angle smoothing method and device of target and computer readable storage medium |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118646930B (en) * | 2024-08-16 | 2024-11-12 | 浙江嗨皮网络科技有限公司 | Video background processing method, system and storage medium based on network signal strength |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1436001A (en) * | 2002-01-28 | 2003-08-13 | 北京华诺信息技术有限公司 | Method for synchronizing video with audio in decoding system |
CN101083771A (en) * | 2006-05-31 | 2007-12-05 | 松下电器产业株式会社 | Stream data processing apparatus and stream data processing method |
CN101710997A (en) * | 2009-11-04 | 2010-05-19 | 中兴通讯股份有限公司 | MPEG-2 (Moving Picture Experts Group-2) system based method and system for realizing video and audio synchronization |
CN101729906A (en) * | 2008-10-16 | 2010-06-09 | 财团法人工业技术研究院 | Mobile television system and method for synchronizing broadcast stream service thereof |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005123789A (en) * | 2003-10-15 | 2005-05-12 | Matsushita Electric Ind Co Ltd | Av synchronization system |
CN101036389B (en) * | 2004-09-02 | 2012-05-02 | 索尼株式会社 | Content receiving apparatus, video/audio output timing control method, and content providing system |
CN101887739B (en) * | 2010-06-25 | 2012-07-04 | 华为技术有限公司 | Method and device for synchronizing media play |
-
2010
- 2010-06-25 CN CN2010102196210A patent/CN101887739B/en not_active Expired - Fee Related
-
2011
- 2011-05-31 WO PCT/CN2011/074986 patent/WO2011150826A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1436001A (en) * | 2002-01-28 | 2003-08-13 | 北京华诺信息技术有限公司 | Method for synchronizing video with audio in decoding system |
CN101083771A (en) * | 2006-05-31 | 2007-12-05 | 松下电器产业株式会社 | Stream data processing apparatus and stream data processing method |
CN101729906A (en) * | 2008-10-16 | 2010-06-09 | 财团法人工业技术研究院 | Mobile television system and method for synchronizing broadcast stream service thereof |
CN101710997A (en) * | 2009-11-04 | 2010-05-19 | 中兴通讯股份有限公司 | MPEG-2 (Moving Picture Experts Group-2) system based method and system for realizing video and audio synchronization |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011150826A1 (en) * | 2010-06-25 | 2011-12-08 | 华为技术有限公司 | Method and device for synchronization during media playback |
CN105721920A (en) * | 2014-12-04 | 2016-06-29 | 中国移动通信集团公司 | Method and apparatus for cooperative playing of media on multi devices, and terminal |
CN105721920B (en) * | 2014-12-04 | 2019-04-02 | 中国移动通信集团公司 | A kind of media cooperate with the method, apparatus and terminal of broadcasting in more equipment |
CN106028066A (en) * | 2015-03-24 | 2016-10-12 | 英特尔公司 | Distributed media stream synchronization control |
CN106028066B (en) * | 2015-03-24 | 2019-02-15 | 英特尔公司 | Distributed media stream synchronously control |
CN107515825A (en) * | 2017-08-22 | 2017-12-26 | 网易(杭州)网络有限公司 | Fluency method of testing and device, storage medium, terminal |
CN110858922A (en) * | 2018-08-23 | 2020-03-03 | 晨星半导体股份有限公司 | Operation method of digital video and audio device |
CN114339353A (en) * | 2021-12-31 | 2022-04-12 | 晶晨半导体科技(北京)有限公司 | Audio and video synchronization method and device, electronic device and computer-readable storage medium |
WO2023124173A1 (en) * | 2021-12-31 | 2023-07-06 | 晶晨半导体(上海)股份有限公司 | Audio and video synchronization method and apparatus, electronic device and computer-readable storage medium |
CN114339353B (en) * | 2021-12-31 | 2023-09-29 | 晶晨半导体科技(北京)有限公司 | Audio and video synchronization method and device, electronic equipment and computer-readable storage medium |
CN114397671A (en) * | 2022-03-24 | 2022-04-26 | 智道网联科技(北京)有限公司 | Course angle smoothing method and device of target and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2011150826A1 (en) | 2011-12-08 |
CN101887739B (en) | 2012-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101887739B (en) | Method and device for synchronizing media play | |
JP5147180B2 (en) | Software-based audio rendering | |
EP1845724A1 (en) | Recording/reproduction device, recording/reproduction method, recording/reproduction apparatus and recording/reproduction method, and recording medium storing recording/reproduction program, and integrated circuit for use in recording/reproduction apparatus | |
CN105049917B (en) | The method and apparatus of recording audio/video synchronized timestamp | |
US20140376873A1 (en) | Video-audio processing device and video-audio processing method | |
WO2017107516A1 (en) | Method and device for playing network video | |
CN110335590B (en) | Voice recognition test method, device and system | |
CN110519627B (en) | Audio data synchronization method and device | |
CN109275008A (en) | A kind of method and apparatus of audio-visual synchronization | |
CN109168059A (en) | A kind of labial synchronization method playing audio & video respectively on different devices | |
CN106658135B (en) | A kind of audio and video playing method and device | |
CN107948672A (en) | Preserve the method and system and server, Wearable of video data | |
CN103873919B (en) | A kind of information processing method and electronic equipment | |
CN111954064A (en) | Audio and video synchronization method and device | |
CN107371053B (en) | Audio and video stream contrast analysis method and device | |
CN103581730A (en) | Method for achieving synchronization of audio and video on digital set top box | |
CN104618737B (en) | The slow synchronous method of stream media system clock and its device | |
CN106331820B (en) | Audio and video synchronization processing method and device | |
CN104506957A (en) | A method and device for displaying subtitles | |
CN105760807A (en) | Reminding device and reminding method for wonderful sports events | |
WO2005069635A1 (en) | Method and apparatus for performing synchronised audio and video presentation | |
CN105380679B (en) | The control method and system of supersonic imaging apparatus | |
CN115914708A (en) | Media audio and video synchronization method and system, electronic device | |
CN111131917B (en) | Real-time audio frequency spectrum synchronization method and playing device | |
CN115883859B (en) | Multimedia data processing method, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170713 Address after: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401 Patentee after: Guangdong Gaohang Intellectual Property Operation Co., Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: Huawei Technologies Co., Ltd. |
|
CB03 | Change of inventor or designer information |
Inventor after: Zhao Lu Inventor before: Qiu Hongguo |
|
CB03 | Change of inventor or designer information | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170930 Address after: 465200 Henan province Xinyang city Gushi County Hong Kong Village left Wei Village Temple Group Patentee after: Zhao Lu Address before: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401 Patentee before: Guangdong Gaohang Intellectual Property Operation Co., Ltd. |
|
TR01 | Transfer of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120704 Termination date: 20180625 |
|
CF01 | Termination of patent right due to non-payment of annual fee |