Summary of the invention
The invention provides a kind of video file processing method based on HTML5 and device, in order to realize the object that video server side is shared.
The invention provides a kind of video file processing method based on HTML5, be applied to client, comprise:
Determine fingerprint and the video length of local video file to be uploaded;
The address of this locality pointed to by HTML5 control is adjusted to the address of default server, sends the request of searching video file, carry fingerprint and the video length of video file in described request to server;
Consistent but the video length of the video file of client of the fingerprint matching that reception server returns is less than the feedback information of the video length of the video file of server;
Calculate the head fingerprint of head video-frequency band of local video document measured length and the afterbody fingerprint of the afterbody video-frequency band of designated length respectively;
Head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.
In an embodiment of the present invention, described method also comprises:
The fingerprint of video file is sent to server as the filename of video file.
The invention provides a kind of video file processing method based on HTML5, be applied to server, comprise:
Receive the request of searching video file from client, in described request, carry fingerprint and the video length of video file;
The fingerprint of the fingerprint of the video file of the client received with local video file is mated;
When fingerprint matching is consistent, the video length of the video length of the video file of client with local video file is mated;
When the video length of the video file of client is less than the video length of local video file, send to client the feedback information that the consistent but video length of the video file of client of fingerprint matching is less than the video length of the video file of server;
Receive the head fingerprint of head video-frequency band of designated length and the afterbody fingerprint of the afterbody video-frequency band of designated length in the video file of client;
Determine head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint, and delete the video data in the consistent video file of local fingerprint matching before head video-frequency band and after afterbody video-frequency band.
In an embodiment of the present invention, describedly determine head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint, comprising:
Video file consistent for local fingerprint matching is carried out burst according to designated length, obtains multiple video-frequency band, and calculate the fingerprint of each video-frequency band;
According to the fingerprint of each video-frequency band, determine head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint.
In an embodiment of the present invention, described the video length of the video length of the video file of client with local video file to be mated, comprising:
Judge whether the video length of the video file of client is less than the video length of local video file.
Present invention also offers a kind of video file processing unit based on HTML5, be applied to client, comprise:
First determination module, for determining fingerprint and the video length of local video file to be uploaded;
Request sending module, the address for this locality pointed to by HTML5 control is adjusted to the address of default server, sends the request of searching video file, carry fingerprint and the video length of video file in described request to server;
Feedback information receiver module, the consistent but video length of the video file of client of the fingerprint matching returned for reception server is less than the feedback information of the video length of the video file of server;
Computing module, for the afterbody fingerprint of the afterbody video-frequency band of the head fingerprint and designated length that calculate the head video-frequency band of local video document measured length respectively;
Fingerprint sending module, for head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.
In an embodiment of the present invention, described request sending module also for:
The fingerprint of video file is sent to server as the filename of video file.
Present invention also offers a kind of video file processing unit based on HTML5, be applied to server, comprise:
Request receiving module, for receiving the request of searching video file from client, carries fingerprint and the video length of video file in described request;
First matching module, the fingerprint for the video file by the client received mates with the fingerprint of local video file;
Second matching module, for when fingerprint matching is consistent, mates the video length of the video length of the video file of client with local video file;
Feedback information sending module, when video length for the video file when client is less than the video length of local video file, send to client the feedback information that the consistent but video length of the video file of client of fingerprint matching is less than the video length of the video file of server;
Fingerprint receiver module, for receive client video file in the head fingerprint of head video-frequency band of designated length and the afterbody fingerprint of the afterbody video-frequency band of designated length;
Second determination module, for determining head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint;
Removing module, for deleting the video data in the consistent video file of local fingerprint matching before head video-frequency band and after afterbody video-frequency band.
In an embodiment of the present invention, described second determination module also for:
Video file consistent for local fingerprint matching is carried out burst according to designated length, obtains multiple video-frequency band, and calculate the fingerprint of each video-frequency band;
According to the fingerprint of each video-frequency band, determine head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint.
In an embodiment of the present invention, described second matching module also for:
Judge whether the video length of the video file of client is less than the video length of local video file.
Some beneficial effects of the embodiment of the present invention can comprise:
In the embodiment of the present invention, client determines fingerprint and the video length of local video file to be uploaded, the address of this locality pointed to by HTML5 control is subsequently adjusted to the address of default server, and then the request of searching video file is sent to server, carry fingerprint and the video length of video file in this request.Afterwards, when receiving fingerprint matching that server returns and be consistent but the video length of the video file of client being less than the feedback information of the video length of the video file of server, calculate the head fingerprint of head video-frequency band of local video document measured length and the afterbody fingerprint of the afterbody video-frequency band of designated length respectively, head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.Thus, present invention achieves the object that video server side is shared.And, when server return fingerprint matching consistent but the video length of the video file of client is less than the feedback information of the video length of the video file of server time, head fingerprint and afterbody fingerprint are sent to server by client, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band, without the need to client again to server uploaded videos file, save data resource.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from specification, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in write specification, claims and accompanying drawing and obtain.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Embodiment
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein is only for instruction and explanation of the present invention, is not intended to limit the present invention.
Figure 1 shows that in one embodiment of the invention the flow chart of the video file processing method based on HTML5 being applied to client, the method comprises the following steps S11-S15:
Step S11, determines fingerprint and the video length of local video file to be uploaded.
In this step, the fingerprint of video file is as informative abstract MD5 value, secure Hash SHA1 value etc., and the fingerprint of video file has uniqueness, when having done any change to video file, its fingerprint all can change, thus the fingerprint of video file can be utilized to prevent video file to be tampered.
Step S12, the address of this locality pointed to by HTML5 control is adjusted to the address of default server, sends the request of searching video file, carry fingerprint and the video length of video file in this request to server.
Step S13, the consistent but video length of the video file of client of the fingerprint matching that reception server returns is less than the feedback information of the video length of the video file of server.
Step S14, calculates the head fingerprint of head video-frequency band of local video document measured length and the afterbody fingerprint of the afterbody video-frequency band of designated length respectively.
Such as, the head fingerprint of 50M video-frequency band and the afterbody fingerprint of last 50M video-frequency band before in local video file is calculated.Certainly, exemplifying herein is only schematic, does not limit the present invention.
Step S15, head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.
In the embodiment of the present invention, client determines fingerprint and the video length of local video file to be uploaded, the address of this locality pointed to by HTML5 control is subsequently adjusted to the address of default server, and then the request of searching video file is sent to server, carry fingerprint and the video length of video file in this request.Afterwards, when receiving fingerprint matching that server returns and be consistent but the video length of the video file of client being less than the feedback information of the video length of the video file of server, calculate the head fingerprint of head video-frequency band of local video document measured length and the afterbody fingerprint of the afterbody video-frequency band of designated length respectively, head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.Thus, present invention achieves the object that video server side is shared.And, when server return fingerprint matching consistent but the video length of the video file of client is less than the feedback information of the video length of the video file of server time, head fingerprint and afterbody fingerprint are sent to server by client, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band, without the need to client again to server uploaded videos file, save data resource.
Further, the fingerprint of video file can be sent to server as the filename of video file.
Accordingly, Figure 2 shows that in one embodiment of the invention the flow chart of the video file processing method based on HTML5 being applied to server, the method comprises the following steps S21-S26:
Step S21, receives the request of searching video file from client, carries fingerprint and the video length of video file in this request.
Step S22, mates the fingerprint of the fingerprint of the video file of the client received with local video file.
Step S23, when fingerprint matching is consistent, mates the video length of the video length of the video file of client with local video file.
In this step, when being mated with the video length of local video file by the video length of the video file of client, can judge whether the video length of the video file of client is less than the video length of local video file.
Step S24, when the video length of the video file of client is less than the video length of local video file, send to client the feedback information that the consistent but video length of the video file of client of fingerprint matching is less than the video length of the video file of server.
Step S25, receives the head fingerprint of head video-frequency band of designated length and the afterbody fingerprint of the afterbody video-frequency band of designated length in the video file of client.
Step S26, determine head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint, and delete the video data in the consistent video file of local fingerprint matching before head video-frequency band and after afterbody video-frequency band.
In this embodiment, when server return fingerprint matching consistent but the video length of the video file of client is less than the feedback information of the video length of the video file of server time, head fingerprint and afterbody fingerprint are sent to server by client, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band, without the need to client again to server uploaded videos file, save data resource.
In a preferred embodiment, step S26 may be embodied as following steps A1-A2 above:
Steps A 1, carries out burst by video file consistent for local fingerprint matching according to designated length, obtains multiple video-frequency band, and calculates the fingerprint of each video-frequency band.
Steps A 2, according to the fingerprint of each video-frequency band, determines head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint.
In this embodiment, because the fingerprint of video-frequency band is unique, can prevent from being tampered, thus improve the accuracy of coupling.
Corresponding to the video file processing method based on HTML5 being applied to client in above-described embodiment, the present invention also provides a kind of video file processing unit based on HTML5 being applied to client.Be illustrated in figure 3 in one embodiment of the invention the structural representation of the video file processing unit based on HTML5 being applied to client, comprise:
First determination module 31, for determining fingerprint and the video length of local video file to be uploaded;
Request sending module 32, the address for this locality pointed to by HTML5 control is adjusted to the address of default server, sends the request of searching video file, carry fingerprint and the video length of video file in request to server;
Feedback information receiver module 33, the consistent but video length of the video file of client of the fingerprint matching returned for reception server is less than the feedback information of the video length of the video file of server;
Computing module 34, for the afterbody fingerprint of the afterbody video-frequency band of the head fingerprint and designated length that calculate the head video-frequency band of local video document measured length respectively;
Fingerprint sending module 35, for head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.
The said apparatus of the embodiment of the present invention: client determines fingerprint and the video length of local video file to be uploaded, the address of this locality pointed to by HTML5 control is subsequently adjusted to the address of default server, and then the request of searching video file is sent to server, carry fingerprint and the video length of video file in this request.Afterwards, when receiving fingerprint matching that server returns and be consistent but the video length of the video file of client being less than the feedback information of the video length of the video file of server, calculate the head fingerprint of head video-frequency band of local video document measured length and the afterbody fingerprint of the afterbody video-frequency band of designated length respectively, head fingerprint and afterbody fingerprint are sent to server, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band.Thus, present invention achieves the object that video server side is shared.And, when server return fingerprint matching consistent but the video length of the video file of client is less than the feedback information of the video length of the video file of server time, head fingerprint and afterbody fingerprint are sent to server by client, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band, without the need to client again to server uploaded videos file, save data resource.
In an embodiment of the present invention, above-mentioned request sending module 32 also for:
The fingerprint of video file is sent to server as the filename of video file.
Corresponding to the video file processing method based on HTML5 being applied to server in above-described embodiment, the present invention also provides a kind of video file processing unit based on HTML5 being applied to server.Be illustrated in figure 4 in one embodiment of the invention the structural representation of the video file processing unit based on HTML5 being applied to server, comprise:
Request receiving module 41, for receiving the request of searching video file from client, carries fingerprint and the video length of video file in request;
First matching module 42, the fingerprint for the video file by the client received mates with the fingerprint of local video file;
Second matching module 43, for when fingerprint matching is consistent, mates the video length of the video length of the video file of client with local video file;
Feedback information sending module 44, when video length for the video file when client is less than the video length of local video file, send to client the feedback information that the consistent but video length of the video file of client of fingerprint matching is less than the video length of the video file of server;
Fingerprint receiver module 45, for receive client video file in the head fingerprint of head video-frequency band of designated length and the afterbody fingerprint of the afterbody video-frequency band of designated length;
Second determination module 46, for determining head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint;
Removing module 47, for deleting the video data in the consistent video file of local fingerprint matching before head video-frequency band and after afterbody video-frequency band.
In an embodiment of the present invention, above-mentioned second determination module 46 also for:
Video file consistent for local fingerprint matching is carried out burst according to designated length, obtains multiple video-frequency band, and calculate the fingerprint of each video-frequency band;
According to the fingerprint of each video-frequency band, determine head video-frequency band corresponding with head fingerprint in the video file that local fingerprint matching is consistent and afterbody video-frequency band corresponding to afterbody fingerprint.
In an embodiment of the present invention, above-mentioned second matching module 43 also for:
Judge whether the video length of the video file of client is less than the video length of local video file.
The said apparatus of the embodiment of the present invention: server returns to client the feedback information that the consistent but video length of the video file of client of fingerprint matching is less than the video length of the video file of server, head fingerprint and afterbody fingerprint are sent to server by client, thus the head video-frequency band corresponding with head fingerprint and afterbody video-frequency band corresponding to afterbody fingerprint in the consistent video file of the fingerprint matching of server determination server side, and the video data in the consistent video file of the fingerprint matching of deleting server side before head video-frequency band and after afterbody video-frequency band, without the need to client again to server uploaded videos file, save data resource.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store and optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.