CN105846940A - Timestamp fault-tolerant control method and device - Google Patents

Timestamp fault-tolerant control method and device Download PDF

Info

Publication number
CN105846940A
CN105846940A CN201610195424.7A CN201610195424A CN105846940A CN 105846940 A CN105846940 A CN 105846940A CN 201610195424 A CN201610195424 A CN 201610195424A CN 105846940 A CN105846940 A CN 105846940A
Authority
CN
China
Prior art keywords
frame
video
timestamp
meansigma methods
time tolerance
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.)
Pending
Application number
CN201610195424.7A
Other languages
Chinese (zh)
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.)
LeTV Holding Beijing Co Ltd
LeTV Cloud Computing Co Ltd
Original Assignee
LeTV Holding Beijing Co Ltd
LeTV Cloud Computing 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 LeTV Holding Beijing Co Ltd, LeTV Cloud Computing Co Ltd filed Critical LeTV Holding Beijing Co Ltd
Priority to CN201610195424.7A priority Critical patent/CN105846940A/en
Publication of CN105846940A publication Critical patent/CN105846940A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a timestamp fault-tolerant control method and a device. The method comprises the steps of sequentially acquiring the timestamps of video frames during the audio and video decoding process; calculating a first timestamp difference between a current video frame and a previous video frame; judging whether the first timestamp difference is larger than a predetermined offset threshold or not; on the condition that the first timestamp difference is larger than the predetermined offset threshold, calculating a timestamp offset according to a second timestamp difference between at least two video frames before the current video frame; and replacing the timestamp of the current video frame with the sum of the timestamp of the previous video frame and the above timestamp offset. According to the technical scheme of the timestamp fault-tolerant control method and the device, wrong timestamps during the transcoding process can be corrected. Therefore, finally outputted audios and videos are ensured to be synchronized.

Description

Timestamp fault tolerant control method and device
Technical field
The present invention relates to technical field of data processing, particularly relate to a kind of timestamp fault tolerant control method and device.
Background technology
In existing audio/video decoding technology, use Presentation Time Stamp PTS (presentation time stamp) Represent audio/video frames position on output time axle.It is right to determine whether the most successively Answering audio frame or the frame of video of PTS, if had, playing this frame of video or audio frame.
Real-time transcoding system, is a kind of instant system that audio-video document carries out transcoding, and it can be divided into three Part: 1) decide whether to process this data according to the PTS in current data packet;2) according to input data It is decoded, and input PTS is passed to coding module for audio-visual synchronization;3) coding module according to Decoding data and PTS encode and encapsulate, and export packet.
Decoding process of the prior art is exemplified below:
It is assumed that the PTS of a string frame of video got is: 0,1,2,4;And a string audio frame got PTS is: 1,2,3,4;
Then being positioned at the position of time shaft 0, without respective audio frame, the most only playing PTS is the frame of video of 0; The most each PTS all has frame of video and the audio frame of correspondence, is corresponding in turn to play.
When after the frame of video that frame of video decoding PTS is 2, owing to can not find the frame of video that PTS is 3, because of This continues, by the frame of video decoding output that PTS is 2, to recover normal when decoding the frame of video that PTS is 4. This mode avoids the problem that the problems such as factor data disappearance cause audio frequency and video to misplace.
But, above-mentioned decoding process cannot effectively process following scene:
The first scene: it is assumed that the PTS of a string frame of video got is: 0,1,1000,1001,4; And the PTS of a string audio frame got is: 0,1,2,3,4;Judge herein PTS as 1 frame of video The PTS of next frame of video be 1000, then according to prior art, can repeat to export PTS is the video of 1 Frame, until the PTS of frame of video increases to 1000, continuing to play PTS above is the frame of video of 1000. So, then for video stops, audio frequency continues to play the display effect at user, it is impossible to normally watch.
The second scene: it is assumed that the PTS of a string frame of video got is: 1022,1023,30,31,32; Can not find the frame of video that next frame PTS is 1024, so regarding due to the frame of video that PTS is 1023 herein Frequency card cannot continue to play.
Summary of the invention
In view of this, it is an object of the invention to propose a kind of timestamp fault tolerant control method and device, it is possible to Correct the error timestamp in transcoding process, to ensure last output audio-visual synchronization.
The timestamp fault tolerant control method provided based on the above-mentioned purpose present invention, including:
In audio/video decoding course, obtain the timestamp of frame of video successively;
Calculate the very first time stamp difference between current video frame and former frame frame of video;
Judge that whether stamp difference of the described very first time is more than default bias amount threshold value;
If stamp difference is more than default bias amount threshold value the described very first time, according to before current video frame at least The second time tolerance between two frame frame of video, is calculated timestamp side-play amount;
The timestamp of current video frame is replaced with the timestamp of described former frame frame of video plus the described time Stamp side-play amount.
In some embodiments, described according between at least two frame frame of video before current video frame Two time tolerances, the step being calculated timestamp side-play amount includes:
Select two frame frame of video before current video frame;
Calculate the second time tolerance between described two frame frame of video;
Using described second time tolerance as described timestamp side-play amount.
In some embodiments, the step of the second time tolerance between the described two frame frame of video of described calculating Also include after rapid:
Judge that described second time tolerance is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
If described second time tolerance plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;
By at least one frame before described two frame frame of video together with described two frame frame of video, calculate adjacent video Frame time tolerance between any two, obtains multiple second time tolerance;
It is calculated the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
In some embodiments, the step of the meansigma methods of the plurality of second time tolerance it is calculated described in Also include after rapid:
Judge whether described meansigma methods is more than or equal to plus the result of the timestamp of described former frame frame of video The timestamp of next frame of video;
If described meansigma methods is less than next frame of video plus the result of the timestamp of described former frame frame of video Timestamp, using described meansigma methods as described timestamp side-play amount;
If described meansigma methods regards more than or equal to next plus the result of the timestamp of described former frame frame of video Frequently the timestamp of frame, then continue to be chosen at least one frame before at least one frame before described two frame frame of video;
Repeat the above steps, lays equal stress on and is newly calculated meansigma methods, until described meansigma methods is plus described former frame The result of the timestamp of frame of video is less than the timestamp of next frame of video.
In some embodiments, described according between at least two frame frame of video before current video frame Two time tolerances, the step being calculated timestamp side-play amount includes:
Select the multi-frame video frame before current video frame;
Calculate adjacent video frames time tolerance between any two in described multi-frame video frame, obtain multiple second Time tolerance;
Calculate the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
Another aspect of the present invention additionally provides a kind of timestamp fault tolerant control, including:
Timestamp acquisition module, in audio/video decoding course, obtains the timestamp of frame of video successively;
Difference calculating module, poor for calculating the very first time stamp between current video frame and former frame frame of video Value;
Difference judge module, is used for judging that whether stamp difference of the described very first time is more than default bias amount threshold value;
Side-play amount computing module, if stamp difference was more than default bias amount threshold value, for basis the described very first time The second time tolerance between at least two frame frame of video before current video frame, is calculated timestamp inclined Shifting amount;
Timestamp replacement module, for replacing with described former frame frame of video by the timestamp of current video frame Timestamp adds described timestamp side-play amount.
In some embodiments, described side-play amount computing module, specifically for:
Select two frame frame of video before current video frame;
Calculate the second time tolerance between described two frame frame of video;
Using described second time tolerance as described timestamp side-play amount.
In some embodiments, described side-play amount computing module, also particularly useful for:
Judge that described second time tolerance is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
If described second time tolerance plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;
By at least one frame before described two frame frame of video together with described two frame frame of video, calculate adjacent video Frame time tolerance between any two, obtains multiple second time tolerance;
It is calculated the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
In some embodiments, described side-play amount computing module, also particularly useful for:
Judge whether described meansigma methods is more than or equal to plus the result of the timestamp of described former frame frame of video The timestamp of next frame of video;
If described meansigma methods is less than next frame of video plus the result of the timestamp of described former frame frame of video Timestamp, using described meansigma methods as described timestamp side-play amount;
If described meansigma methods regards more than or equal to next plus the result of the timestamp of described former frame frame of video Frequently the timestamp of frame, then continue to be chosen at least one frame before at least one frame before described two frame frame of video;
Repeat the above steps, lays equal stress on and is newly calculated meansigma methods, until described meansigma methods is plus described former frame The result of the timestamp of frame of video is less than the timestamp of next frame of video.
In some embodiments, described side-play amount computing module, specifically for:
Select the multi-frame video frame before current video frame;
Calculate adjacent video frames time tolerance between any two in described multi-frame video frame, obtain multiple second Time tolerance;
Calculate the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
From the above it can be seen that the present invention provide timestamp fault tolerant control method and device, according to When timestamp carries out audio/video decoding, by judging the very first time of current video frame and its former frame frame of video Whether stamp difference is beyond default bias amount threshold value, when beyond default bias amount threshold value, according to current video It is inclined that the second time tolerance between the timestamp of frame basis at least two frame frame of video before obtains timestamp By the timestamp of current video frame, shifting amount, adds that the value of timestamp side-play amount replaces the time of abnormal frame of video Stamp, to ensure that audio-video document can be play smoothly so that will not produce obvious video in visual effect Stuck situation, thus improve Consumer's Experience.
Accompanying drawing explanation
The schematic flow sheet of one embodiment of the timestamp fault tolerant control method that Fig. 1 provides for the present invention;
The schematic flow sheet of another embodiment of the timestamp fault tolerant control method that Fig. 2 provides for the present invention;
The modular structure schematic diagram of the timestamp fault tolerant control embodiment that Fig. 3 provides for the present invention.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment, And referring to the drawings, the present invention is described in more detail.
It should be noted that the statement of all uses " first " and " second " is all in the embodiment of the present invention The parameter of entity or non-equal in order to distinguish two same names non-equal, it is seen that " first " " second " Only for the convenience of statement, should not be construed as the restriction to the embodiment of the present invention, subsequent embodiment is to this no longer Illustrate one by one.
The first aspect of the invention, it is proposed that a kind of timestamp fault tolerant control method, it is possible to correct transcoding mistake Error timestamp in journey, to ensure last output audio-visual synchronization.As it is shown in figure 1, carry for the present invention The schematic flow sheet of one embodiment of the timestamp fault tolerant control method of confession.
Described timestamp fault tolerant control method, comprises the following steps:
Step 101: in audio/video decoding course, obtains the timestamp (PTS) of frame of video successively;
Step 102: calculate the very first time stamp difference between current video frame and former frame frame of video;Described Very first time stamp difference, is the timestamp institute by the timestamp of current video frame deducts former frame frame of video The difference obtained;
Step 103: judge that whether stamp difference of the described very first time is more than default bias amount threshold value;Described default Side-play amount threshold value can be the value of default setting, it is also possible to be the value of User Defined setting;Described default inclined Shifting amount threshold value to arrange considered factor main it may be that when stamp difference of the described very first time is more than presetting partially During shifting amount threshold value, in the audio frequency and video that transcoding completes, it may appear that the video of the long period being easily observed Stuck situation, therefore, described default bias amount threshold value refers under normal circumstances between continuous print timestamp Normal time interval is set;
Step 104: if stamp difference was more than default bias amount threshold value, according to current video frame the described very first time The second time tolerance between at least two frame frame of video before, is calculated timestamp side-play amount;Described Second time tolerance can be by the timestamp of two frame frame of video before current video frame is subtracted each other and Obtain, it is also possible to be according to current video frame before the timestamp of multi-frame video frame subtract each other two-by-two and obtain Multiple values, described timestamp side-play amount can be equal to described second time tolerance, it is also possible to is based on many Individual described second time tolerance and the meansigma methods that obtains, or obtain based on described second time tolerance The value close with described second time tolerance arrived;
Step 105: the timestamp that the timestamp of current video frame replaces with described former frame frame of video adds Described timestamp side-play amount, thus the timestamp with the frame of video of error timestamp is revised as and former frame The timestamp that the timestamp of frame of video is close.
From above-described embodiment it can be seen that the present invention provide timestamp fault tolerant control method, according to the time When stamp carries out audio/video decoding, poor with the very first time of its former frame frame of video stamp by judging current video frame Whether value is beyond default bias amount threshold value, when beyond default bias amount threshold value, according to current video frame Timestamp also obtains timestamp side-play amount according to the second time tolerance between at least two frame frame of video before, The timestamp of current video frame is added that the value of timestamp side-play amount replaces the timestamp of abnormal frame of video, with Ensure that audio-video document can be play smoothly so that the stuck feelings of obvious video will not be produced in visual effect Condition, thus improve Consumer's Experience.
It is also preferred that the left in some embodiments, described according at least two frame frame of video before current video frame Between the second time tolerance, the step 104 being calculated timestamp side-play amount also may particularly include following Step:
Select two frame frame of video before current video frame;Such as, the timestamp of described two frame frame of video is permissible It is 0,1, and the timestamp of current video frame can be 1000;
Calculate the second time tolerance between described two frame frame of video;Time according to described two frame frame of video Stamp 0,1, can be calculated the second time tolerance is 1;
It is 1 using described second time tolerance as described timestamp side-play amount, the most described timestamp side-play amount; Now, the timestamp of described former frame frame of video plus described timestamp side-play amount then equal to 2, thus currently The timestamp of frame of video is replaced by 2.
By above-described embodiment, under normal conditions, by by the front cross frame frame of video of current video frame time Between stamp subtract each other and the second time tolerance of obtaining as timestamp side-play amount, can solve in most cases Timestamp abnormal conditions, additionally can save calculation procedure, thus reduce resource consumption, lifting process speed Degree.
At some in particular cases, the timestamp side-play amount subtracted each other only with front cross frame frame of video and obtain has Or may can cause exception.Such as, when the timestamp of one section of continuous print frame of video is 0,1,2,6,1000,9, Now, subtracting each other, just with the timestamp 2,6 of front cross frame, the timestamp side-play amount obtained is 4, now, when The new timestamp of front frame of video is 6+4=10, or bigger than the timestamp 9 of next frame frame of video, equally There will be exception.
Therefore, further, in some optional embodiments, between the described two frame frame of video of described calculating The second time tolerance step after also can further include steps of
Judge that described second time tolerance is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
If described second time tolerance plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;Here, according to Needs can be that the frame before selecting described two frame frame of video is the most, ensures result relatively at needs In the case of excellent, can stab with the video of a few frame of more options;
By at least one frame before described two frame frame of video together with described two frame frame of video, calculate adjacent video Frame time tolerance between any two, obtains multiple second time tolerance;
It is calculated the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount;Such as, before selecting described two frame frame of video A frame in the case of, described meansigma methods be equal to [(2-1)+(6-2)]/2=2.5, at this moment, described former frame video The timestamp of frame is then equal to 8.5 plus described meansigma methods, thus the timestamp of current video frame is replaced by 8.5, It is less than the timestamp 9 of next frame frame of video, thus solves above-mentioned problem.
By above-described embodiment, preferably resolve the timestamp in some frame of video in particular cases abnormal Problem.
In some cases, only above-described embodiment is used once, it may not be possible to be fully solved above-mentioned abnormal conditions, Therefore, further, in some optional embodiments, described in be calculated the plurality of second time Also can further include steps of after the step of the meansigma methods of stamp difference
Judge whether described meansigma methods is more than or equal to plus the result of the timestamp of described former frame frame of video The timestamp of next frame of video;
If described meansigma methods is less than next frame of video plus the result of the timestamp of described former frame frame of video Timestamp, using described meansigma methods as described timestamp side-play amount;
If described meansigma methods regards more than or equal to next plus the result of the timestamp of described former frame frame of video Frequently the timestamp of frame, then continue to be chosen at least one frame before at least one frame before described two frame frame of video;
Repeat the above steps, lays equal stress on and is newly calculated meansigma methods, until described meansigma methods is plus described former frame The result of the timestamp of frame of video is less than the timestamp of next frame of video.
It can be seen that by above-described embodiment, preferably solve in some frame of video in particular cases Timestamp abnormal problem.
Optionally, in some other embodiment, described regard according at least two frames before current video frame Frequently the second time tolerance between frame, the step 104 being calculated timestamp side-play amount also may particularly include Following steps:
Select the multi-frame video frame before current video frame;
Calculate adjacent video frames time tolerance between any two in described multi-frame video frame, obtain multiple second Time tolerance;
Calculate the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
Can find out from above-described embodiment, calculate by directly choosing the multi-frame video frame before current video frame Time tolerance so that avoiding the most as far as possible, some abnormal conditions occur, thus solve well There is abnormal problem in timestamp.
Present invention also offers another embodiment of described timestamp fault tolerant control method.As in figure 2 it is shown, The schematic flow sheet of another embodiment for the timestamp fault tolerant control method that the present invention provides.
Described timestamp fault tolerant control method, comprises the following steps:
Step 201: in audio/video decoding course, obtains the timestamp of frame of video successively;
Step 202: calculate the very first time stamp difference between current video frame and former frame frame of video;
Step 203: judge that whether stamp difference of the described very first time is more than default bias amount threshold value;
Step 204: if the described very first time, stamp difference was more than default bias amount threshold value, select current video frame Two frame frame of video before;
Step 205: calculate the second time tolerance between described two frame frame of video;
Step 206: judge described second time tolerance knot plus the timestamp of described former frame frame of video Whether fruit is more than or equal to the timestamp of next frame of video;
Step 207: if described second time tolerance is plus the result of the timestamp of described former frame frame of video Less than the timestamp of next frame of video, then the timestamp of current video frame is replaced with described former frame frame of video Timestamp plus described second time tolerance;
Step 208: if described second time tolerance is plus the result of the timestamp of described former frame frame of video More than or equal to the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;
Step 209: by least one frame before described two frame frame of video together with described two frame frame of video, meter Calculate adjacent video frames time tolerance between any two, obtain multiple second time tolerance;
Step 210: be calculated the meansigma methods of the plurality of second time tolerance;
Step 211: judge that described meansigma methods is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
Step 212: if described meansigma methods adds that the result of the timestamp of described former frame frame of video is less than next The timestamp of frame of video, using described meansigma methods as described timestamp side-play amount;
Step 213: if described meansigma methods plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then before continuing to be chosen at least one frame before described two frame frame of video At least one frame, repeat the above steps, lay equal stress on and be newly calculated meansigma methods, until described meansigma methods is plus described The result of the timestamp of former frame frame of video is less than the timestamp of next frame of video;
Step 214: the timestamp that the timestamp of current video frame replaces with described former frame frame of video adds Described timestamp side-play amount.
From above-described embodiment it can be seen that the present invention provide described timestamp fault tolerant control method, by When carrying out audio/video decoding according to timestamp, by judging the first of current video frame and its former frame frame of video Whether time tolerance is beyond default bias amount threshold value, when beyond default bias amount threshold value, according to currently The timestamp of frame of video also obtains the time according to the second time tolerance between at least two frame frame of video before Stamp side-play amount, adds that by the timestamp of current video frame the value of timestamp side-play amount replaces abnormal frame of video Timestamp, to ensure that audio-video document can be play smoothly so that will not produce in visual effect significantly The stuck situation of video, thus improve Consumer's Experience.
The second aspect of the invention, it is proposed that a kind of timestamp fault tolerant control, it is possible to correct transcoding mistake Error timestamp in journey, to ensure last output audio-visual synchronization.As it is shown on figure 3, carry for the present invention The modular structure schematic diagram of the timestamp fault tolerant control embodiment of confession.
Described timestamp fault tolerant control, including:
Timestamp acquisition module 301, in audio/video decoding course, obtains the time of frame of video successively Stamp;
Difference calculating module 302, for calculating the very first time between current video frame and former frame frame of video Stamp difference;Stamp difference of the described very first time, is by the timestamp of current video frame is deducted former frame video The difference of the timestamp gained of frame;
Difference judge module 303, is used for judging that whether stamp difference of the described very first time is more than default bias amount threshold Value;Described default bias amount threshold value can be the value of default setting, it is also possible to be the value of User Defined setting; Described default bias amount threshold value to arrange considered factor main it may be that when the described very first time stabs difference During more than default bias amount threshold value, in the audio frequency and video that transcoding completes, it may appear that be easily observed is longer The video card death situation condition of time, therefore, described default bias amount threshold value refer under normal circumstances continuous print time Between stamp between normal time interval be set;
Side-play amount computing module 304, if the described very first time, stamp difference was more than default bias amount threshold value, is used for According to the second time tolerance between at least two frame frame of video before current video frame, it is calculated the time Stamp side-play amount;Described second time tolerance can be by by two frame frame of video before current video frame Timestamp subtracts each other and obtains, it is also possible to be according to current video frame before multi-frame video frame timestamp two-by-two The multiple values subtracted each other and obtain, described timestamp side-play amount can be equal to described second time tolerance, also Can be the meansigma methods obtained based on multiple described second time tolerances, or during based on described second Between stab difference and the value close with described second time tolerance that obtain;
Timestamp replacement module 305, for replacing with described former frame video by the timestamp of current video frame The timestamp of frame adds described timestamp side-play amount, thus will have the timestamp of the frame of video of error timestamp It is revised as the timestamp close with the timestamp of former frame frame of video.
From above-described embodiment it can be seen that the present invention provide described timestamp fault tolerant control, by When carrying out audio/video decoding according to timestamp, by judging the first of current video frame and its former frame frame of video Whether time tolerance is beyond default bias amount threshold value, when beyond default bias amount threshold value, according to currently The timestamp of frame of video also obtains the time according to the second time tolerance between at least two frame frame of video before Stamp side-play amount, adds that by the timestamp of current video frame the value of timestamp side-play amount replaces abnormal frame of video Timestamp, to ensure that audio-video document can be play smoothly so that will not produce in visual effect significantly The stuck situation of video, thus improve Consumer's Experience.
It is also preferred that the left in some embodiments, described side-play amount computing module 304, specifically for:
Select two frame frame of video before current video frame;Such as, the timestamp of described two frame frame of video is permissible It is 0,1, and the timestamp of current video frame can be 1000;
Calculate the second time tolerance between described two frame frame of video;Time according to described two frame frame of video Stamp 0,1, can be calculated the second time tolerance is 1;
It is 1 using described second time tolerance as described timestamp side-play amount, the most described timestamp side-play amount; Now, the timestamp of described former frame frame of video plus described timestamp side-play amount then equal to 2, thus currently The timestamp of frame of video is replaced by 2.
By above-described embodiment, under normal conditions, by by the front cross frame frame of video of current video frame time Between stamp subtract each other and the second time tolerance of obtaining as timestamp side-play amount, can solve in most cases Timestamp abnormal conditions, additionally can save calculation procedure, thus reduce resource consumption, lifting process speed Degree.
At some in particular cases, the timestamp side-play amount subtracted each other only with front cross frame frame of video and obtain has Or may can cause exception.Such as, when the timestamp of one section of continuous print frame of video is 0,1,2,6,1000,9, Now, subtracting each other, just with the timestamp 2,6 of front cross frame, the timestamp side-play amount obtained is 4, now, when The new timestamp of front frame of video is 6+4=10, or bigger than the timestamp 9 of next frame frame of video, equally There will be exception.
Therefore, further, in some optional embodiments, described side-play amount computing module 304, also Specifically for:
Judge that described second time tolerance is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
If described second time tolerance plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;Here, according to Needs can be that the frame before selecting described two frame frame of video is the most, ensures result relatively at needs In the case of excellent, can stab with the video of a few frame of more options;
By at least one frame before described two frame frame of video together with described two frame frame of video, calculate adjacent video Frame time tolerance between any two, obtains multiple second time tolerance;
It is calculated the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
Such as, in the case of selecting the frame before described two frame frame of video, described meansigma methods is equal to [(2-1)+(6-2)]/2=2.5, at this moment, the timestamp of described former frame frame of video is then equal to plus described meansigma methods 8.5, thus the timestamp of current video frame is replaced by 8.5, its than next frame frame of video timestamp 9 more Little, thus solve above-mentioned problem.
By above-described embodiment, preferably resolve the timestamp in some frame of video in particular cases abnormal Problem.
In some cases, only above-described embodiment is used once, it may not be possible to be fully solved above-mentioned abnormal conditions, Therefore, further, in some optional embodiments, described side-play amount computing module 304, also have Body is used for:
Judge whether described meansigma methods is more than or equal to plus the result of the timestamp of described former frame frame of video The timestamp of next frame of video;
If described meansigma methods is less than next frame of video plus the result of the timestamp of described former frame frame of video Timestamp, using described meansigma methods as described timestamp side-play amount;
If described meansigma methods regards more than or equal to next plus the result of the timestamp of described former frame frame of video Frequently the timestamp of frame, then continue to be chosen at least one frame before at least one frame before described two frame frame of video;
Repeat the above steps, lays equal stress on and is newly calculated meansigma methods, until described meansigma methods is plus described former frame The result of the timestamp of frame of video is less than the timestamp of next frame of video.
It can be seen that by above-described embodiment, preferably solve in some frame of video in particular cases Timestamp abnormal problem.
Optionally, in some other embodiment, described side-play amount computing module 304, specifically for:
Select the multi-frame video frame before current video frame;
Calculate adjacent video frames time tolerance between any two in described multi-frame video frame, obtain multiple second Time tolerance;
Calculate the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
Can find out from above-described embodiment, calculate by directly choosing the multi-frame video frame before current video frame Time tolerance so that avoiding the most as far as possible, some abnormal conditions occur, thus solve well There is abnormal problem in timestamp.
Those of ordinary skill in the field it is understood that the discussion of any of the above embodiment is exemplary only, It is not intended to imply that the scope of the present disclosure (including claim) is limited to these examples;Think of in the present invention Under road, can also be combined between the technical characteristic in above example or different embodiment, step can With with random order realize, and exist the present invention as above different aspect many other change, for Simple and clear they do not provide in the details.
It addition, for simplifying explanation and discussing, and in order to obscure the invention, provided Accompanying drawing can illustrate or can not illustrate and integrated circuit (IC) chip and the known power supply of other parts / grounding connection.Furthermore, it is possible to illustrate device in block diagram form, in order to avoid obscuring the invention, And this have also contemplated that following facts, i.e. the details about the embodiment of these block diagram arrangements is highly to depend on In will implement the present invention platform (that is, these details should be completely in the reason of those skilled in the art In the range of solution).Elaborating that detail (such as, circuit) is to describe the exemplary embodiment of the present invention In the case of, it will be apparent to those skilled in the art that can there is no these details In the case of or these details change in the case of implement the present invention.Therefore, these descriptions should be recognized For being illustrative and not restrictive.
Although invention has been described to have been incorporated with the specific embodiment of the present invention, but according to above Description, these embodiments a lot of replace, amendment and modification will be for those of ordinary skills Obviously.Such as, other memory architecture (such as, dynamic ram (DRAM)) can use The embodiment discussed.
Embodiments of the invention be intended to fall within the broad range of claims all so Replacement, amendment and modification.Therefore, all within the spirit and principles in the present invention, any omission of being done, Amendment, equivalent, improvement etc., should be included within the scope of the present invention.

Claims (10)

1. a timestamp fault tolerant control method, it is characterised in that including:
In audio/video decoding course, obtain the timestamp of frame of video successively;
Calculate the very first time stamp difference between current video frame and former frame frame of video;
Judge that whether stamp difference of the described very first time is more than default bias amount threshold value;
If stamp difference is more than default bias amount threshold value the described very first time, according to before current video frame at least The second time tolerance between two frame frame of video, is calculated timestamp side-play amount;
The timestamp of current video frame is replaced with the timestamp of described former frame frame of video plus the described time Stamp side-play amount.
Method the most according to claim 1, it is characterised in that described according to current video frame before At least two frame frame of video between the second time tolerance, the step being calculated timestamp side-play amount includes:
Select two frame frame of video before current video frame;
Calculate the second time tolerance between described two frame frame of video;
Using described second time tolerance as described timestamp side-play amount.
Method the most according to claim 2, it is characterised in that the described two frame frame of video of described calculating Between the second time tolerance step after also include:
Judge that described second time tolerance is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
If described second time tolerance plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;
By at least one frame before described two frame frame of video together with described two frame frame of video, calculate adjacent video Frame time tolerance between any two, obtains multiple second time tolerance;
It is calculated the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
Method the most according to claim 3, it is characterised in that described in be calculated the plurality of Also include after the step of the meansigma methods of two time tolerances:
Judge whether described meansigma methods is more than or equal to plus the result of the timestamp of described former frame frame of video The timestamp of next frame of video;
If described meansigma methods is less than next frame of video plus the result of the timestamp of described former frame frame of video Timestamp, using described meansigma methods as described timestamp side-play amount;
If described meansigma methods regards more than or equal to next plus the result of the timestamp of described former frame frame of video Frequently the timestamp of frame, then continue to be chosen at least one frame before at least one frame before described two frame frame of video;
Repeat the above steps, lays equal stress on and is newly calculated meansigma methods, until described meansigma methods is plus described former frame The result of the timestamp of frame of video is less than the timestamp of next frame of video.
Method the most according to claim 1, it is characterised in that described according to current video frame before At least two frame frame of video between the second time tolerance, the step being calculated timestamp side-play amount includes:
Select the multi-frame video frame before current video frame;
Calculate adjacent video frames time tolerance between any two in described multi-frame video frame, obtain multiple second Time tolerance;
Calculate the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
6. a timestamp fault tolerant control, it is characterised in that including:
Timestamp acquisition module, in audio/video decoding course, obtains the timestamp of frame of video successively;
Difference calculating module, poor for calculating the very first time stamp between current video frame and former frame frame of video Value;
Difference judge module, is used for judging that whether stamp difference of the described very first time is more than default bias amount threshold value;
Side-play amount computing module, if stamp difference was more than default bias amount threshold value, for basis the described very first time The second time tolerance between at least two frame frame of video before current video frame, is calculated timestamp inclined Shifting amount;
Timestamp replacement module, for replacing with described former frame frame of video by the timestamp of current video frame Timestamp adds described timestamp side-play amount.
Device the most according to claim 6, it is characterised in that described side-play amount computing module, tool Body is used for:
Select two frame frame of video before current video frame;
Calculate the second time tolerance between described two frame frame of video;
Using described second time tolerance as described timestamp side-play amount.
Device the most according to claim 7, it is characterised in that described side-play amount computing module, also Specifically for:
Judge that described second time tolerance is the biggest plus the result of the timestamp of described former frame frame of video In or equal to the timestamp of next frame of video;
If described second time tolerance plus described former frame frame of video timestamp result more than or etc. In the timestamp of next frame of video, then choose at least one frame before described two frame frame of video;
By at least one frame before described two frame frame of video together with described two frame frame of video, calculate adjacent video Frame time tolerance between any two, obtains multiple second time tolerance;
It is calculated the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
Device the most according to claim 8, it is characterised in that described side-play amount computing module, also Specifically for:
Judge whether described meansigma methods is more than or equal to plus the result of the timestamp of described former frame frame of video The timestamp of next frame of video;
If described meansigma methods is less than next frame of video plus the result of the timestamp of described former frame frame of video Timestamp, using described meansigma methods as described timestamp side-play amount;
If described meansigma methods regards more than or equal to next plus the result of the timestamp of described former frame frame of video Frequently the timestamp of frame, then continue to be chosen at least one frame before at least one frame before described two frame frame of video;
Repeat the above steps, lays equal stress on and is newly calculated meansigma methods, until described meansigma methods is plus described former frame The result of the timestamp of frame of video is less than the timestamp of next frame of video.
Device the most according to claim 6, it is characterised in that described side-play amount computing module, tool Body is used for:
Select the multi-frame video frame before current video frame;
Calculate adjacent video frames time tolerance between any two in described multi-frame video frame, obtain multiple second Time tolerance;
Calculate the meansigma methods of the plurality of second time tolerance;
Using described meansigma methods as described timestamp side-play amount.
CN201610195424.7A 2016-03-30 2016-03-30 Timestamp fault-tolerant control method and device Pending CN105846940A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610195424.7A CN105846940A (en) 2016-03-30 2016-03-30 Timestamp fault-tolerant control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610195424.7A CN105846940A (en) 2016-03-30 2016-03-30 Timestamp fault-tolerant control method and device

Publications (1)

Publication Number Publication Date
CN105846940A true CN105846940A (en) 2016-08-10

Family

ID=56597926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610195424.7A Pending CN105846940A (en) 2016-03-30 2016-03-30 Timestamp fault-tolerant control method and device

Country Status (1)

Country Link
CN (1) CN105846940A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411927A (en) * 2016-10-28 2017-02-15 北京奇虎科技有限公司 Monitoring video recording method and device
CN106412677A (en) * 2016-10-28 2017-02-15 北京奇虎科技有限公司 Generation method and device of playback video file
CN106878703A (en) * 2017-03-14 2017-06-20 珠海全志科技股份有限公司 A kind of drive recorder video recording detection method
CN109089130A (en) * 2018-09-18 2018-12-25 网宿科技股份有限公司 A kind of method and apparatus for the timestamp adjusting live video
CN109787703A (en) * 2019-02-28 2019-05-21 烽火通信科技股份有限公司 A kind of modification method of timestamp, clock synchronizing method and system
CN109905763A (en) * 2019-03-20 2019-06-18 四川长虹电器股份有限公司 Optimize the method that player audio plays Caton
CN114339453A (en) * 2022-01-06 2022-04-12 北京金山云网络技术有限公司 Timestamp calibration method and apparatus, electronic device, and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1452408A (en) * 2002-04-18 2003-10-29 华为技术有限公司 Picture smoothly displaying method
US20060133251A1 (en) * 2002-09-27 2006-06-22 Arul Thangaraj System and method for audio and visual synchronization
CN104394421A (en) * 2013-09-23 2015-03-04 贵阳朗玛信息技术股份有限公司 Video frame processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1452408A (en) * 2002-04-18 2003-10-29 华为技术有限公司 Picture smoothly displaying method
US20060133251A1 (en) * 2002-09-27 2006-06-22 Arul Thangaraj System and method for audio and visual synchronization
US20130101050A1 (en) * 2002-09-27 2013-04-25 Broadcom Corporation System and method for audio and visual synchronization
CN104394421A (en) * 2013-09-23 2015-03-04 贵阳朗玛信息技术股份有限公司 Video frame processing method and device

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106412677B (en) * 2016-10-28 2020-06-02 北京奇虎科技有限公司 Method and device for generating playback video file
CN106412677A (en) * 2016-10-28 2017-02-15 北京奇虎科技有限公司 Generation method and device of playback video file
WO2018076998A1 (en) * 2016-10-28 2018-05-03 北京奇虎科技有限公司 Method and device for generating playback video file
CN106411927B (en) * 2016-10-28 2019-06-04 北京奇虎科技有限公司 A kind of video monitoring method and device
CN106411927A (en) * 2016-10-28 2017-02-15 北京奇虎科技有限公司 Monitoring video recording method and device
CN106878703A (en) * 2017-03-14 2017-06-20 珠海全志科技股份有限公司 A kind of drive recorder video recording detection method
CN106878703B (en) * 2017-03-14 2019-01-04 珠海全志科技股份有限公司 A kind of automobile data recorder video recording detection method
CN109089130A (en) * 2018-09-18 2018-12-25 网宿科技股份有限公司 A kind of method and apparatus for the timestamp adjusting live video
EP3852376A4 (en) * 2018-09-18 2021-12-22 Wangsu Science & Technology Co., Ltd. Method and device for adjusting timestamp of live broadcast video
WO2020056877A1 (en) * 2018-09-18 2020-03-26 网宿科技股份有限公司 Method and device for adjusting timestamp of live broadcast video
CN109089130B (en) * 2018-09-18 2020-05-22 网宿科技股份有限公司 Method and device for adjusting timestamp of live video
WO2020173175A1 (en) * 2019-02-28 2020-09-03 烽火通信科技股份有限公司 Timestamp correction method and system, clock synchronization method and system
CN109787703A (en) * 2019-02-28 2019-05-21 烽火通信科技股份有限公司 A kind of modification method of timestamp, clock synchronizing method and system
CN109905763A (en) * 2019-03-20 2019-06-18 四川长虹电器股份有限公司 Optimize the method that player audio plays Caton
CN109905763B (en) * 2019-03-20 2021-09-10 四川长虹电器股份有限公司 Method for optimizing audio playing pause of player
CN114339453A (en) * 2022-01-06 2022-04-12 北京金山云网络技术有限公司 Timestamp calibration method and apparatus, electronic device, and storage medium
CN114339453B (en) * 2022-01-06 2023-11-03 北京金山云网络技术有限公司 Time stamp calibration method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105846940A (en) Timestamp fault-tolerant control method and device
CN105848012A (en) Real-time transcoding rate control method and device
CN101808202B (en) Method, system and computer for realizing sound-and-caption synchronization in video file
CN101785237B (en) Data transmission/reception system, data relay device, data reception device, data relay method, and data reception method
JP4257382B1 (en) Noise reduction device and noise reduction method
CN102802039B (en) Multi-channel video hybrid decoding output method and device
US9288418B2 (en) Video signal transmitter apparatus and receiver apparatus using uncompressed transmission system of video signal
CN103607581A (en) Video monitoring image display method based on three-dimensional images
CN102223539A (en) Processing method for splash screen caused by picture coding frame loss
US20140362923A1 (en) Video signal processing device, video signal output device, and video signal processing method
CN101651813A (en) Method of driving display apparatus and driving circuit for display apparatus using the same
CN103686423B (en) For the collocation method and device of the visible image quality parameter of user
CN106454554A (en) Ambient light television time synchronizing method and ambient light television
CN101783869A (en) Method for realizing self-adapting conversion of X-ray nonstandard video digital code by using FPGA (Field Programmable Gate Array)
US10536663B2 (en) Video display device, television receiver, transmitting device, control program, and recording medium
CN105430237A (en) Frame missing image processing method and system
CN100591140C (en) Method for displaying subtitling in video
CN101729841B (en) Comb-like pseudoscopic image detection apparatus and method
CN103716638A (en) Video image display sequence representing method
CN102438162A (en) Method and apparatus for dual channel signal processing and display
US10419709B2 (en) Video processing device, transmitting device, control program, and recording medium
CN108134938A (en) Videoscanning mode detects, correcting method and video broadcasting method and device
CN101516033A (en) Circuit and method for error correction
TWI581247B (en) Display device and control method thereof
US9093010B2 (en) Image processing method and image processing apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160810

WD01 Invention patent application deemed withdrawn after publication