CN104994433B - Video file provides method and device - Google Patents
Video file provides method and device Download PDFInfo
- Publication number
- CN104994433B CN104994433B CN201510373553.6A CN201510373553A CN104994433B CN 104994433 B CN104994433 B CN 104994433B CN 201510373553 A CN201510373553 A CN 201510373553A CN 104994433 B CN104994433 B CN 104994433B
- Authority
- CN
- China
- Prior art keywords
- frame
- data
- data frame
- video file
- size
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47217—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/232—Content retrieval operation locally within server, e.g. reading video streams from disk arrays
- H04N21/2326—Scheduling disk or memory reading operations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
- H04N21/8586—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
Video file provides method and device, and methods described includes:According to the playing request from client received, the search original position of video file is obtained;According to the search original position, it is determined that corresponding data frame, returns to the client by the content of video file corresponding to the identified data frame and plays out, wherein, the video file includes more than two data frames.Above-mentioned method can improve the offer speed of video file, reduce the pressure to caused by disk.
Description
Technical field
The invention belongs to technical field of network video, and method and device is provided more particularly to a kind of video file.
Background technology
FLV (Flash Video) stream media format is a kind of emerging video format.FLV video files not only can be light
Pine is promptly imported in flash memory (Flash), and video file can be played a part of to protect copyright, can not also pass through local
Microsoft or REAL player plays videos.Current almost all of Large video website all uses FLV video files, is mesh
It is preceding to increase most fast, most commonly used video transmission form.
Video dragging is a kind of method according to range of requests video content, is divided into temporally scope and document misregistration amount model
Enclose two ways.In the prior art, the dragging of FLV video files is usually the key frame in script markup (script tag)
(keyframes) list is realized, this list corresponds the time of key frame and the offset in flash memory video file
Get up.
But keyframes lists are carried in not every FLV video files.For there is no keyframes lists
FLV video files, when getting the request time of user, it is necessary to from first data frame of file to positioned at end of file
Last data frame traveled through one by one, with determine user need data frame original position and end position, and will
Corresponding video file data returns to user.Therefore, it is slow to there is processing speed in the offer method for this video file,
And larger pressure can be caused to disk.
The content of the invention
The embodiment of the present invention solves the problems, such as it is the offer speed for improving video file, reduces the pressure to caused by disk.
To solve the above problems, the embodiments of the invention provide a kind of video file broadcasting method, methods described includes:
According to the playing request from client received, the search original position of video file is obtained;
According to the search original position, it is determined that corresponding data frame, and will determined by regard corresponding to the data frame
The content of frequency file returns to the client and played out, wherein, the video file includes more than two key frames.
Alternatively, the playing request from client that the basis receives, the search start bit of video file is obtained
Put, including:
The request is obtained from the playing request and plays start time point, is obtained from the file header of the video file
Take the total time of the video file and the information of total size;
Product divided by the video file using the total size of broadcasting start time point and the video file
Obtain the search original position total time.
Alternatively, it is described according to the search original position, it is determined that corresponding data frame, and by identified data frame pair
The content for the video file answered returns to client and played out, including:
When it is determined that the search original position does not have data frame frame head feature, enter since the search original position
Line position puts skew, and obtaining one with search has the position of data frame frame head feature;
The information of the first numerical value is obtained from the first position of the position with data frame frame head feature;
When it is determined that first numerical value is the first default value, from the position with data frame frame head feature
The second place obtains the information of second value, and offsets the big of a data frame from the position with data frame frame head feature
The 3rd opening position of small arrival, the information of third value is obtained from the 3rd opening position;
When it is determined that the second value and the second default value sum are equal to the third value, it is determined that described have number
It is data frame according to the frame where the position of frame frame head feature;
Judge whether the data frame is key frame;
When judging the data frame for key frame, time corresponding to the key frame and the broadcasting initial time are judged
Whether point is consistent;
When it is determined that the time corresponding to the key frame is consistent with the broadcasting start time point, determine that the key frame is
Key frame corresponding with the playing request initial time;
Carried out backward since the data frame corresponding with the playing request initial time position offset to obtain with from
Key frame corresponding to the playing request end time obtained in the playing request;
By pass corresponding to key frame corresponding to the playing request start time point to the playing request end time point
The content of video file returns to client and played out corresponding to key frame.
Alternatively, when it is determined that the second value and the second default value sum are equal to the third value, in addition to:
The frame type and size of data recorded in the frame head of the last data frame of the data frame, and postamble are obtained respectively
The information of the size of data of middle record;
When the frame type in the frame head according to the last data frame determines that the last data frame is the preset kind
Data frame, and the size of data recorded in the frame head of the last data frame and the default value sum, with remembering in postamble
When the size of data of record is equal, determine the data frame for data frame corresponding to the search initial time.
Alternatively, when the size of data recorded in the frame head of the data frame and default value sum, with the data frame
Postamble in the size of data that records it is equal when, in addition to:
The frame type and size of data recorded in the frame head of the latter data frame of the data frame, and postamble are obtained respectively
The information of the size of data of middle record;
When frame type determines the latter data frame for the preset kind in the frame head according to the latter data frame
Data frame, and the size of data recorded in the frame head of the latter data frame and the default value sum, with being recorded in postamble
Size of data it is equal when, it is data frame corresponding with the request time to determine the data frame.
Alternatively, the video file is FLV files.
The embodiment of the present invention additionally provides a kind of video file and provides device, and described device includes:
Receiving unit, suitable for receiving the playing request from client;
Acquiring unit, suitable for according to the playing request, obtaining the search original position of video file;
Determining unit, suitable for according to the search original position, it is determined that corresponding key frame, the video file includes two
Key frame more than individual;
Unit is provided, suitable for the content of video file corresponding to the identified key frame is returned into the client
Play out.
Alternatively, the acquiring unit is suitable to obtain the request broadcasting start time point from the playing request, from
The total time of the video file and the information of total size are obtained in the file header of the video file;Originated using described play
The product of the total size of time point and the video file divided by the video file obtain the search start bit total time
Put.
Alternatively, the determining unit is suitable to when it is determined that the search original position does not have data frame frame head feature,
Position skew is proceeded by from the search original position, obtaining one with search has the position of data frame frame head feature;From institute
State the information that the first numerical value is obtained in the first position of the position with data frame frame head feature;When it is determined that first numerical value is
During the first default value, the letter of second value is obtained from the second place in the position with data frame frame head feature
Breath, and offset from the position with data frame frame head feature size the 3rd opening position of arrival of a data frame, from described the
Three opening positions obtain the information of third value;When it is determined that the second value and the second default value sum are equal to the described 3rd number
During value, it is determined that the frame where the position with data frame frame head feature is data frame;Judge whether the data frame is pass
Key frame;When judging the data frame for key frame, time corresponding to the key frame and the broadcasting start time point are judged
It is whether consistent;When it is determined that the time corresponding to the key frame is consistent with the broadcasting start time point, the key frame is determined
For key frame corresponding with the playing request initial time;From the data frame corresponding with the playing request initial time
Start to carry out position backward and offset playing request end time for obtaining with being obtained from the playing request corresponding key frame,
Wherein, key frame corresponding to the playing request start time point of the playing request is corresponding to the playing request end time point
Key frame be key frame corresponding to described.
Alternatively, the determining unit, which is further adapted for working as, determines the second value and the second default value sum equal to described
During third value, the frame type and size of data recorded in the frame head of the last data frame of the data frame is obtained respectively, and
The information of the size of data recorded in postamble;When the frame type in the frame head according to the last data frame determines the previous number
Data frame according to frame for the preset kind, and the size of data recorded in the frame head of the last data frame and the present count
It is worth sum, when equal with the size of data recorded in postamble, determines the data frame for number corresponding to the search initial time
According to frame.
Alternatively, the determining unit, which is further adapted for working as, determines the second value and the second default value sum equal to described
During third value, the frame type and size of data recorded in the frame head of the latter data frame of the data frame is obtained respectively, and
The information of the size of data recorded in postamble;When frame type determines the latter data in the frame head according to the latter data frame
Frame is the data frame of the preset kind, and the size of data recorded in the frame head of the latter data frame and the default value
Sum, when equal with the size of data recorded in postamble, it is data frame corresponding with the request time to determine the data frame.
Alternatively, the video file is FLV files.
Compared with prior art, technical scheme has the following advantages that:
Above-mentioned scheme, according to the request time of user calculate search original position, and with it is described search original position to
Preceding and search determination data frame corresponding with the request time backward original position and end position, it is whole without traveling through
Video file is to determine the original position of user's request and final position, it is thus possible to improve the offer speed of video file, and
It can simultaneously reduce and pressure is read and write to caused by disk, lift the usage experience of user.
Further, by the frame type of last data frame and the information of size of data of identified data frame, to institute
The request time corresponding data frame of determination is verified, can improve identified data frame corresponding with the request time
The accuracy of position.
Further, by the frame type of latter data frame and the information of size of data of identified data frame, come pair
Data frame corresponding to identified request time is verified, can improve identified data corresponding with the request time
The accuracy of the position of frame.
Brief description of the drawings
Fig. 1 is the flow chart that video file a kind of in the embodiment of the present invention provides method;
Fig. 2 is the flow chart that video file another in the embodiment of the present invention provides method;
Fig. 3 is a kind of structural representation of video file offer device in the embodiment of the present invention.
Embodiment
Video dragging is a kind of method according to range of requests video content, is divided into temporally scope and document misregistration amount model
Enclose two ways.For the video dragging according to time range, service end is needed by the way that corresponding hereof inclined is calculated
Shifting amount, user is returned data to according to offset ranges.
In the prior art, the dragging of FLV video files is usually the key frame in script markup (script tag)
(keyframes) list is realized, offset of the Key Frames List by the time of key frame and hereof corresponds
Get up, but FLV files differ and established a capital with keyframes lists.
For the FLV files of no keyframes lists, it is from first of file that existing video file, which provides method,
Data frame is traveled through one by one to last data frame positioned at end of file, searches key frame, and the key that will be found
The playing request initial time of frame and user are compared one by one, closest with the playing request initial time to determine
Document location, the original position and end position of user's needs are obtained, and video corresponding to original position to end position is literary
Number of packages evidence returns to user.It is excessive to disk pressure but processing speed to be present slow for the offer method of this video file
Problem.
To solve the above problems, video file in the embodiment of the present invention provides method, during by according to the request of user
Between calculate search original position, and with it is described search original position forwardly and rearwardly search for determine it is corresponding with the request time
The original position and end position of data frame, without traveling through whole video file to determine the original position of user's request and end
Stop bit is put, it is thus possible to improve the offer speed of video file, and can simultaneously reduce and pressure is read and write to caused by disk, carry
Rise the usage experience of user.
It is understandable to enable the above objects, features and advantages of the present invention to become apparent, below in conjunction with the accompanying drawings to the present invention
Specific embodiment be described in detail.
Fig. 1 is a kind of flow chart of video file broadcasting method in the embodiment of the present invention.Video file as shown in Figure 1
Player method, it can include:
Step S101:According to the playing request from client received, the search original position of video file is obtained.
Step S102:According to the search original position, it is determined that corresponding data frame, and will determined by the key frame
The content of corresponding video file returns to the client and played out, wherein, the video file includes more than two
Data frame.
The video file broadcasting method in the embodiment of the present invention is further described in detail below in conjunction with Fig. 2.
Fig. 2 is the flow chart of another video file offer method in the embodiment of the present invention.Video text as shown in Figure 2
Part provides method, can include:
Step S201:According to the playing request from client to video file, the information for playing start time point is obtained.
In specific implementation, the video file is FLV files.Each FLV video files have unique unified resource
Finger URL (Uniform Resource Locator, URL) corresponds to therewith.When user inputs FLV video files in a browser
During corresponding URL, client can with to corresponding server request corresponding to FLV video files.
In video display process corresponding to FLV video files, and not all user is required for from first to last watching institute
State the content of video.User can be according to the needs of itself, and since the optional position request of video file watching the FLV regards
Frequency file.Now, user only needs to drag playing progress rate button to the relevant position of playing progress bar, and client can be with to right
The server answered sends corresponding request.
Wherein, client is sent by way of sending request URL to the server for being stored with the FLV video files
Request.Wherein, the request URL that client is sent includes request and plays playing request start time point (start corresponding to scope
Parameter) and playing request end time point (end parameters) information.
In specific implementation, can use client send request URL at the beginning of between point, played as described
Begin time point, the end time point in the request URL that can also send client is as the broadcasting start time point.
Step S202:According to the total size and the information of total time for playing start time point, the FLV video files, meter
Calculate search original position.
In specific implementation, can be obtained from the file header of FLV video files FLV video files total size and it is total when
Between information.
When the total size recorded in the information for the broadcasting start time point for getting user, the file header of FLV video files
, can be to calculate search original position using formula below during with the information of total time:
P=t*M/T (1)
Wherein, P represents the search original position, and t represents the broadcasting start time point, and M represents the video file
Total size, T represents the total time of the video file.
Step S203:Judge whether the search original position is a position with data frame frame head feature, works as judgement
As a result it is when being, step S205 can directly to be performed, conversely, can then perform step S204.
In specific implementation, there is StreamID fields, for identifying in the frame head of each data frame of FLV video files
The frame head of data frame, wherein, StreamID fields are formed by the 0 of 3 bytes (24).Therefore, when identified search starting
When position has the StreamID fields that 0 that numerical value is 24 is formed, now, also it is not enough to determine the search original position just
It is the frame head of a data frame, is now only capable of as the position with data frame frame head feature.Conversely, the then search starting
Position is not the position where the frame head of a data frame.
It is to be herein pointed out the search original position being calculated, it may be possible to the beginning (frame head) of a data frame, in
Between or ending (postamble).Be to determine due to the size of each data frame, when it is determined that data frame frame header position when, should
The postamble position of data frame is just it was determined that simultaneously, the position of other data frames also determines therewith.Therefore, for subsequent step
Whether middle convenient determination data frame corresponding with the search original position, can first determine whether identified search original position
For the frame head of a data frame.
Step S204:Position skew is progressively carried out, search, which obtains one, has the position of data frame frame head characteristic value.
In an embodiment of the present invention, when it is determined that the search original position is not a position with data frame frame head feature
When putting, it can be offset forward or backward since the search original position.Wherein, when it is determined that described search for original position not
When being the position that one has data frame frame head feature, it was determined that the search original position has been positioned at a data frame
The distance of frame head may be very small, therefore, in an embodiment of the present invention, can per by way of next byte by
Walk and offset to same direction, a position with data frame frame head feature is obtained to search.Certainly, originated from the search
Position, which carries out position skew hour offset direction, to be selected according to the actual needs, such as can be to the search original position
Front is offset, and can also be offset to the rear of the search original position.
Step S205:The information of the first numerical value is obtained from the position first position with data frame frame head feature,
And judge whether first numerical value is default first default value, wherein, when judged result is to be, step can be performed
S206, conversely, then continuing position skew.
In specific implementation, the data frame of FLV video files includes three kinds of audio frame, frame of video and script frame different types
Frame.Different types of frame can be judged by the information of the numerical value stored in the frame type field in frame head.Wherein, when
The numerical value stored in frame type field represents audio frame when being 8,9 represent frame of video, and 18 represent script frame.It need to be noted that
It is that frame of video and audio frame may be collectively referred to as data frame, and script frame is then properly termed as non-data frame.
It is frame type field in the first character section of the beginning of the frame head of data frame in specific implementation, therefore, can be with
By the first position of the position with data frame frame head feature, that is, the first byte started obtains the letter of the first numerical value
Breath, judges whether first numerical value is 8 or 9, to determine first in the position with data frame frame head feature
Whether put is position where the frame type field of data frame.
Step S206:Second value letter is obtained from the second place in the position with data frame frame head feature
Breath, and a data frame sign is offset backward to the 3rd opening position from the opening position with data frame frame head feature, and from
3rd opening position obtains the information of third value, and judges whether the second value is equal to the second default value sum
The third value, when judged result for when being, step S207 can be performed, conversely, then continuing position skew.
In specific implementation, record has corresponding number in each audio frame of FLV video files and the frame head part of frame of video
According to the size of the data division of frame, the size of data recorded in the postamble of data frame is to include the frame head size sum of 11 bytes
According to the size of part, it follows that between the size of data recorded in the size of data and postamble that are recorded in the frame head of data frame
Differ the size of 11 bytes.
When the position with data frame frame head feature is the frame head of a data frame, the data obtained therefrom are big
Size of data that is small, being obtained with offseting the opening position of size of a data frame from the position with data frame frame head feature
11 bytes will be differed.Therefore, when it is determined that when equal with third value with 11 sums from second value, it may be determined that described to have
Frame where the position of data frame frame head feature is a data frame.
In specific implementation, for the accuracy of data frame determined by further improving, it is determined that to obtain one complete
During data frame, the last data frame and the frame type of latter data frame and the letter of size of data of identified data frame can be passed through
Breath, is further verified come the accuracy of the further data frame to obtaining.Specifically, the video text in the embodiment of the present invention
Part provides method, can also include:
Step S207:Judge the last data frame whether be preset kind data frame, and the last data frame
Whether the size of data recorded in frame head and the default value sum are equal with the size of data recorded in postamble.
Step S208:Judge the latter data frame whether be preset kind data frame, and the latter data frame
Whether the size of data recorded in frame head and the default value sum are equal with the size of data recorded in postamble.
It is to be herein pointed out the verification process shown in step S207 and step S208, please contrast S205~step
The introduction of appropriate section performs in S206, will not be repeated here.Meanwhile step S207 and step S208 can be present simultaneously,
One of step can be only chosen to be performed, and when step S207 and step S208 simultaneously in the presence of, the execution of the two is suitable
Sequence can also enter line translation according to the actual needs, be not limited thereto.
It is to be herein pointed out to the frame type of the last data frame of identified data frame and latter data frame and
The process that size of data is verified, actually also it is loaded with last data frame with identified data frame in advance for client
And/or the content of latter data frame, prepare for the quick video file that provides.
Step S209:When it is determined that the frame where the position with data frame frame head feature is data frame, institute is judged
State whether data frame is key frame.
In specific implementation, it is necessary to return to client from playing corresponding to initial time at the end of key frame to broadcasting
Between point corresponding to key frame content, therefore, it is determined that the frame where the position with data frame frame head feature is data
During frame, it can determine whether the data frame is key frame.
In specific implementation, the Gao Siwei of the first character section of the data division of key frame is key frame marker field, and
The numerical value of the tag field is 1.Therefore, when it is determined that during a data frame, the Data Data part of the data frame can be passed through
The numerical value of high 4 whether be 1 to determine whether the data frame is key frame.
Step S210:The information of time corresponding with the key frame is obtained from the data division of the key frame, and
Judge whether time corresponding to the key frame and the playing request start time point are consistent, when judged result is to be, hold
Row step S211;Conversely, then continue position skew.
In specific implementation, the corresponding position record of the data division of key frame has the corresponding time of the key frame
Information.When it is determined that the data frame is key frame, it not can determine that the key frame is exactly and playing request initial time pair
The key frame answered.Now, it is also necessary to the information of the corresponding time recorded according to corresponding position in key frame, to determine whether
Search for whether obtained current key frame is the corresponding key frame of playing request initial time.
In an embodiment of the present invention, when it is determined that the corresponding time recorded in the data division of the key frame broadcast with described
Put request initial time it is consistent when, then can determine the key frame be key frame corresponding with playing request initial time.
Conversely, then can according to corresponding to the acquired key frame time and the broadcasting start time point, it is determined that being forward also
It is progress position skew backward, and when must often reach at a key frame position, passes through what is recorded in the key frame that currently reaches
The information of corresponding time is corresponding with the broadcasting start time point to finally give compared with playing request start time point
Key frame.
For example, when determining that the time corresponding to the key frame be 720s, and when to play start time point be 700s, then to institute
State and enter line displacement in front of key frame.For another example, when it is determined that the time corresponding to the key frame is 720s, and the broadcasting starting determined
When time point is 800s, then enter line displacement to the rear of current key frame.Step S211:The key frame is determined to be broadcast with described
Put key frame corresponding to request initial time.
In specific implementation, when it is determined that recording in data division in the key frame determined according to the search original position
When the information of corresponding time is consistent with the playing request start time point, it may be determined that the key frame is to be played with described
Begin key frame corresponding to time point.
Step S212:From the key frame corresponding with playing request initial time carry out backward position offset to obtain with from
Key frame corresponding to the playing request end time obtained in playing request.
In specific implementation, when obtaining key frame corresponding with the playing request start time point, from the key
Frame is offset frame by frame backward, corresponding crucial with the playing request end time point for obtaining with being obtained from the playing request time
Frame.
Step S213:By the key frame corresponding with playing request initial time to the playing request end time pair
Video file content corresponding to the key frame answered returns to client and played out.
In specific implementation, key frame corresponding to the playing request start time point to the playing request end time
The content of the video file of key frame, is the content for needing to return to the video file of client corresponding to point.At this point it is possible to
By regarding for key frame corresponding to key frame corresponding to the playing request start time point to the playing request end time point
The content of frequency file is back to client and played out.
By above-mentioned introduction, the video file broadcasting method in the embodiment of the present invention, detecting that user drags
During to request play start time point, at least only need to cache the content of a data frame, at most also only need to cache several numbers
According to the content of frame, ask to play the video text of initial time corresponding data frame without being buffered to user since video file
The content of part, it is thus possible to improve the speed that video file provides, while the read-write pressure of disk can be reduced.
In specific implementation, after the step S206 that is finished, step S207, S208 can not also be performed, and it is direct
Step S209~S213 is performed, with the content for the video file asked to client rapid feedback.
It is referring to the drawings, corresponding to the above method to more fully understand those skilled in the art and realizing the present invention
Video file provide device described in detail by specific embodiment.
Fig. 3 shows that a kind of video file in the embodiment of the present invention provides the structural representation of device.As shown in Figure 3
Video file provides device 300, can include receiving unit 301, acquiring unit 302 and provide unit 303, wherein:
Receiving unit 301, suitable for receiving the playing request from client.
Acquiring unit 302, suitable for according to the playing request, obtaining the search original position of video file.
In specific implementation, the video file is FLV files.
In specific implementation, the acquiring unit 302 is suitable to obtain the request broadcasting starting from the playing request
At time point, the total time of the video file and the information of total size are obtained from the file header of the video file;Using institute
State the total size for playing start time point and the video file product divided by the video file obtain total time it is described
Search for original position.
Unit 303 is provided, suitable for according to the search original position, it is determined that corresponding data frame, and by identified institute
The content for stating video file corresponding to data frame returns to the client and played out, and the video file includes two or more
Data frame.
In specific implementation, the offer unit 303 is suitable to when the determination search original position does not have data frame frame
During head feature, position skew is proceeded by from the search original position, obtaining one with search has data frame frame head feature
Position;The information of the first numerical value is obtained from the first position of the position with data frame frame head feature;When it is determined that described
When first numerical value is the first default value, second is obtained from the second place in the position with data frame frame head feature
The information of numerical value, and the 3rd opening position is reached from the size of one data frame of position skew with data frame frame head feature,
The information of third value is obtained from the 3rd opening position;When it is determined that the second value and the second default value sum are equal to institute
When stating third value, it is determined that the frame where the position with data frame frame head feature is data frame;Judge the data frame
Whether it is key frame;When judging the data frame for key frame, judge that the time corresponding to the key frame plays with described
Whether time point beginning is consistent;When it is determined that the time corresponding to the key frame is consistent with the broadcasting start time point, institute is determined
It is key frame corresponding with the playing request initial time to state key frame;From described corresponding with the playing request initial time
Data frame start to carry out the playing request end time that position offsets to obtain with obtain from the playing request backward it is corresponding
Key frame, and by the end of key frame corresponding to the playing request start time point of the playing request to the playing request
Between the content of video file corresponding to key frame corresponding to point return to client and play out.
In specific implementation, the offer unit 303 be further adapted for when determine the second value and the second default value it
During with equal to the third value, the frame type and data recorded in the frame head of the last data frame of the data frame is obtained respectively
The information of the size of data recorded in size, and postamble;When the frame type in the frame head according to the last data frame determines
The last data frame be the preset kind data frame, and the size of data recorded in the frame head of the last data frame with
The default value sum, when equal with the size of data recorded in postamble, when determining that the data frame originates for the search
Between corresponding data frame.
In specific implementation, the offer unit 303 be further adapted for when determine the second value and the second default value it
During with equal to the third value, the frame type and data recorded in the frame head of the latter data frame of the data frame is obtained respectively
The information of the size of data recorded in size, and postamble;When frame type determines institute in the frame head according to the latter data frame
State the data frame that latter data frame is the preset kind, and the size of data recorded in the frame head of the latter data frame and institute
Default value sum is stated, when equal with the size of data recorded in postamble, determines that the data frame is and the request time pair
The data frame answered.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can
To instruct the hardware of correlation to complete by program, the program can be stored in computer-readable recording medium, and storage is situated between
Matter can include:ROM, RAM, disk or CD etc..
The method and system of the embodiment of the present invention are had been described in detail above, the present invention is not limited thereto.Any
Art personnel, without departing from the spirit and scope of the present invention, it can make various changes or modifications, therefore the guarantor of the present invention
Shield scope should be defined by claim limited range.
Claims (8)
1. a kind of video file provides method, it is characterised in that including:
According to the playing request from client received, the search original position of video file is obtained, including:Broadcast from described
Put and the request broadcasting start time point is obtained in request, the video file is obtained from the file header of the video file
Total time and the information of total size;Using product of the broadcasting start time point with the total size of the video file divided by institute
That states video file obtains the search original position total time;
According to the search original position, it is determined that corresponding data frame, and will determined by video text corresponding to the data frame
The content of part returns to the client and played out, including:When it is determined that the search original position does not have data frame frame head
During feature, position skew is proceeded by from the search original position, obtaining one with search has the position of data frame frame head feature
Put;The information of the first numerical value is obtained from the first position of the position with data frame frame head feature;When it is determined that described
When one numerical value is the first default value, the second number is obtained from the second place in the position with data frame frame head feature
The information of value, and the 3rd opening position is reached from the size of one data frame of position skew with data frame frame head feature, from
3rd opening position obtains the information of third value;When it is determined that the second value and the second default value sum be equal to it is described
During third value, it is determined that the frame where the position with data frame frame head feature is data frame;Judging the data frame is
No is key frame;When judging the data frame for key frame, judge that the time corresponding to the key frame originates with described play
Whether time point is consistent;When it is determined that the time corresponding to the key frame is consistent with the broadcasting start time point, it is determined that described
Key frame is key frame corresponding with the playing request initial time;From described corresponding with the playing request initial time
Data frame starts to carry out the playing request end time that position offsets to obtain with obtain from the playing request backward corresponding
Key frame;By key frame corresponding to the playing request start time point of the playing request to the playing request end time point
The content of video file returns to client and played out corresponding to corresponding key frame;Wherein, the video file includes two
Frame more than individual.
2. video file according to claim 1 provides method, it is characterised in that when it is determined that the second value and second
When default value sum is equal to the third value, in addition to:
Obtain and remember in the frame type and size of data, and postamble recorded in the frame head of the last data frame of the data frame respectively
The information of the size of data of record;
When the frame type in the frame head according to the last data frame determines the number that the last data frame is the preset kind
According to frame, and the size of data recorded in the frame head of the last data frame and the default value sum, with being recorded in postamble
When size of data is equal, determine the data frame for data frame corresponding to the search initial time.
3. video file according to claim 1 or 2 provides method, it is characterised in that when in the frame head of the data frame
The size of data of record and default value sum, when equal with the size of data recorded in the postamble of the data frame, in addition to:
Obtain and remember in the frame type and size of data, and postamble recorded in the frame head of the latter data frame of the data frame respectively
The information of the size of data of record;
When frame type determines data of the latter data frame for the preset kind in the frame head according to the latter data frame
Frame, and the size of data recorded in the frame head of the latter data frame and the default value sum, with the number recorded in postamble
According to it is equal in magnitude when, it is data frame corresponding with the request time to determine the data frame.
4. video file according to claim 1 provides method, it is characterised in that the video file is FLV files.
5. a kind of video file provides device, it is characterised in that including:
Receiving unit, suitable for receiving the playing request from client;
Acquiring unit, suitable for according to the playing request, obtaining the search original position of video file, including:Suitable for from described
The request is obtained in playing request and plays start time point, the video file is obtained from the file header of the video file
Total time and total size information;Using the total size of broadcasting start time point and the video file product divided by
Obtain the search original position total time of the video file;
Unit is provided, suitable for according to the search original position, it is determined that corresponding data frame, and will determined by the data frame
The content of corresponding video file returns to the client and played out, including:Suitable for when the determination search original position
During without data frame frame head feature, position skew is proceeded by from the search original position, obtaining one with search has number
According to the position of frame frame head feature;The letter of the first numerical value is obtained from the first position of the position with data frame frame head feature
Breath;When it is determined that first numerical value is the first default value, second from the position with data frame frame head feature
Opening position obtain second value information, and from it is described with data frame frame head feature position skew one data frame size to
Up to the 3rd opening position, from the information of the 3rd opening position acquisition third value;When it is determined that the second value and second is preset
When numerical value sum is equal to the third value, it is determined that the frame where the position with data frame frame head feature is data frame;
Judge whether the data frame is key frame;When judging the data frame for key frame, when judging corresponding to the key frame
Between with it is described broadcasting start time point it is whether consistent;When it is determined that time corresponding to the key frame and the broadcasting start time point
When consistent, it is key frame corresponding with the playing request initial time to determine the key frame;Asked from described with the broadcasting
Ask data frame corresponding to initial time start to carry out backward position offsets to obtain please with the broadcasting obtained from the playing request
Seek key frame corresponding to the end time, and by key frame corresponding to the playing request start time point of the playing request to described
The content of video file corresponding to key frame returns to client and played out corresponding to playing request end time point;Wherein,
The video file includes more than two key frames.
6. video file according to claim 5 provides device, it is characterised in that the offer unit is further adapted for when determination
When the second value and the second default value sum are equal to the third value, the last data of the data frame is obtained respectively
The information of the size of data recorded in the frame type and size of data, and postamble that are recorded in the frame head of frame;When according to before described
Frame type in the frame head of one data frame determines the data frame that the last data frame is the preset kind, and the previous number
According to the size of data that is recorded in the frame head of frame and the default value sum, when equal with the size of data recorded in postamble, really
The fixed data frame is data frame corresponding to the search initial time.
7. the video file according to claim 5 or 6 provides device, it is characterised in that the offer unit is further adapted for working as
When determining that the second value and the second default value sum are equal to the third value, the latter of the data frame is obtained respectively
The information of the size of data recorded in the frame type and size of data, and postamble that are recorded in the frame head of data frame;When according to institute
The data frame that frame type in the frame head of latter data frame determines that the latter data frame is the preset kind is stated, and it is described latter
The size of data recorded in the frame head of data frame and the default value sum, when equal with the size of data recorded in postamble,
It is data frame corresponding with the request time to determine the data frame.
8. video file according to claim 5 provides device, it is characterised in that the video file is FLV files.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510373553.6A CN104994433B (en) | 2015-06-30 | 2015-06-30 | Video file provides method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510373553.6A CN104994433B (en) | 2015-06-30 | 2015-06-30 | Video file provides method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104994433A CN104994433A (en) | 2015-10-21 |
CN104994433B true CN104994433B (en) | 2017-12-26 |
Family
ID=54306171
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510373553.6A Active CN104994433B (en) | 2015-06-30 | 2015-06-30 | Video file provides method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104994433B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105979350B (en) * | 2016-05-05 | 2019-03-08 | 联发科技(新加坡)私人有限公司 | A kind of method and related device of play position that searching for played file |
CN106095910B (en) * | 2016-06-08 | 2018-01-19 | 广东欧珀移动通信有限公司 | Label information analytic method, device and the terminal of a kind of audio file |
CN109714299B (en) * | 2017-10-26 | 2022-01-11 | 创盛视联数码科技(北京)有限公司 | Method for playing encrypted video |
CN110460790A (en) * | 2018-05-02 | 2019-11-15 | 北京视联动力国际信息技术有限公司 | A kind of abstracting method and device of video frame |
CN110113655B (en) * | 2019-05-05 | 2021-09-21 | 北京奇艺世纪科技有限公司 | Video playing method and device and user terminal |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101110247A (en) * | 2007-08-17 | 2008-01-23 | 华为技术有限公司 | Playing method for audio files and device thereof |
CN101415069A (en) * | 2008-10-22 | 2009-04-22 | 清华大学 | Server and method for sending on-line play video |
CN102137302A (en) * | 2010-12-09 | 2011-07-27 | 华为技术有限公司 | Method and device for playing video contents of streaming media |
CN104394474A (en) * | 2014-11-25 | 2015-03-04 | 苏州航天系统工程有限公司 | Stream media quick locating on-demand playing method |
-
2015
- 2015-06-30 CN CN201510373553.6A patent/CN104994433B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101110247A (en) * | 2007-08-17 | 2008-01-23 | 华为技术有限公司 | Playing method for audio files and device thereof |
CN101415069A (en) * | 2008-10-22 | 2009-04-22 | 清华大学 | Server and method for sending on-line play video |
CN102137302A (en) * | 2010-12-09 | 2011-07-27 | 华为技术有限公司 | Method and device for playing video contents of streaming media |
CN104394474A (en) * | 2014-11-25 | 2015-03-04 | 苏州航天系统工程有限公司 | Stream media quick locating on-demand playing method |
Also Published As
Publication number | Publication date |
---|---|
CN104994433A (en) | 2015-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104994433B (en) | Video file provides method and device | |
US9866887B2 (en) | Auto video preview within a digital magazine | |
JP5144838B1 (en) | Information processing apparatus, information processing method, and program | |
CN111512635B (en) | Method and system for selectively skipping media content | |
US11922968B2 (en) | Audio processing for detecting occurrences of loud sound characterized by brief audio bursts | |
EP3096324A1 (en) | Multi-track playback of media content during repetitive motion activities | |
CN112753227A (en) | Audio processing for detecting the occurrence of crowd noise in a sporting event television program | |
JP2002543709A5 (en) | ||
CN103491450A (en) | Setting method of playback fragment of media stream and terminal | |
CN118175365A (en) | Generating video presentations for accompanying audio | |
WO2017096948A1 (en) | Video positioning method and device | |
US10999391B2 (en) | Dynamic filtering and amelioration of content stream manifests | |
CN104683858B (en) | A kind of method for previewing and device of the content of Streaming Media | |
US20160119661A1 (en) | On-Demand Metadata Insertion into Single-Stream Content | |
RU2016135051A (en) | METHOD FOR SUBMITTING DIGITAL MULTIMEDIA CONTENT AND DEVICE | |
CN105979387A (en) | Video clip display method and system | |
CN105451098A (en) | Method and device for providing multimedia file | |
CN113923473A (en) | Video and audio playing method and device, electronic equipment and storage medium | |
CN104104895B (en) | Method for carrying out video playback on video data and hard-disk video recorder | |
JP6678167B2 (en) | Method and apparatus for determining media information associated with data stored on a storage device | |
CN111723235B (en) | Music content identification method, device and equipment | |
JP5300296B2 (en) | Display device, server device, system, and display method | |
CN112601129A (en) | Video interaction system, method and receiving end | |
JP2021533405A (en) | Audio processing to extract variable length decomposed segments from audiovisual content | |
KR20160088804A (en) | Video data file generation program, video data file generation method and video data file generation 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 | ||
GR01 | Patent grant |