CN107943849A - The search method and device of video file - Google Patents

The search method and device of video file Download PDF

Info

Publication number
CN107943849A
CN107943849A CN201711068816.8A CN201711068816A CN107943849A CN 107943849 A CN107943849 A CN 107943849A CN 201711068816 A CN201711068816 A CN 201711068816A CN 107943849 A CN107943849 A CN 107943849A
Authority
CN
China
Prior art keywords
video
default
index database
video segment
video file
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.)
Granted
Application number
CN201711068816.8A
Other languages
Chinese (zh)
Other versions
CN107943849B (en
Inventor
梁希云
秦锋剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Green Bay Network Technology Co., Ltd.
Original Assignee
Grass Count Language (beijing) Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Grass Count Language (beijing) Technology Co Ltd filed Critical Grass Count Language (beijing) Technology Co Ltd
Priority to CN201711068816.8A priority Critical patent/CN107943849B/en
Publication of CN107943849A publication Critical patent/CN107943849A/en
Application granted granted Critical
Publication of CN107943849B publication Critical patent/CN107943849B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/783Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/7837Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using objects detected or recognised in the video content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Library & Information Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses the search method and device of video file, wherein, this method includes:Sampled by carrying out at least one wheel to video file to be retrieved, if all Sample Video fragments of last round of sampling are in default index database, it fails to match, then slide a frame and carry out next round sampling, until at least one Sample Video fragment of a certain wheel successful match in default index database, then complete search is carried out in default index database to whole video segments of video file to be retrieved, or slided still retrieval failure after enough numbers, then it represents that the video file not matched in index database with video to be retrieved.This method, which can quickly determine, whether there is matched retrieval result in default index database, substantially increase recall precision.

Description

The search method and device of video file
Technical field
The present invention relates to the search method and device in data retrieval technology field, more particularly to a kind of video file.
Background technology
With the development of video network, there are more and more video files to need to manage and retrieve in network at present.Video The retrieval of file is that matched video segment is found from substantial amounts of video resource.Relatively common video file retrieval method has Content based video retrieval system, video frequency searching based on lens technology etc., however, the retrieval efficiency ratio of current search method Relatively low, therefore, how to improve the detection efficiency of video file becomes technical problem urgently to be resolved hurrily.
The content of the invention
The purpose of the present invention is intended to solve one of above-mentioned technical problem at least to a certain extent.
For this reason, first purpose of the present invention is to propose a kind of search method of video file, by to be retrieved Video file carries out at least one wheel sampling, is lost if all Sample Video fragments of last round of sampling match in default index database Lose, then slide a frame and carry out next round sampling, until at least one Sample Video fragment of a certain wheel is in default index database With success, complete search then is carried out in default index database to whole video segments of video file to be retrieved, or Still retrieval failed after sliding enough numbers, then it represents that the video text not matched in index database with video to be retrieved Part.This method, which can quickly determine, whether there is matched retrieval result in default index database, substantially increase recall precision.
Second object of the present invention is the retrieval device for proposing a kind of video file.
Third object of the present invention is to propose a kind of computer equipment.
Fourth object of the present invention is to propose a kind of computer-readable recording medium.
To achieve these goals, the search method of the video file of first aspect present invention embodiment, including:
1 frame is added to judge current sample start frame and first time as current sample start frame last time sampling start frame Whether the frame number difference between sampling start frame, which reaches default, is slided frame number;
If judging result is no, according to default sampling prescription from the current sample start frame to video file to be retrieved It is sampled, obtains at least one Sample Video fragment;
It whether there is at least one and default video segment of the Sample Video fragment match in the default index database of inquiry, The default index database includes default video segment;
If in the presence of using current sample start frame as segmentation start frame, according to preset rules to the video text to be retrieved Part is segmented, and obtains whole video segments of video file to be retrieved;
Inquire about in the default index database and whether there is and the matched default video segment of the video segment;
It will be determined as the retrieval result to video file to be retrieved with the matched default video segment of the video segment.
Method as described above, the frame number between the judgement current sample start frame and for the first time sampling start frame are poor After whether reaching default slip frame number, further include:
If the determination result is YES, determining video file to be retrieved, it fails to match in the default index database.
Method as described above, with the presence or absence of at least one and Sample Video piece in the default index database of the inquiry After the matched default video segment of section, further include:
If being not present, return to execution and last time sampling start frame is added into 1 frame as the step of current sample start frame.
Method as described above, the default index database include the correspondence of feature coding and default video file;
With the presence or absence of at least one and pre- setting video of the Sample Video fragment match in the default index database of inquiry Fragment, including:
The feature coding of each Sample Video fragment is obtained respectively;
Inquired about in the default index database and whether there is according to the correspondence of the feature coding and default video file At least one and default video segment of the Sample Video fragment match.
Method as described above, the inquiry are preset to whether there is in index database and are regarded with matched preset of the video segment Frequency fragment, including:
The corresponding feature coding of each video segment is obtained respectively;
It whether there is and institute according in the default index database of the correspondence of the feature coding and default video file inquiry State the matched default video segment of video segment.
Method as described above, the feature coding for obtaining each Sample Video fragment respectively, including:
Obtain the feature coding of each Sample Video fragment respectively using hash signature algorithm;
And/or the corresponding feature coding of each video segment that obtains respectively includes:
The corresponding feature coding of each video segment is obtained respectively using the hash signature algorithm.
Method as described above, further includes:
Obtain at least one default video file;
At least one default video file is segmented respectively corresponding pre- to obtain the default video file Setting video fragment;
The default index database is created according to the default video segment.
Method as described above, it is described that the default index database is created according to the default video segment, including:
Obtain the feature coding of the default video segment;
Establish the correspondence of feature coding and default video segment;
The default index database is established according to the correspondence.
Method as described above, after the default index database according to the default video segment establishment, is also wrapped Include:
Obtain the corresponding video segment of video file to be put in storage;
Inquire about in the default index database and matched with the presence or absence of video segment corresponding with the video file to be put in storage Default video segment;
If in the presence of according to the matched default video segment of video segment corresponding with the video file to be put in storage to institute Video file to be put in storage is stated to be segmented again;
The default index database is updated according to the corresponding video segment of the acquired video file to be put in storage of segmentation again.
To achieve these goals, the retrieval device of the video file of second aspect of the present invention embodiment, including:
Computing module, for last time sampling start frame to be added 1 frame as current sample start frame;
Judgment module, for judging whether the frame number difference between current sample start frame and for the first time sampling start frame reaches It is default to slide frame number;
First processing module, if being no for judging result, according to default sampling prescription from the current sample start frame Video file to be retrieved is sampled, obtains at least one Sample Video fragment;
First enquiry module, for inquiring about in default index database with the presence or absence of at least one and Sample Video fragment The default video segment matched somebody with somebody, the default index database include default video segment;
Second processing module, if in the presence of using current sample start frame as segmentation start frame, according to preset rules to institute State video file to be retrieved to be segmented, obtain whole video segments of video file to be retrieved;
Second enquiry module, for inquiring about in the default index database with the presence or absence of matched default with the video segment Video segment;
Determining module, for will be determined as with the matched default video segment of the video segment to video text to be retrieved The retrieval result of part.
To achieve these goals, the computer equipment of third aspect present invention embodiment, including:Processor and storage Device;
Wherein, the processor by read the executable program code stored in the memory run with it is described can The corresponding program of executive program code, for realizing the search method of the video file described in first aspect.
To achieve these goals, the computer-readable recording medium of fourth aspect present invention embodiment, is stored thereon with Computer program, the computer program realize the search method of the video file described in first aspect when being executed by processor.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and it is readily appreciated that, wherein,
Fig. 1 is the flow chart of the search method of the video file of one embodiment of the invention;
Fig. 2 is the flow chart of the search method of the video file of further embodiment of this invention;
Fig. 3 is the flow chart of the search method of the video file of another embodiment of the present invention;
Fig. 4 is the structure diagram of the retrieval device of the video file of one embodiment of the invention;
Fig. 5 is the structure diagram of the computer equipment of one embodiment of the invention.
Embodiment
The embodiment of the present invention is described below in detail, the example of embodiment is shown in the drawings, wherein identical from beginning to end Or similar label represents same or similar element or has the function of same or like element.Retouched below with reference to attached drawing The embodiment stated is exemplary, it is intended to for explaining the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings the search method and device of the video file of the embodiment of the present invention are described.
Fig. 1 is the flow chart of the search method of the video file of one embodiment of the invention.The video file of the present embodiment Search method is performed by the retrieval device of video file, which can integrate in the server.
As shown in Figure 1, the search method of the video file of the present embodiment, comprises the following steps:
S101, using last time sampling start frame add 1 frame as current sample start frame, judges current sample start frame and the Whether the frame number difference between single sample start frame, which reaches default, is slided frame number, if judging result is no, performs step S102, if Judging result is yes, performs step S107.
For example, to one 2 it is small when video file when, the video file is per second including 30 frames, if by continuous 5 seconds altogether The data for counting 150 frames are a video segment, then, one 2 it is small when video file can be divided into 2*60*60/5=1440 A video segment.When need to this 2 it is small when video file retrieve when, conventional method be to 1440 video segments by One retrieval, retrieval amount is big and recall precision is low.
And the way of the present embodiment is that the video segment of part is extracted from 1440 video segments, such as, from the first frame Start, continuous extraction amounts to 150 frames for 5 seconds as first video segment, then takes be used as the again within 5 seconds every 10 minutes Two video segments, and so on, one 2 it is small when file extract 12 video segments altogether, then primary retrieval only needs pair 12 video segments are retrieved, and 1440 whole video segments need to be retrieved one by one compared to primary retrieval, retrieval amount is obvious Reduction, recall precision is high.
In the present embodiment, more wheel sampling can be carried out to video file to be retrieved according to sequencing, can also be same When more wheel sampling are carried out to video file to be retrieved, be not particularly limited herein.
Carry out more wheel sampling under briefly introducing herein to video file to be retrieved according to sequencing:First, with video Sampling start frame of first frame of file as the first round, continuous extraction amount to 150 frames for 5 seconds as first piece of video Section, then takes be used as second video segment within 5 seconds again every 10 minutes, and so on, then can be from sampling in the first round One 2 it is small when file extract 12 video segments altogether.Then, the sampling start frame of the first round is added into 1 frame as the second wheel Sampling start frame, that is to say, that a frame is slided since the sampling start frame of the first round, determines the sampling start frame of the second wheel For the second frame, continuous extraction amounts to 150 frames for 5 seconds as first video segment, then takes make again within 5 seconds every 10 minutes For second video segment, and so on, in the second wheel sampling then can from one 2 it is small when file extract 12 altogether and regard Frequency fragment.And so on, 149 frames are slided altogether, are sampled 150 times, and sampling, which is all arrived, every time takes 12 video segments, it is noted that this In slide 149 times after, if slided again once, sample and the video segment extracted and sample for the first time the piece of video extracted Section is consistent, and then can realize covering sampling comprehensively.
The present embodiment determines the sampling start frame of each round by sliding frame, may insure at least by repeatedly sliding frame The sampling start frame for having a wheel can make the start frame of video file to be retrieved and the video file in default index database align, Solves the problems, such as retrieval failure caused by not aliging due to start frame well.
In the present embodiment, the frequency in sampling that video file to be retrieved is sampled is limited be subject to the default frame number that slides System.For example, to the video segment of 150 frames, comprehensive covering can be realized by sampling 150 times.If having carried out 150 sampling, Still neither one Sample Video fragment does not match in default index database, then illustrates video file to be retrieved default It fails to match in index database, i.e., there is no any one video segment in default index database to match with video file to be retrieved, At this moment, no longer it is sampled, the matching result sampled again is identical with appointing the matching result of single sample in 150 times, does not anticipate Justice.
Therefore, the present embodiment first judges whether current sample reaches the upper limit before sample search.Specifically, by working as Whether the frame number difference between preceding sampling start frame and start frame of sampling with first time, which reaches default, is slided frame number to judge currently to take out Whether sample reaches the upper limit.For example, to the video segment of 150 frames, sampling start frame (the i.e. sampling starting for the first time of the first round Frame) slide 149 frames obtain the 150th wheel sampling start frame, the 150th wheel sampling start frame for last wheel sampling starting Frame, the 151st sampling start frame are just identical with the sampling start frame of the first round.If current sample start frame with sampling for the first time Frame number difference between beginning frame is less than 150 frames, then illustrates to be not up to the upper limit to the frequency in sampling of file to be retrieved, if being equal to or greatly In 150 frames, illustrate to reach the upper limit to the frequency in sampling of file to be retrieved.In the present embodiment, preset and slide frame number and video The selection of fragment is related, if it is a video segment that continuous 5s, which amounts to 150 frames, it is 150 frames to preset and slide frame number, if continuously It is a video segment that 10s, which amounts to 300 frames, then it is 300 frames to preset and slide frame number.
And for carrying out more wheel sampling to video file to be retrieved at the same time, flow with according to sequencing to be retrieved Video file carries out more wheel sampling, and it is that more wheel sampling are parallel at the same time simply to carry out more wheel sampling to video file to be retrieved at the same time Carry out, can realize that more wheel sampling the time it takes are identical with single sample the time it takes by Clustering.
For example, if 12 Sample Video fragments of first round sampling do not have successful match in default index database, The second wheel sampling is carried out, 12 Sample Video fragments of the second wheel sampling are matched in default index database, and so on, Until in 12 Sample Video fragments of a certain wheel sampling, there are pre- setting video in a Sample Video fragment and default index database Fragment match.
If S102, judging result are no, to be retrieved is regarded from the current sample start frame according to default sampling prescription Frequency file is sampled, and obtains at least one Sample Video fragment, performs step S103.
For example, sample to the first round, since the first frame, continuous extraction amounts to 150 frames for 5 seconds as one first Video segment, then every 10 minutes take again 5 seconds be used as second video segment, and so on, one 2 it is small when file exist 12 video segments are extracted altogether in first round sampling.And so on, the sampling start frame of the second wheel is since the second frame, even Continuous extraction amounts to 150 frames for 5 seconds as first video segment, then takes 5 seconds again as second every 10 minutes and regards Frequency fragment, and so on, one 2 it is small when file second wheel sampling in extract 12 video segments altogether.
With the presence or absence of at least one and pre- setting video of the Sample Video fragment match in S103, the default index database of inquiry Fragment, the default index database include default video segment, if in the presence of, step S104 is performed, if being not present, return execution step S101。
Specifically, created in default index database, such as default index database and stored according to the video resource of magnanimity in advance The default video segment of magnanimity.
Conventional method is that totally 1440 video segments carry out one by one in default index database by 2 video files when small Retrieval, that is, need to carry out 1440 retrievals, just can determine that and whether there is matched video segment in default index database.
Exemplified by more wheel sampling are carried out to video file to be retrieved according to sequencing, and the way of the present embodiment be by 12 Sample Video fragments of first round sampling are retrieved in default index database, that is, need to carry out 12 retrievals, if first Take turns in 12 Sample Video fragments of sampling and matched there are a Sample Video fragment with presetting video segment in default index database, Then by 2 it is small when totally 1440 video segments matched in default index database, while no longer carry out next round sampling.If the There is no a Sample Video fragment with presetting video segment in default index database in 12 Sample Video fragments of one wheel sampling Matching, then, return to step S101 carries out the second wheel sampling, judges whether deposited in 12 Sample Video fragments of the second wheel sampling Matched in a Sample Video fragment with presetting video segment in default index database, as long as 12 Sample Videos of a certain wheel sampling Matched in fragment there are a Sample Video fragment with presetting video segment in default index database, then no longer carry out next round pumping Sample.
If S104, in the presence of, using current sample start frame as segmentation start frame, described to be retrieved is regarded according to preset rules Frequency file is segmented, and obtains whole video segments of video file to be retrieved, performs step S105.
Whether there is in S105, the inquiry default index database with the matched default video segment of the video segment, hold Row step S106.
S106, will be determined as retrieval to video file to be retrieved with the matched default video segment of the video segment As a result.
Specifically, if there are a sampling in determining 12 Sample Video fragments that a certain wheel is sampled in step s 103 Video segment is matched with presetting video segment in default index database, then illustrates exist in default index database and video to be retrieved text The matched video segment of part, at this moment, the present embodiment can obtain all videos fragment of video file to be retrieved, in default index Inquired about one by one in storehouse, when 2 is small exemplified by the video file to be retrieved of totally 1440 video segments, by 2 videos when small Retrieved one by one in default index database by totally 1440 video segments for file, is determined matched whole in default index database Default video segment, the whole default video segments matched are then the retrieval results of video file to be retrieved.
In the present embodiment, only Sample Video fragment matches in default index database, just can be to the complete of video file Portion's video segment is retrieved, and the quantity of the Sample Video fragment the sampled accounting in whole video segments, utilizes pumping The Sample Video fragment that sample obtains be sampled in default index database retrieval can quickly determine in default index database whether There are matched retrieval result, recall precision is substantially increased.
If step S107, judging result is, determining video file to be retrieved, it fails to match in default index database.
For example, to the video segment of 150 frames, comprehensive covering can be realized by sampling 150 times.If carry out 150 times sampling, still neither one Sample Video fragment preset index database in match, then illustrate video to be retrieved It fails to match in default index database for file, at this moment, is no longer sampled, the matching result sampled again with it is any in 150 times The matching result of secondary sampling is identical, nonsensical.Specifically, if between current sample start frame and for the first time sampling start frame Frame number difference is equal to or more than default slip frame number, illustrates to reach the upper limit to the frequency in sampling of file to be retrieved.At this moment, it is believed that treat It fails to match in default index database for the video file of retrieval, i.e., there is no any one video segment with treating in default index database The video file matching of retrieval.
The search method of video file provided in this embodiment, is taken out by carrying out at least one wheel to video file to be retrieved Sample, if all Sample Video fragments of last round of sampling are in default index database, it fails to match, slides a frame and carries out next round Sampling, until at least one Sample Video fragment of a certain wheel successful match in default index database, then regards to be retrieved Whole video segments of frequency file carry out complete search in default index database, or are still retrieved after sliding enough frame numbers Failure, then it represents that the video file not matched in default index database with video to be retrieved.This method can be rapidly true Surely it whether there is matched retrieval result in default index database, substantially increase recall precision.
Fig. 2 is the flow chart of the search method of the video file of further embodiment of this invention.On the basis of above-described embodiment On, " with the presence or absence of at least one and default video segment of the Sample Video fragment match in the default index database of inquiry " Possible implementation " to obtain the feature coding of each Sample Video fragment respectively;According to the feature coding with The correspondence of default video file is inquired about in the default index database with the presence or absence of at least one and Sample Video fragment Matched default video segment." and/or, " it whether there is in the default index database of inquiry matched pre- with the video segment The possible implementation of setting video fragment " is " to obtain the corresponding feature coding of each video segment respectively;According to described Feature coding is matched with the video segment with whether there is in the default index database of correspondence inquiry of default video file Default video segment.”
As shown in Fig. 2, the search method of the video file of the present embodiment, comprises the following steps:
S201, using last time sampling start frame add 1 frame as current sample start frame, judges current sample start frame and the Whether the frame number difference between single sample start frame, which reaches default, is slided frame number, if judging result is no, performs step S202, if Judging result is yes, performs step S207.
If S202, judging result are no, to be retrieved is regarded from the current sample start frame according to default sampling prescription Frequency file is sampled, and obtains at least one Sample Video fragment, performs step S203.
The implementation of step S201, S202 in the present embodiment and step S101, the S102 realization side of above-described embodiment Formula is identical, and details are not described herein.
S203, the feature coding for obtaining each Sample Video fragment respectively, regard according to the feature coding with default The correspondence of frequency fragment is inquired about in the default index database with the presence or absence of at least one and the Sample Video fragment match Default video segment, if in the presence of, step S204 is performed, if being not present, return execution step S201.
Specifically, presetting index database includes the correspondence of feature coding and default video file, i.e., is compiled according to feature The correspondence of code and default video segment creates default index database.Alternatively, compiled using Inverted Index Technique and according to feature The correspondence of code and default video segment creates default index database.
For example, the present embodiment can carry out feature coding using Hash (Hash) signature algorithm to video segment, This, can be considered as a word by the feature coding obtained by Hash (Hash) signature algorithm, preset the visual storage word of index database With the dictionary of the correspondence of video segment, the retrieval of video file is so treated, becomes the query word in dictionary, retrieval is more Add simple and convenient.Therefore the present embodiment need to obtain the feature coding of each Sample Video fragment, then according to feature coding with presetting With the presence or absence of at least one pre- with the Sample Video fragment match in the default index database of correspondence inquiry of video segment Setting video fragment.
Hash (Hash) signature algorithm is briefly introduced herein, also referred to as digital digest method (Digital Digest) or number Word fingerprint technique (Digital Finger Print), its by using individual event Hash functions will need encrypted plaintext " summary " into The ciphertext of a string of regular lengths (128), this string of ciphertexts are also known as digital finger-print, it has fixed length, and different For summary into ciphertext, its result is always different in plain text, and same plaintext its summary must be consistent.For this reason, the present embodiment can be with Video segment can be converted into the feature coding of digital finger-print form by Hash (Hash) signature algorithm.
It is pointed out that be not limited to obtain video segment feature coding and feature based coding with preset video segment Correspondence create default index database.For example can also be and feature recognition is carried out to video segment, obtain the pass of video segment Key feature, the correspondence based on key feature and default video segment create index database.
If S204, in the presence of, using current sample start frame as segmentation start frame, described to be retrieved is regarded according to preset rules Frequency file is segmented, and obtains whole video segments of video file to be retrieved, performs step S205.
S205, obtain the corresponding feature coding of each video segment respectively, is regarded according to the feature coding with default It whether there is and the matched default video segment of the video segment, execution in the default index database of correspondence inquiry of frequency file Step S206.
For example, the present embodiment can carry out feature coding using Hash (Hash) signature algorithm to video segment, This, can be considered as a word by the feature coding obtained by Hash (Hash) signature algorithm, preset the visual storage word of index database With the dictionary of the correspondence of video segment, the retrieval of video file is so treated, becomes the query word in dictionary, retrieval is more Add simple and convenient.Therefore the present embodiment need to obtain the corresponding feature coding of each video segment, then, according to feature coding and in advance It whether there is and the matched default video segment of video segment in the default index database of correspondence inquiry of setting video file.
S206, will be determined as retrieval to video file to be retrieved with the matched default video segment of the video segment As a result.
If S107, judging result are to determine video file to be retrieved it fails to match in default index database.
The implementation of step S206, S207 in the present embodiment and step S106, the S107 realization side of above-described embodiment Formula is identical, and details are not described herein.
The search method of video file provided in this embodiment, by using such as Hash (Hash) signature algorithm to video Fragment carries out feature coding, and obtained feature coding can be considered a word, and default index database visual one is stored with word and video The dictionary of the correspondence of fragment, the so retrieval to video file, become the query word in dictionary, also can be considered and are transformed into It is similar to scan in a search engine, retrieve simpler convenience.
Fig. 3 is the flow chart of the search method of the video file of another embodiment of the present invention.On the basis of above-described embodiment On, the present embodiment illustrates the establishment for presetting index database.
As shown in figure 3, the search method of the video file of the present embodiment, comprises the following steps:
S301, obtain at least one default video file.
S302, be respectively segmented at least one default video file to obtain the default video file correspondence Default video segment.
For example, default video file can be understood as the video file of known relevant information.To one 2 it is small when it is pre- Setting video file, the default video file is per second including 30 frames, if being a piece of video by the continuous 5 seconds data for amounting to 150 frames Section, then, one 2 it is small when default video file can be divided into 2*60*60/5=1440 video segment.
S303, according to the default video segment create the default index database.
For example, the default video file of magnanimity corresponds to the default video segment of magnanimity, according to the pre- setting video of magnanimity Fragment can create sample size and greatly preset index database, easy to the retrieval of follow-up video resource.
In a kind of possible implementation, the specific implementation of step S303 is:Obtain the default video segment Feature coding;Establish the correspondence of feature coding and default video segment;Established according to the correspondence described default Index database.
Specifically, by carrying out feature coding to default video segment, at this moment, default video segment can be considered as one Word, correspondingly, default video file can be considered the document being made of one group of word.In the present embodiment, by establishing feature coding Default index database is created with the correspondence of default video segment, it is follow-up only by the feature coding of video file to be retrieved pre- If being inquired about in index database, the retrieval to video file can be completed, similar to scanning in a search engine, method letter Single, recall precision is high.
Further, after step S303, can also comprise the following steps:
S304, obtain the corresponding video segment of video file to be put in storage.
It whether there is video segment corresponding with the video file to be put in storage in S305, the inquiry default index database Matched default video segment.
Specifically, to be put in storage the video file in default index database, first inquire about and whether there is in default index database The matched default video segment of video segment corresponding with the video file to be put in storage, if being not present, according to step S301 Method to step S303 is put in storage.
If S306, in the presence of according to the matched default piece of video of video segment corresponding with the video file to be put in storage Section is segmented the video file to be put in storage again.
S307, the corresponding video segment of the video file to be put in storage according to acquired in segmentation again update the default rope Draw storehouse.
Specifically, if being inquired in default index database in the presence of video segment corresponding with the video file to be put in storage The default video segment matched somebody with somebody, then be segmented the video file again.For example, to one 2 it is small when default video file first Secondary segmentation, is segmented since the first frame, and the default video file is per second including 30 frames, if by the continuous 5 seconds data for amounting to 150 frames For a video segment, then, one 2 it is small when default video file can be divided into 2*60*60/5=1440 piece of video Section.If by inquiry, there are matching default video segment in default index database for the 3rd section of video segment.So, by Video file to be put in storage is divided into by i.e. the 301st frame of start frame in three sections of video segments again as start frame is segmented again 1440 video segments, by 1440 video segments storage into default index database to update default index database, so as to protect The reliability of the default index database of card, it is ensured that the reliability of video resource retrieval is carried out using default index database.
Fig. 4 is the structure diagram of the retrieval device of the video file of one embodiment of the invention.
As shown in figure 4, the retrieval device of the video file of the present embodiment, including:
Computing module 01, for last time sampling start frame to be added 1 frame as current sample start frame;
Judgment module 02, for judging whether the frame number difference between current sample start frame and for the first time sampling start frame reaches To default slip frame number;
First processing module 03, if being no for judging result, originates according to default sampling prescription from the current sample Frame is sampled video file to be retrieved, obtains at least one Sample Video fragment;
First enquiry module 04, for inquiring about in default index database with the presence or absence of at least one and Sample Video fragment Matched default video segment, the default index database include default video segment;
Second processing module 05, if in the presence of using current sample start frame as segmentation start frame, according to preset rules pair The video file to be retrieved is segmented, and obtains whole video segments of video file to be retrieved;
Second enquiry module 06, for inquiring about in the default index database with the presence or absence of matched pre- with the video segment Setting video fragment;
Determining module 07, for will be determined as with the matched default video segment of the video segment to video to be retrieved The retrieval result of file.
Further, the default index database includes the correspondence of feature coding and default video file, and described One enquiry module, the feature coding specifically for obtaining each Sample Video fragment respectively;According to the feature coding with The correspondence of default video file is inquired about in the default index database with the presence or absence of at least one and Sample Video fragment Matched default video segment.
Second enquiry module, specifically for obtaining the corresponding feature coding of each video segment respectively;According to The feature coding in the default index database of correspondence inquiry of default video file with whether there is and the video segment The default video segment matched somebody with somebody.
Further, further include:Creation module;
The creation module, specifically for obtaining at least one default video file;Respectively at least one described default Video file is segmented to obtain the corresponding default video segment of the default video file;According to the default video segment Create the default index database.
Device in this present embodiment is closed, wherein modules perform the concrete mode of operation in related this method It is described in detail in embodiment, explanation will be not set forth in detail herein.
The retrieval device of video file provided in this embodiment, is taken out by carrying out at least one wheel to video file to be retrieved Sample, if all Sample Video fragments of last round of sampling are in default index database, it fails to match, slides a frame and carries out next round Sampling, until at least one Sample Video fragment of a certain wheel successful match in default index database, then regards to be retrieved Whole video segments of frequency file carry out complete search in default index database, or are still retrieved after sliding enough numbers Failure, then it represents that the video file not matched in index database with video to be retrieved.The device can quickly determine pre- If whether there is matched retrieval result in index database, recall precision is substantially increased.
In order to achieve the above object, the embodiment of the present invention also proposed a kind of computer equipment.
Fig. 5 is the structure diagram of the computer equipment of one embodiment of the invention.
As shown in figure 5, the computer equipment includes:Memory 11, processor 12 and it is stored on memory 11 and can be The computer program run on processor 12.
Processor 12 realized when performing described program Fig. 1 to Fig. 3 it is any shown in embodiment in the video file that provides Search method.
Further, computer equipment further includes:
Communication interface 13, for the communication between memory 11 and processor 12.
Memory 11, for storing the computer program that can be run on the processor 12.
Memory 11 may include high-speed RAM memory, it is also possible to further include nonvolatile memory (non-volatile Memory), a for example, at least magnetic disk storage.
Processor 12, for performing described program when, realize the video file that is provided in the embodiment shown in Fig. 1 to Fig. 3 Search method.
If memory 11, processor 12 and the independent realization of communication interface 13, communication interface 13, memory 11 and processing Device 12 can be connected with each other by bus and complete mutual communication.The bus can be industry standard architecture (Industry Standard Architecture, abbreviation ISA) bus, external equipment interconnection (Peripheral Component Interconnect, abbreviation PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The bus can be divided into address bus, data/address bus, control Bus etc..For ease of representing, only represented in Fig. 5 with a thick line, it is not intended that an only bus or a type of total Line.
Alternatively, in specific implementation, if memory 11, processor 12 and communication interface 13, are integrated in chip piece Upper realization, then memory 11, processor 12 and communication interface 13 can complete mutual communication by internal interface.
Processor 12 can be a central processing unit (Central Processing Unit, abbreviation CPU), either Specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), or be arranged to Implement one or more integrated circuits of the embodiment of the present invention.
In order to achieve the above object, the embodiment of the present application also proposed a kind of computer-readable recording medium, meter is stored thereon with Calculation machine program, realizes the video text such as realized and provided in any shown embodiments of Fig. 1 to Fig. 3 when which is executed by processor The search method of part.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description Point is contained at least one embodiment of the present invention or example.In the present specification, schematic expression of the above terms is not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office Combined in an appropriate manner in one or more embodiments or example.In addition, without conflicting with each other, the skill of this area Art personnel can be tied the different embodiments or example described in this specification and different embodiments or exemplary feature Close and combine.
In addition, term " first ", " second " are only used for description purpose, and it is not intended that instruction or hint relative importance Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, " multiple " are meant that at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process or method described otherwise above description in flow chart or herein is construed as, and represents to include Module, fragment or the portion of the code of the executable instruction of one or more the step of being used for realization custom logic function or process Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable Sequence, including according to involved function by it is basic at the same time in the way of or in the opposite order, carry out perform function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass Defeated program is for instruction execution system, device or equipment or the dress used with reference to these instruction execution systems, device or equipment Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring Connecting portion (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can be for example by carrying out optical scanner to paper or other media, then into edlin, interpretation or if necessary with it His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, software that multiple steps or method can be performed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware with another embodiment, following skill well known in the art can be used Any one of art or their combination are realized:With the logic gates for realizing logic function to data-signal from Logic circuit is dissipated, the application-specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries Suddenly it is that relevant hardware can be instructed to complete by program, the program can be stored in a kind of computer-readable storage medium In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can also That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, can also be realized in the form of software function module.The integrated module is such as Fruit is realized in the form of software function module and as independent production marketing or in use, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although have been shown and retouch above The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention System, those of ordinary skill in the art can be changed above-described embodiment, change, replace and become within the scope of the invention Type.

Claims (12)

  1. A kind of 1. search method of video file, it is characterised in that including:
    1 frame is added to judge current sample start frame with sampling for the first time as current sample start frame last time sampling start frame Whether the frame number difference between start frame, which reaches default, is slided frame number;
    If judging result is no, video file to be retrieved is carried out from the current sample start frame according to default sampling prescription Sampling, obtains at least one Sample Video fragment;
    It is described with the presence or absence of at least one and default video segment of the Sample Video fragment match in the default index database of inquiry Default index database includes default video segment;
    If in the presence of, using current sample start frame as segmentation start frame, according to preset rules to the video file to be retrieved into Row segmentation, obtains whole video segments of video file to be retrieved;
    Inquire about in the default index database and whether there is and the matched default video segment of the video segment;
    It will be determined as the retrieval result to video file to be retrieved with the matched default video segment of the video segment.
  2. 2. the method as described in claim 1, it is characterised in that in the judgement current sample start frame with sampling for the first time After whether the frame number difference between beginning frame reaches default slip frame number, further include:
    If the determination result is YES, determining video file to be retrieved, it fails to match in the default index database.
  3. 3. the method as described in claim 1, it is characterised in that with the presence or absence of at least one in the default index database of the inquiry After the default video segment of the Sample Video fragment match, further include:
    If being not present, return to execution and last time sampling start frame is added into 1 frame as the step of current sample start frame.
  4. 4. the method as described in claim 1, it is characterised in that the default index database includes feature coding and pre- setting video The correspondence of file;
    It whether there is at least one and default video segment of the Sample Video fragment match in the default index database of inquiry, Including:
    The feature coding of each Sample Video fragment is obtained respectively;
    Inquired about according to the correspondence of the feature coding and default video file in the default index database with the presence or absence of at least One with the default video segment of the Sample Video fragment match.
  5. 5. method as claimed in claim 4, it is characterised in that whether there is and the video in the default index database of inquiry The default video segment of fragment match, including:
    The corresponding feature coding of each video segment is obtained respectively;
    Regarded according to the feature coding with whether there is in the default index database of correspondence inquiry of default video file with described The default video segment of frequency fragment match.
  6. 6. method as claimed in claim 5, it is characterised in that the feature for obtaining each Sample Video fragment respectively Coding, including:
    Obtain the feature coding of each Sample Video fragment respectively using hash signature algorithm;
    And/or the corresponding feature coding of each video segment that obtains respectively includes:
    The corresponding feature coding of each video segment is obtained respectively using the hash signature algorithm.
  7. 7. the method as described in claim 1, it is characterised in that further include:
    Obtain at least one default video file;
    At least one default video file is segmented respectively and is regarded with obtaining corresponding preset of the default video file Frequency fragment;
    The default index database is created according to the default video segment.
  8. 8. the method for claim 7, it is characterised in that described that the default rope is created according to the default video segment Draw storehouse, including:
    Obtain the feature coding of the default video segment;
    Establish the correspondence of feature coding and default video segment;
    The default index database is established according to the correspondence.
  9. 9. the method for claim 7, it is characterised in that described preset is created according to the default video segment described After index database, further include:
    Obtain the corresponding video segment of video file to be put in storage;
    Inquire about matched pre- with the presence or absence of video segment corresponding with the video file to be put in storage in the default index database Setting video fragment;
    If in the presence of being treated according to the matched default video segment of video segment corresponding with the video file to be put in storage to described The video file of storage is segmented again;
    The default index database is updated according to the corresponding video segment of the acquired video file to be put in storage of segmentation again.
  10. A kind of 10. retrieval device of video file, it is characterised in that including:
    Computing module, for last time sampling start frame to be added 1 frame as current sample start frame;
    Judgment module, for judging whether the frame number difference between current sample start frame and for the first time sampling start frame reaches default Slide frame number;
    First processing module, if being no for judging result, is treated according to default sampling prescription from the current sample start frame The video file of retrieval is sampled, and obtains at least one Sample Video fragment;
    First enquiry module, for inquiring about in default index database with the presence or absence of at least one and the Sample Video fragment match Default video segment, the default index database include default video segment;
    Second processing module, if in the presence of, using current sample start frame as segmentation start frame, treated according to preset rules to described The video file of retrieval is segmented, and obtains whole video segments of video file to be retrieved;
    Second enquiry module, whether there is and the matched pre- setting video of the video segment for inquiring about in the default index database Fragment;
    Determining module, for will be determined as with the matched default video segment of the video segment to video file to be retrieved Retrieval result.
  11. A kind of 11. computer equipment, it is characterised in that including:Processor and memory;
    Wherein, the processor can perform by reading the executable program code stored in the memory to run with described The corresponding program of program code, for realizing the search method of video file as claimed in any one of claims 1-9 wherein.
  12. 12. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the computer program quilt Processor realizes the search method of video file as claimed in any one of claims 1-9 wherein when performing.
CN201711068816.8A 2017-11-03 2017-11-03 Video file retrieval method and device Active CN107943849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711068816.8A CN107943849B (en) 2017-11-03 2017-11-03 Video file retrieval method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711068816.8A CN107943849B (en) 2017-11-03 2017-11-03 Video file retrieval method and device

Publications (2)

Publication Number Publication Date
CN107943849A true CN107943849A (en) 2018-04-20
CN107943849B CN107943849B (en) 2020-05-08

Family

ID=61933267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711068816.8A Active CN107943849B (en) 2017-11-03 2017-11-03 Video file retrieval method and device

Country Status (1)

Country Link
CN (1) CN107943849B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522996A (en) * 2020-04-09 2020-08-11 北京百度网讯科技有限公司 Video clip retrieval method and device
CN113065025A (en) * 2021-03-31 2021-07-02 厦门美图之家科技有限公司 Video duplicate checking method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1605211A (en) * 2001-12-21 2005-04-06 皇家飞利浦电子股份有限公司 Method and apparatus for motion compensated temporal interpolation of video sequences
CN1940926A (en) * 2006-03-15 2007-04-04 中国人民大学 Efficient musical database query method based on humming
US20100128789A1 (en) * 2007-05-07 2010-05-27 Joel Sole Method and apparatus for processing video sequences
CN101840435A (en) * 2010-05-14 2010-09-22 中兴通讯股份有限公司 Method and mobile terminal for realizing video preview and retrieval
CN101894251A (en) * 2009-05-21 2010-11-24 国家广播电影电视总局广播科学研究院 Video detection method and device
CN101950366A (en) * 2010-09-10 2011-01-19 北京大学 Method for detecting and identifying station logo
CN103188564A (en) * 2011-12-28 2013-07-03 联想(北京)有限公司 Electronic equipment and information processing method thereof
CN103514293A (en) * 2013-10-09 2014-01-15 北京中科模识科技有限公司 Method for video matching in video template library
CN106599789A (en) * 2016-07-29 2017-04-26 北京市商汤科技开发有限公司 Video class identification method and device, data processing device and electronic device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1605211A (en) * 2001-12-21 2005-04-06 皇家飞利浦电子股份有限公司 Method and apparatus for motion compensated temporal interpolation of video sequences
CN1940926A (en) * 2006-03-15 2007-04-04 中国人民大学 Efficient musical database query method based on humming
US20100128789A1 (en) * 2007-05-07 2010-05-27 Joel Sole Method and apparatus for processing video sequences
CN101894251A (en) * 2009-05-21 2010-11-24 国家广播电影电视总局广播科学研究院 Video detection method and device
CN101840435A (en) * 2010-05-14 2010-09-22 中兴通讯股份有限公司 Method and mobile terminal for realizing video preview and retrieval
CN101950366A (en) * 2010-09-10 2011-01-19 北京大学 Method for detecting and identifying station logo
CN103188564A (en) * 2011-12-28 2013-07-03 联想(北京)有限公司 Electronic equipment and information processing method thereof
CN103514293A (en) * 2013-10-09 2014-01-15 北京中科模识科技有限公司 Method for video matching in video template library
CN106599789A (en) * 2016-07-29 2017-04-26 北京市商汤科技开发有限公司 Video class identification method and device, data processing device and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
边步梅: "视频数据存储与检索方法的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522996A (en) * 2020-04-09 2020-08-11 北京百度网讯科技有限公司 Video clip retrieval method and device
US11625433B2 (en) 2020-04-09 2023-04-11 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for searching video segment, device, and medium
CN111522996B (en) * 2020-04-09 2023-09-08 北京百度网讯科技有限公司 Video clip retrieval method and device
CN113065025A (en) * 2021-03-31 2021-07-02 厦门美图之家科技有限公司 Video duplicate checking method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN107943849B (en) 2020-05-08

Similar Documents

Publication Publication Date Title
US8577155B2 (en) System and method for duplicate text recognition
CN110489415B (en) Data updating method and related equipment
CN106294798A (en) A kind of images share method based on thumbnail and terminal
CN102148805B (en) Feature matching method and device
CN108021558A (en) Keyword recognition method and device, electronic equipment and storage medium
CN109144954A (en) Edit resource recommendation method, device and the electronic equipment of document
CN106156755A (en) Similarity calculating method in a kind of recognition of face and system
US11494403B2 (en) Method and apparatus for storing off-chain data
CN107291949A (en) Information search method and device
CN104123280A (en) File comparison method and device
CN107807989A (en) Small documents processing method and processing device
CN107943849A (en) The search method and device of video file
CN107704520A (en) Multifile search method and apparatus based on recognition of face
JP6343081B1 (en) Recording medium recording code code classification search software
CN108985289A (en) Messy code detection method and device
CN116226681B (en) Text similarity judging method and device, computer equipment and storage medium
CN112926647A (en) Model training method, domain name detection method and device
CN107748801A (en) News recommends method, apparatus, terminal device and computer-readable recording medium
CN105847516A (en) Method and device for managing contact person information
CN110377819A (en) Arbitrator's recommended method, device and computer equipment based on big data
CN107169065B (en) Method and device for removing specific content
CN110796129A (en) Text line region detection method and device
US20190377975A1 (en) Suspect duplicate processing through a feedback-driven learning process
US11347928B2 (en) Detecting and processing sections spanning processed document partitions
CN108182127A (en) A kind of method, terminal device and storage medium for extracting deleted document fragment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20190903

Address after: 100192 Dongsheng Science Park, Zhongguancun, 66 Xixiaokou Road, Haidian District, Beijing

Applicant after: Green Bay Network Technology Co., Ltd.

Address before: 100089 Beijing Haidian District Xixiaokou Road 66 Zhongguancun Dongsheng Science Park B-6 Building B 5 floors

Applicant before: Grass count language (Beijing) Technology Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant