The video flowing fast playing method
Technical field
The invention relates to a kind of player method of video flowing, and particularly relevant for a kind of fast playing method of video flowing.
Background technology
At present, as long as the software or the hardware of ability displaying video all have the function of quick broadcast, the so-called broadcast fast is meant F.F. and rewind down.When the video that broadcast records, traditional fast forwarding and fast rewinding operation basically all is the frame structure features according to video, and only I frame wherein being decoded and delivering to the terminal shows that the frame of other kinds then skips over and disregards, and realizes the purpose of playing fast whereby.General quick playing function all has multiple broadcast times speed to be available for users to select, for example 2 times of speed, 4 times of speed, 8 times of speed even 32 times of speed.When the broadcast of high power speed, Play System is only decoded and the wherein a part of I frame of display of video streams, and it is high more to play times speed, and decoding and the I frame ratio that shows are just low more.Therefore, the speed effect of playing fast and the actual frame structure of video flowing are closely related.
Because the source and the form of video flowing are various, its frame structure does not have unified standard.There is certain difference in the speed effect that different frame structures can make different video play fast, influences user's impression.
In addition, traditional method is not all considered the decoding speed of decoder, and video decode speed is very fast generally speaking, can make the excessive velocities of seeing video data off, causes the too fast problem of quick broadcast, is unfavorable for that the user watches or searches.
Summary of the invention
The present invention provides a kind of video flowing fast playing method, can realize the accurate control of various different video stream fast forwarding and fast rewinding broadcasting speeds, to address the above problem.
The present invention proposes a kind of video flowing fast playing method, is carried out by a video flowing Play System, comprises the following steps.When the quick displaying video of beginning flowed, the broadcast direction of setting video flowing was doubly fast with broadcast.Present frame with above-mentioned video flowing is a starting point, seeks first key frame based on playing doubly speed playing direction, decodes and plays first key frame.Then, poor according to the system time difference that the quick displaying video of beginning flows to video flowing Play System so far with the reproduction time of video flowing, determine whether the broadcast of video flowing is too fast, just or slow excessively.If the broadcast of video flowing is too fast, wait until that then system time difference and reproduction time difference are complementary, as new present frame, continue to seek the step of next first key frame with first key frame.If the broadcasting speed of video flowing is just, then with first key frame as new present frame, continue to seek the step of next first key frame.If the broadcast of video flowing is slow excessively, is starting point with first key frame then, playing direction finding second key frame, as new present frame, continue to seek the step of next first key frame with second key frame.
In one embodiment of this invention, the first above-mentioned key frame is the frame of X preset kind on the broadcast direction of present frame, and wherein X equals to play doubly speed divided by two.
In one embodiment of this invention, the broadcast of above-mentioned decision video flowing whether too fast, just or slow excessively details following.If above-mentioned system time difference divided by playing doubly speed, judges then that the broadcast of video flowing is too fast less than the reproduction time difference.If the system time difference equals the reproduction time difference divided by playing doubly speed, then the broadcasting speed of video flowing just.If above-mentioned system time difference divided by playing doubly speed, judges then that the broadcast of video flowing is slow excessively greater than the reproduction time difference.
In one embodiment of this invention, above-mentioned system time difference by the time and reproduction time difference are complementary, and wait until that just the system time difference equals the reproduction time difference divided by playing doubly speed.
In one embodiment of this invention, above-mentioned second key frame is the frame that the next one and first key frame on the broadcast direction of first key frame belong to same kind.
In another embodiment of the present invention, the second above-mentioned key frame is the frame that on the broadcast direction of first key frame Y and first key frame belong to same kind.Originally Y is one, if the broadcast of video flowing is continuous slow excessively, then Y is set to video flowing and play slow read-around ratio.If it is slow that the broadcast of video flowing did not have, then Y is reset to one.
Based on above-mentioned, the present invention is poor according to the reproduction time of the system time difference of video flowing Play System and video flowing, and whether the broadcast of decision video flowing is too fast or slow excessively, and regulates according to this.Therefore the present invention can realize the precise speed control of the quick broadcast of various different video streams, can improve user experience.
Description of drawings
For let above-mentioned purpose of the present invention, feature and advantage can be more obviously understandable, elaborate below in conjunction with the accompanying drawing specific embodiments of the invention, wherein:
Fig. 1 is the flow chart according to a kind of video flowing fast playing method of one embodiment of the invention.
Embodiment
Fig. 1 is that the method is carried out by the video flowing Play System according to the flow chart of a kind of video flowing fast playing method of one embodiment of the invention.Above-mentioned Play System can be any software or the hardware with video playback capability, for example digital recorder shadow machine, have numeral the make video recording STB of putting the shadow function, video jukebox software, video laser disc playout software or the like.
Following key diagram 1 flow process.At first, begin quick displaying video stream, set the broadcast direction and broadcast times speed (step 105) of video flowing.Various sources such as desirable automatic network of above-mentioned video flowing or PC can be to download the video of automatic network or the file of having recorded.Above-mentioned broadcast direction can be specified by the user with broadcast times speed, and playing direction can be F.F. or rewind down, and below explanation is an example with the F.F..
Next, write down the system time T of present video flowing Play System
S1And the reproduction time T of present frame
F1(step 110), T
S1And T
F1System time and reproduction time when being this video flowing of the quick broadcast of beginning respectively.So-called reproduction time is represented the relative position of corresponding frame at affiliated video flowing, the time that just general video jukebox software all can show.
After writing time, be starting point, seek a key frame F according to playing doubly speed in direction of advance with the present frame of video flowing
1(step 115).Key frame F
1Be X I frame on the direction of advance of present frame, and X equal to play doubly speed divided by two.That is to say, when two times of fast F.F.s, key frame F
1It is the next I frame on the direction of advance of present frame; When four times of fast F.F.s, key frame F
1It is the next I frame on the direction of advance of present frame; When the F.F. of octuple speed, key frame F
1Be the 4th I frame on the direction of advance of present frame, the rest may be inferred.
Though as key frame, in other embodiments of the invention, if the frame structure of video flowing can cooperate, the frame that also can use other kinds is as key frame with the I frame for present embodiment.
Next, decoding and broadcast key frame F
1(step 120).The video flowing Play System of present embodiment is all or part of I frame in the displaying video stream optionally.It is high more to play times speed, and the I frame of broadcast is just few more, and remaining frame Ignore All does not process, and realizes the F.F. and the rewind down function of video flowing whereby.
Play key frame F
1Afterwards, the present system time T of record
S2And key frame F
1Reproduction time T
F2(step 125) compares (T then
S2-T
S1) and (T
F2-T
F1)/n (step 130).Wherein n is above-mentioned broadcast times speed, (T
S2-T
S1) be that beginning this video flowing of quick broadcast system time up to the present is poor, (T
F2-T
F1) be that this video flowing of broadcast video flowing reproduction time up to the present is poor fast in beginning.If divided by playing doubly speed, the broadcast of expression video flowing is too fast less than the reproduction time difference for the system time difference, the video flowing Play System can wait until earlier that system time difference and reproduction time difference are complementary, and just wait until (T
S32-T
S1) equal (T
F2-T
F1)/n (step 135), wherein T
S3Be to wait the system time of biding one's time, then with key frame F
1As new present frame, return step 115 to continue to seek next key frame (step 140).If the system time difference equals the reproduction time difference divided by playing doubly speed, the broadcasting speed of expression video flowing just, flow process directly gets into step 140.
In the comparison of step 130, if the system time difference is doubly fast divided by playing greater than the reproduction time difference, the broadcast of expression video flowing is slow excessively.This moment, the video flowing Play System can be with key frame F
1Be starting point, seek next key frame F in direction of advance
2(step 145) is then with key frame F
2As new present frame, return step 115 to continue to seek next key frame (step 150).Key frame F
2Be key frame F
1Direction of advance on next I frame.Skip more I frames by this way, can improve the broadcasting speed of video flowing, system time difference and reproduction time difference are complementary.
If step 145 is skipped an I frame, the reproduction time that video flowing might take place is unable to catch up with the situation of system time, and another embodiment of the present invention can be skipped more I frames to prevent above-mentioned condition when the continuous mistake of the broadcast of video flowing is slow.In this embodiment, because play for the first time slow during execution in step 145, key frame F
2Be key frame F
1Direction of advance on next I frame.Because play the continuous second time slow during execution in step 145, key frame F
2Be key frame F
1Direction of advance on next I frame.Because continuous play slow for the third time and during execution in step 145, key frame F
2Be key frame F
1Direction of advance on the 3rd I frame, by that analogy.That is to say key frame F
2Be key frame F
1Direction of advance on Y I frame, originally Y is one, if the broadcast of video flowing is continuous slow excessively, then Y is set to video flowing and play slow read-around ratio.If in the comparison of step 130, the broadcast of video flowing did not have slow, and was just too fast or just, then Y reset to one.
If fast reverse play, some above-mentioned steps needs to revise.The key frame F of step 115
1Change X I frame on the direction of retreat of present frame into.Step 130 changes comparison (T into
S2-T
S1) and (T
F1-T
F2)/n, just the reproduction time difference changes (T into
F1-T
F2), this be because numeral relatively be necessary on the occasion of.The key frame F of step 145
2Change into key frame F
1Direction of retreat.Remaining details is identical, will not give unnecessary details.
In sum, the present invention judges according to system time and the magnitude relationship of video playback time whether video playback is too fast or slow excessively, to regulate the broadcasting speed of video.No matter which kind of the user specifies play doubly speed, and no matter how the frame structure of video flowing distributes, and the present invention can accurately control the speed of quick broadcast, makes its self-consistentency, to promote user's the experience of viewing and admiring.
Though the present invention discloses as above with preferred embodiment; Right its is not that any those skilled in the art are not breaking away from the spirit and scope of the present invention in order to qualification the present invention; When can doing a little modification and perfect, so protection scope of the present invention is when being as the criterion with what claims defined.