Summary of the invention
Main purpose of the present invention is the processing method and the device that provide a kind of video playback, to solve user's problem that the stand-by period is longer when watching time shift and being live in prior art.
To achieve these goals, according to an aspect of the present invention, provide a kind of processing method of video playback, comprising: receive the playing request instruction of user for video flowing, wherein, playing request instruction comprises the initial time that request video flowing starts to play; From server, search the video flowing fragment corresponding to initial time in video flowing, wherein, video flowing is divided into multiple video flowing fragment, and multiple video flowing fragments store is in server; And the video flowing fragment found is play from initial time.
Further, video flowing is divided into multiple video flowing fragment in such a way: video flowing is carried out duration such as grade and divide, and obtains multiple video flowing fragment waiting duration.
Further, from server, search the video flowing fragment corresponding to initial time in video flowing comprise: determine the reproduction time scope that each video flowing fragment is corresponding; Search the reproduction time scope that initial time is positioned at; And the video flowing fragment corresponding with the reproduction time scope found is defined as the video flowing fragment corresponding to initial time.
Further, from server, search the video flowing fragment corresponding to initial time in video flowing comprise: from server, search the first video flowing fragment, wherein, initial time is positioned at reproduction time scope corresponding to the first video flowing fragment; Obtain the first duration, wherein, the first duration is the duration of initial time to the very first time, and the very first time is end of playing moment of the first video flowing fragment; Judge whether the first duration is less than preset duration; And when judgement first duration is less than preset duration, the second video flowing fragment is searched from server, wherein, the broadcasting initial time of the second video flowing fragment is the very first time, plays the video flowing fragment found and comprises: play the first video flowing fragment and the second video flowing fragment successively from initial time from initial time.
To achieve these goals, according to a further aspect in the invention, a kind of processing unit of video playback is provided, the processing method of any one video playback of this processing unit for performing the invention described above and providing.
To achieve these goals, according to a further aspect in the invention, a kind of processing unit of video playback is provided, comprise: receiver module, for receiving the playing request instruction of user for video flowing, wherein, playing request instruction comprises the initial time that request video flowing starts to play; Processing module, is connected with receiver module, and for searching the video flowing fragment corresponding to initial time in video flowing from server, wherein, video flowing is divided into multiple video flowing fragment, and multiple video flowing fragments store is in server; And playing module, be connected with processing module, for playing the video flowing fragment found from initial time.
Further, processing module comprises: the first process submodule, for determining the reproduction time scope that each video flowing fragment is corresponding; Second process submodule, is connected between receiver module and the first process submodule, for searching the reproduction time scope that initial time is positioned at; And the 3rd processes submodule, is connected between the second process submodule and playing module, for the video flowing fragment corresponding with the reproduction time scope found being defined as the video flowing fragment corresponding to initial time.
Further, processing module comprises: the 4th process submodule, and be connected with receiver module, for searching the first video flowing fragment from server, wherein, initial time is positioned at reproduction time scope corresponding to the first video flowing fragment; 5th process submodule, process submodule be connected with the 4th, for obtaining the first duration, wherein, the first duration is the duration of initial time to the very first time, and the very first time is end of playing moment of the first video flowing fragment; 6th process submodule, processes submodule be connected, for judging whether the first duration is less than preset duration with the 5; And the 7th processes submodule, process submodule be connected with the 6th, for when judgement first duration is less than preset duration, the second video flowing fragment is searched from server, wherein, the broadcasting initial time of the second video flowing fragment is the very first time, and playing module comprises: play submodule, for playing the first video flowing fragment and the second video flowing fragment successively from initial time.
Pass through the present invention, adopt and a video flowing is divided into multiple video flowing fragment in advance, receive comprise request video flowing start play initial time after, the video flowing fragment corresponding to initial time in video flowing is searched from server, then the video flowing fragment found is play from initial time, by video flowing is carried out multiple clips division, when user needs viewing time shift live video, only need be loaded into and play one section of video flowing fragment corresponding to initial time with the request of user, correspondingly reduce the index file that user needs to download, shorten stand-by period when user downloads index file, solve user's problem that the stand-by period is longer when watching time shift and being live in prior art, and then reach shorten user watch time shift live time the effect of stand-by period.
Embodiment
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.Below with reference to the accompanying drawings and describe the present invention in detail in conjunction with the embodiments.
Embodiments provide a kind of processing unit of video playback, below the processing unit of the video playback that the embodiment of the present invention provides is introduced.
Fig. 1 is the schematic diagram of the processing unit of video playback according to the embodiment of the present invention, and as shown in Figure 1, the processing unit of this embodiment comprises receiver module 10, processing module 20 and playing module 30.
Receiver module 10 is for receiving the playing request instruction of user for video flowing, and the playing request instruction that user issues comprises the concrete initial time that request video flowing starts to play; Processing module 20 is connected with receiver module 10, and after receiving the user's request, from server, search the video flowing fragment corresponding to initial time in video flowing, the video flowing in server is divided into multiple video flowing fragment in advance; Playing module 30 is connected with processing module 20, for the concrete video flowing fragment found from initial time play processing module 20.
The processing unit of this embodiment is by being divided into multiple video flowing fragment in advance by a video flowing, receiver module 10 receive comprise request video flowing start play initial time after, from server, the video flowing fragment corresponding to initial time in video flowing is searched by processing module 20, then play the video flowing fragment found from initial time by playing module 30, by video flowing is carried out multiple clips division, when user needs viewing time shift live video, only need be loaded into and play one section of video flowing fragment corresponding to initial time with the request of user, correspondingly reduce the index file that user needs to download, index file is controlled in smaller scope, shorten stand-by period when user downloads index file, solve user's problem that the stand-by period is longer when watching time shift and being live in prior art, and then reach shorten user watch time shift live time the effect of stand-by period.
Wherein, video flowing is divided into multiple video flowing fragment in such a way:
Divide according to the time, video flowing is carried out duration such as grade to divide, obtain multiple video flowing fragment waiting duration, namely, video flowing is split with less time granularity, the data of set time section only preserved by each section file, and the duration of each video flowing fragment using user's acceptable waiting time as reference frame when dividing video flowing, can be set to 6 hours by above-mentioned less time granularity in embodiments of the present invention.
Fig. 2 is the schematic diagram of the processing unit according to first preferred embodiment of the invention, as shown in Figure 2, the processing unit of first preferred embodiment of the invention is compared with the processing unit shown in Fig. 1, the two difference is, the processing module 20 of the processing unit of first preferred embodiment of the invention comprises the first process submodule 21, second and processes submodule 22 and the 3rd processing module 23.
First process submodule 21 is for determining the respective reproduction time range intervals of each video flowing fragment in server; Second process submodule 22 and first processes submodule 21 and is all connected with receiver module 10, the reproduction time scope that the initial time for searching in user's request instruction is positioned at; 3rd process submodule 23 is connected with the second process submodule 22, for processing with second the video flowing fragment that video flowing fragment corresponding to reproduction time scope that submodule 22 finds is defined as the initial time corresponded in user's request instruction, for the broadcasting of playing module 30.
By searching the reproduction time scope that initial time is positioned at, and then determining that video flowing fragment corresponding to the reproduction time scope that finds is the required target video flow section play, reaching the effect accurately determining target video flow section.
Fig. 3 is the schematic diagram of the processing unit according to second preferred embodiment of the invention, as shown in Figure 3, the processing unit of second preferred embodiment of the invention is compared with the processing unit shown in Fig. 1, the two difference is, the processing module 20 of the processing unit of second preferred embodiment of the invention comprises the 4th process submodule 24, the 5th process submodule 25, the 6th processing module 26 and the 7th processing module 27.
4th process submodule 24 is connected with receiver module 10, after receiver module 10 receives the request play instruction of user, 4th process submodule 24 searches the first video flowing fragment from server, and wherein, initial time is positioned at reproduction time scope corresponding to the first video flowing fragment; After finding the first video flowing fragment, by with the 4th process that submodule 24 is connected the 5th process submodule 25 and obtain from the duration between end of playing moment of initial time to the first video flowing fragment, as the first duration; 6th process submodule 26 and the 5th processes submodule 25 and is connected, to judge whether the first duration got is less than preset duration, this preset duration specifically can set according to practical experience, if the first duration is less than preset duration, what then illustrate that the first video flowing fragment is left holding time of displaying video generally can cannot meet the demand of user, now, by with the 6th process that submodule 26 is connected the 7th process submodule 27 from server, search the second video flowing fragment, wherein, the broadcasting initial time of the second video flowing fragment is the very first time; Then the first video flowing fragment and the second video flowing fragment is play by the broadcasting submodule 31 in playing module 30 successively from initial time.
By carrying out comparative evaluation to the length of the first duration and set point, to be loaded into the adjacent video being about to play in time when the residue reproduction time of the first video flowing fragment is shorter, avoid video playback in user's viewing process, occurs obviously interruption.
It should be noted that, the feature of each embodiment that foregoing provides can be combined with each other, and multiple process submodules of each embodiment both can independently be arranged, also can unify for same processing module, the function playing submodule also can be performed by playing module.
The embodiment of the present invention additionally provides the processing method of video playback, is introduced below to the processing method of the video playback that the embodiment of the present invention provides.It should be noted that, the processing unit of the video playback that can be provided by the embodiment of the present invention in the processing method of the video playback of the embodiment of the present invention is performed, and the processing unit of the video playback of the embodiment of the present invention also may be used for the processing method performing the video playback that the embodiment of the present invention provides.
Fig. 4 is the flow chart of the processing method of video playback according to the embodiment of the present invention, and as shown in Figure 4, the method comprises following step S402 to step S406:
S402: receive the playing request instruction of user for video flowing, this playing request instruction comprises the concrete initial time that request video flowing starts to play.
Such as, user is play video flowing A by playing request instruction request, and request is play from the T moment video flowing A.
S404: after receiving the user's request, searches the video flowing fragment corresponding to initial time in video flowing from server.
In the server of the embodiment of the present invention, the video flowing stored is divided, video flowing is divided into multiple video flowing fragment.Be different from prior art and search according to the whole video flowing of user's request to user's request, in embodiments of the present invention, according to user's request, the video flowing fragment corresponding to initial time in the video flowing of user's request is searched.
Such as, server is installed the Website server IIS of Microsoft, and smooth streaming expansion module is installed with the access point by smooth streaming module creation video source with receiver, video flow data, and in the process received, video flowing is divided, realize the video flowing in server to be divided into multiple video flowing fragment in advance;
S406: play the video flowing fragment found from initial time.
As mentioned above, when the method according to step S404 is searched, only need to find out the video flowing fragment corresponding to initial time in video flowing, thus, when playing the video searched, only need to load the video flowing fragment found, compared to loading whole video flowing, speed is faster.
The processing method of this embodiment is by being divided into multiple video flowing fragment in advance by a video flowing, receive comprise request video flowing start play initial time after, the video flowing fragment corresponding to initial time in video flowing is searched from server, then the video flowing fragment found is play from initial time, by video flowing is carried out multiple clips division, when user needs viewing time shift live video, only need be loaded into and play one section of video flowing fragment corresponding to initial time with the request of user, correspondingly reduce the index file that user needs to download, index file is controlled in smaller scope, shorten stand-by period when user downloads index file, solve user's problem that the stand-by period is longer when watching time shift and being live in prior art, and then reach shorten user watch time shift live time the effect of stand-by period.
In embodiments of the present invention, can divide in any way, preferably, according to the time, video flowing can be divided into multiple video flowing fragment, such as, video flowing is carried out duration such as grade to divide, obtain multiple video flowing fragment waiting duration, by video flowing is split with less time granularity, the data of set time section only preserved by each section file, above-mentioned less time granularity can using user's acceptable waiting time as reference frame when dividing video flowing, the duration of each video flowing fragment can be set to 6 hours in embodiments of the present invention.In this enforcement, by video flowing being divided into multiple video flowing fragment waiting duration, can easily video stream file be managed, and, can realize user when playing according to different broadcasting initial times, all can wait for the identical load time, user experience is better.
In order to determine the video flowing fragment (that is, target video flow section) needing to search accurately, preferably, in step s 404, the video flowing fragment corresponding to initial time in video flowing can be searched in the following manner from server:
First, the reproduction time range intervals that in server, each video flowing fragment is corresponding is determined;
Secondly, the reproduction time scope that the initial time in user's request instruction is positioned at is searched;
Finally, the video flowing fragment corresponding with the reproduction time scope found is defined as the video flowing fragment of the initial time corresponded in user's request instruction.
By searching the reproduction time scope that initial time is positioned at, and then determining that video flowing fragment corresponding to the reproduction time scope that finds is the required target video flow section play, reaching the effect accurately determining target video flow section.
Preferably, step S404 searches in video flowing and corresponds to the video flowing fragment of initial time from server, and step S406 is play from initial time the concrete video flowing fragment found and can be realized by following concrete steps:
After receiving the request play instruction of user, search the first video flowing fragment from server, wherein, initial time is positioned at reproduction time scope corresponding to the first video flowing fragment; First video flowing fragment is the video flowing fragment corresponding with the initial time that user asks.
After finding the first video flowing fragment, obtain from the duration between end of playing moment of initial time to the first video flowing fragment, as the first duration;
Judge whether the first duration got is less than preset duration, this preset duration specifically can set according to practical experience, if the first duration is less than preset duration, what then illustrate that the first video flowing fragment is left holding time of displaying video generally can cannot meet the demand of user, now, from server, search the second video flowing fragment, wherein, the broadcasting initial time of the second video flowing fragment is the very first time;
Finally, the first video flowing fragment and the second video flowing fragment is play successively from initial time.
The video flowing that the embodiment of the present invention is mentioned can be the video flowing of live video, also can be the video flowing of other Online Video, when video flowing is the video flowing of online live video, user can be made to obtain the video of playback rapidly, improve Consumer's Experience.
By carrying out comparative evaluation to the length of the first duration and set point, to be loaded into the adjacent video being about to play in time when the residue reproduction time of the first video flowing fragment is shorter, avoid video playback in user's viewing process, occurs obviously interruption.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.