CN103747316B - A kind of audio and video synchronization method and electronic equipment - Google Patents

A kind of audio and video synchronization method and electronic equipment Download PDF

Info

Publication number
CN103747316B
CN103747316B CN201310733364.6A CN201310733364A CN103747316B CN 103747316 B CN103747316 B CN 103747316B CN 201310733364 A CN201310733364 A CN 201310733364A CN 103747316 B CN103747316 B CN 103747316B
Authority
CN
China
Prior art keywords
time
system clock
timestamp
voice data
video
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
CN201310733364.6A
Other languages
Chinese (zh)
Other versions
CN103747316A (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.)
Xinle Visual Intelligent Electronic Technology Tianjin Co ltd
Leshi Zhixin Electronic Technology Tianjin Co Ltd
Original Assignee
Leshi Zhixin Electronic Technology Tianjin Co 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 Leshi Zhixin Electronic Technology Tianjin Co Ltd filed Critical Leshi Zhixin Electronic Technology Tianjin Co Ltd
Priority to CN201310733364.6A priority Critical patent/CN103747316B/en
Publication of CN103747316A publication Critical patent/CN103747316A/en
Application granted granted Critical
Publication of CN103747316B publication Critical patent/CN103747316B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the present invention provides a kind of audio and video synchronization method and electronic equipment, is related to electronic information technical field, can reduce video in video jitter caused by broadcasting, lifting video playing quality.Its method is:Obtain the timestamp of voice data and the time of system clock that the audio playing module of media content is played, and then obtain the deviation of the timestamp of voice data and the time of system clock, deviation is made comparisons with preset time threshold, determined whether for System Clock time to be synchronized to the timestamp of voice data according to the comparative result, if System Clock time is synchronized to the timestamp of voice data, video data corresponding with the time of system clock is then obtained according to the time of system clock after synchronization, so that video playback module continues to play media content since video data corresponding to the time after system clock synchronization.The embodiment of the present invention is used to synchronize the voice data of media content and video data.

Description

A kind of audio and video synchronization method and electronic equipment
Technical field
The present invention relates to electronic information technical field, more particularly to a kind of audio and video synchronization method and electronic equipment.
Background technology
In Android(Android)In ecosystem system, video is broadcast when the synchronization principles that video file plays are video playbacks Amplification module obtains timestamp of the audio playing module just in playing audio-fequency data, then by obtain voice data timestamp and The timestamp of each frame of video is compared, if error in allowed limits, plays the frame video, if error is permitting Perhaps outside scope, and the timestamp of frame of video is later than the timestamp of voice data, then loses the frame of video, if frame of video Timestamp earlier than voice data timestamp, then when after the regular hour cause frame of video timestamp and voice data when Between play the frame of video again when stabbing synchronous.
In above process, generally, video playback module obtain voice data reproduction time be according to when Between order linearly increase, and the reproduction time of voice data that audio playing module obtains is directly obtained from hardware device , that is to say, that in the case where the timestamp for the voice data that audio playing module obtains is linear increase, when video is broadcast When timestamp when amplification module with reference to audio playing module playing audio-fequency data is to obtain corresponding video data, so that it may so that Obtain audio frequency and video and reach synchronous.
But in some hardware platforms, due to the error reason of some softwares or hardware cause audio playing module without Method obtains the timestamp of accurate voice data, and for example the timestamp for the voice data that audio playing module obtains is step type , when video playback module with reference to the time sequencing of step type to obtain video data, video playback module will be caused Acquired video data is discontinuous, can not be according to the time sequencing playing video data of linear increase so that audio and video playing Asynchronous, the asynchronous of audio and video playing will cause to shake seriously during broadcasting video, if playing video with large-size screen monitors, for example use When Android makees large-size screen monitors television set, jitter phenomenon will be more serious, causes video playing quality poor.
The content of the invention
Embodiments of the invention provide a kind of audio and video synchronization method and electronic equipment, solve when playing video due to sound The problem of video playing quality difference that video jitter caused by video is asynchronous effectively causes, video can be reduced and produced when playing Raw video jitter, lift video playing quality.
To reach above-mentioned purpose, embodiments of the invention adopt the following technical scheme that:
First aspect, there is provided a kind of audio and video synchronization method, including:
In media content playing process, the voice data that the audio playing module of the media content is played is obtained The time of timestamp and system clock, the media content include voice data and video data, and the system clock is from described Media content commences play out moment timing;
The timestamp of the voice data is obtained according to the time of the timestamp of the voice data and the system clock With the deviation of the time of the system clock;
The deviation is made comparisons with preset time threshold, obtains comparative result, is according to comparative result determination The no timestamp that the System Clock time is synchronized to the voice data;
If the System Clock time to be synchronized to the timestamp of the voice data, according to after synchronization during the system Time of clock obtains video data corresponding with the time of the system clock so that video playback module is from the system clock Video data corresponding to time after synchronization starts to continue to play the media content;
If the System Clock time not to be synchronized to the timestamp of the voice data, in real time according to the system The time of clock obtains video data corresponding with the time of the system clock.
It is described by the deviation and preset time threshold with reference in a first aspect, in the first mode in the cards Make comparisons, obtain comparative result, according to the comparative result by the voice data of being time-synchronized to of the system clock Timestamp includes:
The deviation is made comparisons with the preset time threshold;
If the deviation is less than the preset time threshold, it is determined that the comparative result plays for the media content Normally, and not by the timestamp for being time-synchronized to the voice data of the system clock;
If the deviation is more than or equal to the preset time threshold, it is determined that the comparative result is in the media Hold play it is abnormal, and by the timestamp for being time-synchronized to the voice data of the system clock;
Wherein, it is described to be by the timestamp for being time-synchronized to the voice data of the system clock:By the system The time of clock is changed to the timestamp of the voice data.
With reference to the first mode in the cards of first aspect, in second of mode in the cards, it is described to The System Clock time is synchronized to the timestamp of the voice data, then obtained according to the time of the system clock after synchronization Take video data corresponding with the time of the system clock so that video playback module from after the system clock synchronization when Between corresponding video data start to continue to play the media content and include:
If by the timestamp for being time-synchronized to the voice data of the system clock, pass through the video playback mould Block obtains the time after the system clock synchronization;
According to video corresponding to time of the time acquisition after the system clock synchronization after synchronous with the system clock Data, the current video data that the video playback module plays is updated to corresponding with the time after the system clock synchronization Video data;
Continued by the video playback module since video data corresponding to the time after the system clock synchronization Play the media content.
With reference to second of mode in the cards of first aspect, in the third mode in the cards, the deviation It is worth the timestamp and the absolute value of the difference of the time of the system clock for the voice data.
With reference to the third mode in the cards of first aspect, in the 4th kind of mode in the cards, the system The time of clock is linearly incremented by.
Second aspect, there is provided a kind of electronic equipment, including:
Acquiring unit, in media content playing process, the audio playing module for obtaining the media content to be broadcast The timestamp for the voice data put and the time of system clock, the media content includes voice data and video data, described System clock commences play out moment timing from the media content;
The acquiring unit, it is additionally operable to obtain institute according to the timestamp of the voice data and the time of the system clock State the deviation of the timestamp of voice data and the time of the system clock;
Comparing unit, for the deviation to be made comparisons with preset time threshold, comparative result is obtained, according to the ratio Relatively result determines whether for the System Clock time to be synchronized to the timestamp of the voice data;
Processing unit, if the timestamp for the System Clock time to be synchronized to the voice data, according to same The time of the system clock obtains video data corresponding with the time of the system clock after step so that video playback module Continue to play the media content since video data corresponding to the time after the system clock synchronization;
The processing unit, if being additionally operable to not be synchronized to the System Clock time timestamp of the voice data, Video data corresponding with the time of the system clock is then obtained according to the time of the system clock in real time.
With reference to second aspect, in the first mode in the cards, the comparing unit is specifically used for:
The deviation is made comparisons with the preset time threshold;
If the deviation is less than the preset time threshold, it is determined that the comparative result plays for the media content Normally, and not by the timestamp for being time-synchronized to the voice data of the system clock;
If the deviation is more than or equal to the preset time threshold, it is determined that the comparative result is in the media Hold play it is abnormal, and by the timestamp for being time-synchronized to the voice data of the system clock;
Wherein, the comparing unit is for by the timestamp for being time-synchronized to the voice data of the system clock When, it is what is realized by the way that the time of the system clock to be changed to the timestamp of the voice data.
With reference to the first mode in the cards of second aspect, in second of mode in the cards, the processing Unit is specifically used for:
If by the timestamp for being time-synchronized to the voice data of the system clock, pass through the video playback mould Block obtains the time after the system clock synchronization;
According to video corresponding to time of the time acquisition after the system clock synchronization after synchronous with the system clock Data, the current video data that the video playback module plays is updated to corresponding with the time after the system clock synchronization Video data;
Continued by the video playback module since video data corresponding to the time after the system clock synchronization Play the media content.
With reference to second of mode in the cards of second aspect, in the third mode in the cards, the deviation It is worth the timestamp and the absolute value of the difference of the time of the system clock for the voice data.
With reference to second of mode in the cards of second aspect, in the third mode in the cards, the system The time of clock is linearly incremented by.
The embodiment of the present invention provides a kind of audio and video synchronization method and electronic equipment, by media content playing process In, the timestamp of voice data and the time of system clock that the audio playing module of media content is played are obtained, in media Appearance include voice data and video data, system clock commences play out moment timing from media content, according to voice data when Between stamp the deviation of the timestamp of voice data and the time of system clock is obtained with time of system clock, by deviation with it is pre- If time threshold is made comparisons, comparative result is obtained, is determined whether System Clock time being synchronized to audio number according to comparative result According to timestamp, if System Clock time to be synchronized to the timestamp of voice data, according to the time of system clock after synchronization Obtain video data corresponding with the time of system clock so that video playback module is corresponding from the time after system clock synchronization Video data start to continue to play media content, it is real if System Clock time not to be synchronized to the timestamp of voice data When corresponding with the time of system clock video data is obtained according to the time of system clock.
Therefore, no matter whether there occurs synchronization action, video playback with the timestamp of voice data the time of system clock The time that module is both referred to system clock carrys out playing video data, and so, deviation herein is less than preset time threshold In the case of value, that is, when the timestamp of system clock and voice data is almost consistent, video playback module have references to The time of system clock, and because the time of system clock is linearly incremented by, so in video playback module reference system clock Time obtain video data in the case of, it becomes possible to the timestamp and audio for keeping video playback module playing video data are broadcast Timestamp during amplification module playing audio-fequency data is consistent so that audio frequency and video reach synchronous, can reduce video when playing Caused video jitter, lift video playing quality;And in the case where deviation is more than or equal to preset time threshold, When the time of system clock is changed into the timestamp of voice data, when video playback module with reference to the time of system clock When, allow for the timestamp of video playback module playing video data and timestamp during audio playing module playing audio-fequency data It is consistent so that audio frequency and video reach synchronous, solve video playback module in the prior art and have references to audio playing module Stepped matter of time, which may occur, for timestamp during playing audio-fequency data causes the asynchronous caused video jitter of audio frequency and video Phenomenon, improve video playing quality.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of audio and video synchronization method schematic flow sheet provided in an embodiment of the present invention;
Fig. 2 is a kind of audio and video synchronization method schematic flow sheet provided in an embodiment of the present invention;
Fig. 3 is a kind of electronic equipment structural representation provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of audio and video synchronization method, as shown in figure 1, including:
101st, electronic equipment obtains the sound that the audio playing module of media content is played in media content playing process The timestamp of frequency evidence and the time of system clock, media content include voice data and video data, and system clock is from media Content commences play out moment timing.
Wherein, electronic equipment can be the user terminals such as intelligent television, mobile phone, computer.Media content is a video playback File, when electronic equipment plays the video file, it is by audio playing module and video playback module while plays out , wherein audio data block playing audio-fequency data, video playback module playing video data, user can be according to voice datas Listened to video data and watch the played file.
Specifically, timestamp during audio playing module playing audio-fequency data can directly obtain from some hardware platforms Take, system clock is the clock newly introduced in audio playing module, when being a reference in media content playing process Between, that is to say, that video playback module is the video counts corresponding with the time of system clock obtained according to the time of system clock According to, wherein, the time of the system clock linearly increases.
102nd, electronic equipment obtains the timestamp of voice data according to the timestamp of voice data and the time of system clock With the deviation of the time of system clock.
Specifically, electronic equipment is after the timestamp for having got voice data and the time of system clock, can be by sound The timestamp of frequency evidence subtracts the deviation of the timestamp of the time acquisition voice data of system clock and the time of system clock, Either the time of system clock is subtracted voice data timestamp deviation, then, take acquisition deviation it is absolute Value.
103rd, electronic equipment makes comparisons deviation with preset time threshold, obtains comparative result, true according to comparative result The fixed timestamp whether System Clock time is synchronized to voice data, then into step 104 or step 105.
Specifically, the time of timestamp and system clock when obtaining audio playing module playing audio-fequency data is inclined After difference, deviation can be made comparisons with preset time threshold, if deviation is less than preset time threshold, it is determined that compare knot Fruit is that media content is played normally, not by the timestamp for being time-synchronized to voice data of system clock;If deviation is more than Or equal to preset time threshold, it is determined that it is abnormal that comparative result is that media content plays, and by the time synchronized of system clock To the timestamp of voice data, that is, be updated to the timestamp of voice data the time of system clock.
It is to have video counts in electronic equipment it should be noted that when deviation and preset time threshold are compared According to needing what is made comparisons in the case of playing, to ensure when there is video data broadcasting so that audio frequency and video reach synchronous.Wherein, exist When video data commences play out, system clock can be initialized so that the time of system clock plays with now audio First timestamp of voice data keeps synchronous when module commences play out voice data, in order to video playback module reference system During the time playing video data of system clock, the timestamp when commencing play out just with voice data is consistent so that audio Reach synchronous;Certainly, if when video data commences play out, system clock is not initialized, and system clock Time is asynchronous with the timestamp of voice data, once deviation here is more than or equal to preset time threshold, so that will The timestamp for being time-synchronized to voice data of system clock, then it is abnormal can be not considered as that media content plays.Namely Say, thinking that media content plays abnormal occurred among the process of media content broadcasting, if make at the beginning By the timestamp for being time-synchronized to voice data of system clock, then it is abnormal to be not considered as that media content plays.
If the 104, System Clock time is synchronized to the timestamp of voice data by electronic equipment, according to after synchronization during system The time of clock obtains video data corresponding with the time of system clock so that video playback module is after system clock synchronization Video data corresponding to time starts to continue to play media content.
Specifically, if electronic equipment by the timestamp for being time-synchronized to voice data of system clock, is broadcast by video Amplification module obtain system clock synchronization after time, according to after system clock synchronization time obtain it is synchronous with system clock after Video data corresponding to time, the current video data that video playback module plays is updated to the time after system clock synchronization Corresponding video data, continue to broadcast since video data corresponding to the time after system clock synchronization by video playback module Put media content.
If the 105, System Clock time not to be synchronized to the timestamp of voice data, electronic equipment is in real time according to system The time of clock obtains video data corresponding with the time of system clock.
So, video playback module is that video data corresponding with system time, system are obtained according to system time Time is the smooth time sequencing linearly increased again, rather than the video counts directly obtained according to the timestamp of voice data According to.
For synthesis, no matter whether there occurs synchronization action, video with the timestamp of voice data the time of system clock The time that playing module is both referred to system clock carrys out playing video data, in this manner it is possible to reduce because audio plays mould Block can not obtain playback jitter caused by accurate reproduction time, lift video playing quality.
The embodiment of the present invention provides a kind of audio and video synchronization method, in media content playing process, obtains media content The timestamp of voice data that is played of audio playing module and the time of system clock, media content include voice data and Video data, system clock commence play out moment timing from media content, according to the timestamp of voice data and system clock Time obtains the deviation of the timestamp of voice data and the time of system clock, and deviation and preset time threshold are made into ratio Compared with, comparative result is obtained, is determined whether for System Clock time to be synchronized to the timestamp of voice data according to comparative result, if by System Clock time is synchronized to the timestamp of voice data, then is obtained and system clock according to the time of system clock after synchronization Video data corresponding to time so that video playback module since video data corresponding to the time after system clock synchronization after Media content is put in continued broadcasting, can reduce video in video jitter caused by broadcasting, lifting video playing quality.
The embodiment of the present invention provides a kind of audio and video synchronization method, as shown in Fig. 2 including:
201st, electronic equipment obtains the sound that the audio playing module of media content is played in media content playing process The timestamp of frequency evidence and the time of system clock.
Wherein, electronic equipment can be the user terminals such as intelligent television, mobile phone and computer.When being played in electronic equipment One media content, that is, during a played file, because the media content includes voice data and video data, voice data by Audio playing module is played out, and video data is played out by video playback module, user can with according to voice data and The media content is listened to and watched to video data.
Specifically, during media content plays, audio playing module can be obtained from some hardware platforms and broadcast Timestamp during voice data is put, system clock is the reference clock introduced in audio playing module, and mould is played in audio When root tuber obtains voice data according to the timestamp of the voice data of acquisition, video playback module can obtain system from system clock The time of system clock.Wherein, the time of system clock linearly increases, and can smoothly promote sequentially in time, video playback Module is to obtain video data corresponding with the time of system clock simultaneously according to the time of system clock in playing video data Continue what is played.
202nd, electronic equipment obtains the timestamp of voice data according to the timestamp of voice data and the time of system clock With the deviation of the time of system clock.
Specifically, after the timestamp for obtaining voice data and the time of system clock, voice data can be obtained The deviation of the time of timestamp and system clock, the specific deviation can be that the timestamp of currently playing voice data subtracts Go the difference of the time of system clock, or the time of system clock subtracts the difference of the timestamp of voice data.Wherein, The deviation of acquisition is the absolute value of difference.
203rd, electronic equipment by deviation compared with preset time threshold, then into step 204 or step 205.
It is to have video counts in electronic equipment it should be noted that when deviation and preset time threshold are compared According to needing what is made comparisons in the case of playing, to ensure when there is video data broadcasting so that audio frequency and video reach synchronous.
If the 204, deviation is less than preset time threshold, electronic equipment determines that comparative result plays just for media content Often, and not by the timestamp for being time-synchronized to voice data of system clock.
Specifically, after deviation is obtained, when due to video playback module being according to system in playing video data Time of clock obtains video data corresponding with the time of system clock, can be with if deviation is less than preset time threshold Think that the time of system clock and timestamp during audio playing module playing audio-fequency data differ very little, model of the error in permission Within enclosing, then the video data that video playback module is played just is almost audio number corresponding with the timestamp of voice data It can ignore according to video jitter caused by being synchronous, small audio frequency and video asynchrony phenomenon, user can normally watch this Media content, at this moment, avoid the need for just joining the timestamp for being time-synchronized to voice data of system clock, video playback module Time of lighting system clock obtains corresponding video data, with ensure time in system clock it is linear increase in the case of, Smooth playing video data.Wherein, preset time threshold can be 200ms, or other values, not limit here.
If the 205, deviation is more than or equal to preset time threshold, electronic equipment determines that comparative result is broadcast for media content Put it is abnormal, and by the timestamp for being time-synchronized to voice data of system clock.
Specifically, if deviation is more than or equal to preset time threshold, it is believed that the timestamp of voice data is with being The difference of the time of system clock is larger, and for example preset time threshold is 200ms, and deviation is more than or equal to 200ms, when video is broadcast When the time of amplification module reference system clock obtains video data, video playback module playing video data and audio will result in Data produce video jitter in synchronization, and it is abnormal that electronic equipment determines that comparative result plays for media content, at this moment, can incite somebody to action The timestamp for being time-synchronized to voice data of system clock, video playback module is so advantageous in reference system clock It is synchronous with the timestamp of voice data during time playing video data.
Wherein, when video data commences play out, system clock can be initialized so that the time of system clock It is synchronous with the timestamp holding for first voice data that now audio playing module commences play out, in order to video playback module During the time playing video data of reference system clock, the timestamp when commencing play out just with voice data is consistent, and is made Obtain audio and reach synchronous;Certainly, if when video data commences play out, system clock is not initialized, once this In deviation be more than or equal to preset time threshold, then can be not considered as media content play it is abnormal.That is, Thinking that media content plays abnormal is occurred among the process that is played in media content, if make at the beginning by system The timestamp for being time-synchronized to voice data of clock, then it is abnormal to be not considered as that media content plays.
If the 206, electronic equipment is by the timestamp for being time-synchronized to voice data of system clock, pass through video playback mould Block obtains the time after system clock synchronization.
Specifically, electronic equipment by system clock be time-synchronized to the timestamp of voice data after, video playback mould Block playing video data can be come with the time in reference system clock in real time during obtain system clock time with Timestamp after the timestamp synchronization of voice data.
207th, electronic equipment according to after system clock synchronization time obtain it is synchronous with system clock after time corresponding to Video data, by video playback module play current video data be updated to it is synchronous with system clock after time corresponding to regard Frequency evidence.
Specifically, after video playback module obtains the time after system clock synchronization, it is possible to same according to system clock Time after step obtain it is synchronous with system clock after time corresponding to video data, and the video data to being currently played It is updated.Being updated to video data here can be understood as two kinds of situations:One kind is that current video playing module is broadcast The timestamp for putting video data is later than the time after system clock synchronization, then can lose currently playing video data, directly Commenced play out from video data corresponding to the time after system clock synchronization, to keep audio-visual synchronization;Another kind is to work as forward sight The timestamp of frequency playing module playing video data, then can be synchronous according to system clock earlier than the time after system clock synchronization Time afterwards obtains video data corresponding with the time after system clock synchronization, and the video data being currently played is updated For video data corresponding to the time after synchronous with system clock.
For example, a certain media content plays and remains audio-visual synchronization, because audio playing module obtains Inaccurate voice data timestamp, audio playing module obtain the voice data under inaccurate timestamp, broadcast with video The video data of amplification module is asynchronous, and now, time of system clock is 1.6s, and the timestamp of voice data is 1.3s, video The timestamp of data is 1.5s, and the deviation of the time of system clock and the timestamp of voice data is 0.3s, preset time threshold It is worth for 200ms, it is known that deviation has been more than preset time threshold, it is necessary to which system clock is time-synchronized into voice data Timestamp, that is, the time of system clock is changed to 1.3s, what it is due to video playback module reference is system clock The video data that time obtains, so, video playback module finds system clock in the time of frame of reference clock Time is updated for 1.3s by 1.6s, just directly refers to video data corresponding to 1.3s this timestamp acquisitions 1.3s, so, just Voice data and video data can be kept synchronously to be played under identical timestamp.
208th, electronic equipment by video playback module since video data corresponding to the time after system clock synchronization Continue to play media content.
Specifically, when electronic equipment is in the case of audio, video data broadcasting is nonsynchronous, video playback module with reference to The time of system clock, because system clock is that linear increase smoothly promotes, can solve the timestamp when voice data In step type, caused video jitter shows during the timestamp playing video data of the direct reference audio data of video playback module As, so linearly increase in the time of system clock, and the timestamp of voice data and the time deviation of system clock occurs When larger so that when video playback module is referred to the system being time-synchronized to after the timestamp of voice data of system clock Clock playing video data, video can be reduced in video jitter caused by broadcasting, lifting video playing quality.
In summary, no matter whether there occurs synchronization action, video with the timestamp of voice data the time of system clock The time that playing module is both referred to system clock carrys out playing video data.
The embodiment of the present invention provides a kind of audio and video synchronization method, in media content playing process, obtains media content The timestamp of the voice data of the voice data played and the time of system clock, media content include voice data and video Data, system clock commence play out moment timing from media content, according to the time of the timestamp of voice data and system clock The deviation of the timestamp of voice data and the time of system clock are obtained, deviation is made comparisons with preset time threshold, obtained Comparative result is taken, is determined whether for System Clock time to be synchronized to the timestamp of voice data according to comparative result, if by system Synchronizing clock time then obtains the time with system clock to the timestamp of voice data according to the time of system clock after synchronization Corresponding video data so that video playback module continues to broadcast since video data corresponding to the time after system clock synchronization Media content is put, video can be reduced in video jitter caused by broadcasting, lifting video playing quality.
The embodiment of the present invention provides a kind of electronic equipment 01, as shown in figure 3, including:
Acquiring unit 011, in media content playing process, the audio playing module for obtaining media content to be played The timestamp of voice data and the time of system clock, media content include voice data and video data, system clock from Media content commences play out starts timing constantly.
Acquiring unit 011, it is additionally operable to obtain voice data according to the timestamp of voice data and the time of system clock The deviation of the time of timestamp and system clock.
Comparing unit 012, for deviation to be made comparisons with preset time threshold, comparative result is obtained, is tied according to comparing Fruit determines whether for System Clock time to be synchronized to the timestamp of voice data.
Processing unit 013, if the timestamp for System Clock time to be synchronized to voice data, according to being after synchronization The time of system clock obtains video data corresponding with the time of system clock so that video playback module is synchronous from system clock Video data corresponding to time afterwards starts to continue to play media content.
Processing unit 013, if being additionally operable to not be synchronized to System Clock time the timestamp of voice data, root in real time Video data corresponding with the time of system clock is obtained according to the time of system clock.
Optionally, comparing unit 012 can be specifically used for:
Deviation is made comparisons with preset time threshold;
If deviation is less than preset time threshold, it is determined that comparative result is that media content plays normally, and not by system The timestamp for being time-synchronized to voice data of clock;
If deviation is more than or equal to preset time threshold, it is determined that comparative result is that media content broadcasting is abnormal, and By the timestamp for being time-synchronized to voice data of system clock.
Wherein, comparing unit 012 is logical when for by the timestamp for being time-synchronized to institute's voice data of system clock Cross by the time of system clock be changed to voice data timestamp realize.
Optionally, processing unit 013 can be specifically used for:
If by the timestamp for being time-synchronized to voice data of system clock, when obtaining system by video playback module Time after clock synchronization;
According to video data corresponding to time of the time acquisition after system clock synchronization after synchronous with system clock, will regard Frequency playing module play current video data be updated to it is synchronous with system clock after time corresponding to video data;
Continue broadcasting media since video data corresponding to the time after system clock synchronization by video playback module Content.
Wherein, deviation for voice data timestamp and system clock time difference absolute value.
The time of system clock is linearly incremented by.
The embodiment of the present invention provides a kind of electronic equipment, in media content playing process, obtains the audio of media content The timestamp for the voice data that playing module is played and the time of system clock, media content include voice data and video counts According to system clock commences play out moment timing from media content, is obtained according to the time of the timestamp of voice data and system clock The timestamp for evidence of fetching and the deviation of the time of system clock, deviation are made comparisons with preset time threshold, acquisition is compared As a result, determined whether for System Clock time to be synchronized to the timestamp of voice data according to comparative result, if during by system clock Between be synchronized to the timestamp of voice data, then obtained according to the time of system clock after synchronization corresponding with the time of system clock Video data so that video playback module continues to play media since video data corresponding to the time after system clock synchronization Content, video can be reduced in video jitter caused by broadcasting, lifting video playing quality.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, it can be passed through Its mode is realized.For example, apparatus embodiments described above are only schematical, for example, the division of the unit, only Only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple units or component can be tied Another system is closed or is desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or discussed Mutual coupling or direct-coupling or communication connection can be the INDIRECT COUPLINGs or logical by some interfaces, device or unit Letter connection, can be electrical, mechanical or other forms.
In addition, in equipment and system in each embodiment of the present invention, each functional unit can be integrated in a processing In unit or the independent physics of unit includes, can also two or more units it is integrated in a unit. And above-mentioned each unit can both be realized in the form of hardware, hardware can also be used to add the form of SFU software functional unit real It is existing.
Realizing all or part of step of above method embodiment can be completed by the related hardware of programmed instruction, preceding The program stated can be stored in a computer read/write memory medium, and upon execution, execution includes above method reality to the program The step of applying;And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage(Read Only Memory, referred to as ROM), random access memory(Random Access Memory, abbreviation RAM), magnetic disc or CD etc. are various to store The medium of program code.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (8)

  1. A kind of 1. audio and video synchronization method, it is characterised in that including:
    Obtain the timestamp of voice data and the time of system clock that the audio playing module of media content is played, the matchmaker Holding in vivo includes voice data and video data, system clock timing since commencing play out constantly the media content;
    Timestamp and the institute of the voice data are obtained according to the time of the timestamp of the voice data and the system clock State the deviation of the time of system clock;
    The deviation is made comparisons with preset time threshold, obtain comparative result, according to the comparative result determine whether by The timestamp for being time-synchronized to the voice data of the system clock;
    If the deviation is more than or equal to the preset time threshold, the System Clock time is synchronized to the audio The timestamp of data, video counts corresponding with the time of the system clock are obtained according to the time of the system clock after synchronization According to so that video playback module continues to play the matchmaker since video data corresponding to the time after the system clock synchronization Hold in vivo;
    If the deviation is less than the preset time threshold, the System Clock time voice data is not synchronized to Timestamp, corresponding with the time of system clock video data is obtained according to the time of the system clock in real time.
  2. 2. according to the method for claim 1, it is characterised in that described that the deviation and preset time threshold are made into ratio Compared with comparative result being obtained, according to the comparative result by the time for being time-synchronized to the voice data of the system clock Stamp includes:
    The deviation is made comparisons with the preset time threshold;
    If the deviation is less than the preset time threshold, it is determined that the comparative result is that the media content plays just Often, and not by the timestamp for being time-synchronized to the voice data of the system clock;
    If the deviation is more than or equal to the preset time threshold, it is determined that the comparative result is that the media content is broadcast Put it is abnormal, and by the timestamp for being time-synchronized to the voice data of the system clock;
    Wherein, it is described to be by the timestamp for being time-synchronized to the voice data of the system clock:By the system clock Time be changed to the timestamp of the voice data.
  3. 3. according to the method for claim 2, it is characterised in that described described to the System Clock time is synchronized to The timestamp of voice data, then obtained according to the time of the system clock after synchronization corresponding with the time of the system clock Video data so that video playback module continues to play since video data corresponding to the time after the system clock synchronization The media content includes:
    If by the timestamp for being time-synchronized to the voice data of the system clock, obtained by the video playback module Take the time after the system clock synchronization;
    According to after the system clock synchronization time obtain it is synchronous with the system clock after time corresponding to video data, By the current video data that the video playback module plays be updated to it is synchronous with the system clock after time corresponding to regard Frequency evidence;
    Continue to play since video data corresponding to the time after the system clock synchronization by the video playback module The media content.
  4. 4. according to the method for claim 3, it is characterised in that timestamp and institute of the deviation for the voice data State the absolute value of the difference of the time of system clock.
  5. 5. a kind of electronic equipment, it is characterised in that including:
    Acquiring unit, what the audio playing module in media content playing process, obtaining the media content was played The timestamp of voice data and the time of system clock, the media content include voice data and video data, the system Clock timing since commencing play out constantly the media content;
    The acquiring unit, it is additionally operable to obtain the sound according to the timestamp of the voice data and the time of the system clock The timestamp of frequency evidence and the deviation of the time of the system clock;
    Comparing unit, for the deviation to be made comparisons with preset time threshold, comparative result is obtained, relatively tied according to described Fruit determines whether for the System Clock time to be synchronized to the timestamp of the voice data;
    Processing unit, if being more than or equal to the preset time threshold for the deviation, by the system clock when Between be synchronized to the timestamp of the voice data, obtained and the system clock according to the time of the system clock after synchronization Video data corresponding to time so that video data corresponding to video playback module from the time after the system clock synchronization is opened Beginning continues to play the media content;
    The processing unit, if being additionally operable to the deviation is less than the preset time threshold, not by the system clock when Between be synchronized to the timestamp of the voice data, obtained and the system clock according to the time of the system clock in real time Video data corresponding to time.
  6. 6. electronic equipment according to claim 5, it is characterised in that the comparing unit is specifically used for:
    The deviation is made comparisons with the preset time threshold;
    If the deviation is less than the preset time threshold, it is determined that the comparative result is that the media content plays just Often, and not by the timestamp for being time-synchronized to the voice data of the system clock;
    If the deviation is more than or equal to the preset time threshold, it is determined that the comparative result is that the media content is broadcast Put it is abnormal, and by the timestamp for being time-synchronized to the voice data of the system clock;
    Wherein, the comparing unit is when for by the timestamp for being time-synchronized to the voice data of the system clock, It is what is realized by the way that the time of the system clock to be changed to the timestamp of the voice data.
  7. 7. electronic equipment according to claim 6, it is characterised in that the processing unit is specifically used for:
    If by the timestamp for being time-synchronized to the voice data of the system clock, obtained by the video playback module Take the time after the system clock synchronization;
    According to after the system clock synchronization time obtain it is synchronous with the system clock after time corresponding to video data, By the current video data that the video playback module plays be updated to it is synchronous with the system clock after time corresponding to regard Frequency evidence;
    Continue to play since video data corresponding to the time after the system clock synchronization by the video playback module The media content.
  8. 8. electronic equipment according to claim 7, it is characterised in that the deviation is the timestamp of the voice data With the absolute value of the difference of the time of the system clock.
CN201310733364.6A 2013-12-23 2013-12-23 A kind of audio and video synchronization method and electronic equipment Active CN103747316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310733364.6A CN103747316B (en) 2013-12-23 2013-12-23 A kind of audio and video synchronization method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310733364.6A CN103747316B (en) 2013-12-23 2013-12-23 A kind of audio and video synchronization method and electronic equipment

Publications (2)

Publication Number Publication Date
CN103747316A CN103747316A (en) 2014-04-23
CN103747316B true CN103747316B (en) 2018-04-06

Family

ID=50504298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310733364.6A Active CN103747316B (en) 2013-12-23 2013-12-23 A kind of audio and video synchronization method and electronic equipment

Country Status (1)

Country Link
CN (1) CN103747316B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957344B (en) * 2014-04-28 2017-05-24 广州杰赛科技股份有限公司 Video synchronization method and system for multiple camera devices
CN106658065B (en) * 2015-10-30 2021-10-22 中兴通讯股份有限公司 Audio and video synchronization method, device and system
CN105898500A (en) * 2015-12-22 2016-08-24 乐视云计算有限公司 Network video play method and device
CN105847926A (en) * 2016-03-31 2016-08-10 乐视控股(北京)有限公司 Multimedia data synchronous playing method and device
CN105872699A (en) * 2016-04-28 2016-08-17 乐视控股(北京)有限公司 Video playing control method and device
CN106454420B (en) * 2016-10-08 2019-10-25 Oppo广东移动通信有限公司 A kind of clock synchronizing method and device
CN106385598A (en) * 2016-10-08 2017-02-08 广东欧珀移动通信有限公司 Clock adjusting method and device, terminal and multimedia synchronous playing system
CN106375824B (en) * 2016-10-08 2018-05-18 广东欧珀移动通信有限公司 A kind of clock adjustment, device, terminal and multimedia synchronous play system
CN106875952B (en) * 2016-12-23 2021-02-26 伟乐视讯科技股份有限公司 Multi-channel audio soft coding mechanism based on FPGA embedded system
CN108632557B (en) * 2017-03-20 2021-06-08 中兴通讯股份有限公司 Audio and video synchronization method and terminal
CN107155126A (en) * 2017-03-30 2017-09-12 北京奇艺世纪科技有限公司 A kind of audio and video playing method and device
CN110636359B (en) * 2018-06-21 2021-11-23 杭州海康威视数字技术股份有限公司 Method and device for synchronously playing audio and video
CN110971783B (en) * 2019-11-29 2022-08-02 深圳创维-Rgb电子有限公司 Television sound and picture synchronous self-tuning method, device and storage medium
CN112671718B (en) * 2020-12-03 2023-07-21 网宿科技股份有限公司 Switching method of return source link, server and storage medium
CN114630170B (en) * 2022-03-24 2023-10-31 抖音视界有限公司 Audio and video synchronization method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1996010889A1 (en) * 1994-09-30 1996-04-11 Cirrus Logic, Inc. Programmable audio-video synchronization method and apparatus for multimedia systems
CN1816156A (en) * 2005-02-02 2006-08-09 乐金电子(惠州)有限公司 Synchronous broadcasting method of multi-media data
CN101188770A (en) * 2007-12-17 2008-05-28 上海广电(集团)有限公司中央研究院 An audio and video synchronization output method for multi-process control
CN101271720A (en) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 Synchronization process for mobile phone stream media audio and video
CN101340591A (en) * 2008-08-11 2009-01-07 深圳华为通信技术有限公司 Processing method and apparatus for receiving audio data in decoding system
CN102421035A (en) * 2011-12-31 2012-04-18 青岛海信宽带多媒体技术有限公司 Method and device for synchronizing audio and video of digital television
CN103179449A (en) * 2011-12-23 2013-06-26 联想(北京)有限公司 Media file playing method, electronic device and virtual machine framework

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7480315B2 (en) * 2004-12-31 2009-01-20 Microsoft Corporation Method and apparatus for synchronizing clocks

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1996010889A1 (en) * 1994-09-30 1996-04-11 Cirrus Logic, Inc. Programmable audio-video synchronization method and apparatus for multimedia systems
CN1816156A (en) * 2005-02-02 2006-08-09 乐金电子(惠州)有限公司 Synchronous broadcasting method of multi-media data
CN101188770A (en) * 2007-12-17 2008-05-28 上海广电(集团)有限公司中央研究院 An audio and video synchronization output method for multi-process control
CN101271720A (en) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 Synchronization process for mobile phone stream media audio and video
CN101340591A (en) * 2008-08-11 2009-01-07 深圳华为通信技术有限公司 Processing method and apparatus for receiving audio data in decoding system
CN103179449A (en) * 2011-12-23 2013-06-26 联想(北京)有限公司 Media file playing method, electronic device and virtual machine framework
CN102421035A (en) * 2011-12-31 2012-04-18 青岛海信宽带多媒体技术有限公司 Method and device for synchronizing audio and video of digital television

Also Published As

Publication number Publication date
CN103747316A (en) 2014-04-23

Similar Documents

Publication Publication Date Title
CN103747316B (en) A kind of audio and video synchronization method and electronic equipment
CN108259989B (en) Video live broadcast method, computer readable storage medium and terminal equipment
EP2302928B1 (en) Method for play synchronization and device using the same
CN106658133B (en) Audio and video synchronous playing method and terminal
CN102215429B (en) Recording method for mobile TV
CN101207764B (en) Recording device, recording method and reproducing device
CN103856812B (en) A kind of video broadcasting method and device
CN105681715A (en) Audio and video processing method and apparatus
CN103747332B (en) A kind of smoothing processing method and device of video
CN104822008A (en) Video synchronizing method and device
CN102075803B (en) Method for synchronously playing video and audio
CN109828742B (en) Audio multi-channel synchronous output method, computer device and computer readable storage medium
CN101419827A (en) Method for synchronzing audio and video data in avi file
KR20070096920A (en) Apparatus and method for determining rendering duration of video frame
CN112261461B (en) Bluetooth sound and picture synchronization method and device, display equipment and readable storage medium
CN109167890A (en) A kind of sound draws synchronous method and device and display equipment
CN110166723A (en) It is a kind of to record the audio and video synchronization method in shielding, electronic equipment, storage medium
EP3145210A1 (en) Reception apparatus, transmission apparatus, and data processing method
CN101656860B (en) Recording apparatus and recording method
CN108289232B (en) Control method of playing device, terminal device and storage medium
CN103581730A (en) Method for achieving synchronization of audio and video on digital set top box
CN101290790A (en) Synchronous playing method and device for both audio and video
CN107864393A (en) The method and device that video is shown with captioning synchronization
US20190222886A1 (en) Method and apparatus for synchronously playing media and vibration
CN108156498B (en) Audio and video synchronization method and device

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
CP03 Change of name, title or address

Address after: Room 301-1, Room 301-3, Area B2, Animation Building, No. 126 Animation Road, Zhongxin Eco-city, Tianjin Binhai New Area, Tianjin

Patentee after: LE SHI ZHI XIN ELECTRONIC TECHNOLOGY (TIANJIN) Ltd.

Address before: 300453 Tianjin Binhai New Area, Tianjin Eco-city, No. 126 Animation and Animation Center Road, Area B1, Second Floor 201-427

Patentee before: Xinle Visual Intelligent Electronic Technology (Tianjin) Co.,Ltd.

Address after: 300453 Tianjin Binhai New Area, Tianjin Eco-city, No. 126 Animation and Animation Center Road, Area B1, Second Floor 201-427

Patentee after: Xinle Visual Intelligent Electronic Technology (Tianjin) Co.,Ltd.

Address before: 300467 Tianjin Binhai New Area, Tianjin ecological city animation Middle Road, building, No. two, B1 District, 201-427

Patentee before: LE SHI ZHI XIN ELECTRONIC TECHNOLOGY (TIANJIN) Ltd.

CP03 Change of name, title or address
PP01 Preservation of patent right

Effective date of registration: 20210201

Granted publication date: 20180406

PP01 Preservation of patent right