Multimedia resource takes out frame method, device, server and storage medium

文档序号:1744969 发布日期:2019-11-26 浏览:23次 中文

阅读说明:本技术 多媒体资源抽帧方法、装置、服务器及存储介质 (Multimedia resource takes out frame method, device, server and storage medium ) 是由 张扩建 李伟 余建 吴少勇 于 2019-08-23 设计创作,主要内容包括:本公开公开了一种多媒体资源抽帧方法、装置、服务器及存储介质,属于多媒体技术领域。所述方法包括:查询指定数据库中是否存储有指定视频帧集合,指定视频帧集合应用于对指定多媒体资源进行检测的不同检测场景中;当存储有指定视频帧集合,将指定视频帧集合发送至终端;当未存储有指定视频帧集合,生成指定视频帧集合并发送至终端。本公开在接收到抽帧请求时,查询指定数据库中是否存指定视频帧集合,在存储时直接获取,在未存储时生成该指定视频帧集合,进而将该指定视频帧集合发送至终端。由于指定视频帧集合能够应用于对指定多媒体资源进行检测的不同检测场景,因而无需针对不同的检测场景分别进行抽帧处理,减小了计算资源和存储资源的消耗。(The present disclosure discloses a kind of multimedia resources to take out frame method, device, server and storage medium, belongs to multimedia technology field.The described method includes: whether being stored with designated frame set in inquiry specified database, designated frame set is applied in the different detection scenes detected to specified multimedia resource;When being stored with designated frame set, designated frame set is sent to terminal;There is designated frame set when not stored, generates designated frame set and be sent to terminal.The disclosure inquires in specified database whether deposit designated frame set when receiving pumping frame request, directly acquires in storage, the designated frame set is generated when not stored, and then the designated frame set is sent to terminal.Since designated frame set can be applied to the different detection scenes detected to specified multimedia resource, because reducing the consumption of computing resource and storage resource without carrying out taking out frame processing respectively for different detection scenes.)

1. a kind of multimedia resource takes out frame method, which is characterized in that the described method includes:

When the pumping frame to specified multimedia resource for receiving the transmission of terminal used in specified services is requested, specified number is inquired According to whether being stored with designated frame set in library, the designated frame set be applied to the specified multimedia resource into In the different detection scenes of row detection, the designated frame set includes extracting at least from the specified multimedia resource One video frame;

When being stored with the designated frame set in the specified database, the designated frame set is sent to described Terminal;

There is the designated frame set when not stored in the specified database, generates the designated frame set, and will The designated frame set is sent to the terminal.

2. the method according to claim 1, wherein described generate the designated frame set, comprising:

The video metamessage of the specified multimedia resource is obtained, the video metamessage is used to indicate the specified multimedia money The attribute information in source;

According to the video metamessage, the pumping frame parameter for take out to the specified multimedia resource frame is determined;

According to the pumping frame parameter, pumping frame is carried out to the specified multimedia resource, obtains the designated frame set.

3. according to the method described in claim 2, determination is to the finger it is characterized in that, described according to the video metamessage Determine the pumping frame parameter that multimedia resource take out frame, comprising:

From the video metamessage, the video length and video frame sum of the specified multimedia resource are obtained;

According to the video length and preset duration of the specified multimedia resource, the pumping frame plan of the specified multimedia resource is determined Slightly;

According to the video frame of specified multimedia resource sum and preset quantity, the pumping frame of the specified multimedia resource is determined Quantity;

Wherein, described to take out the video length that frame parameter includes the specified multimedia resource, pumping number of frames and take out frame strategy.

4. according to the method described in claim 3, it is characterized in that, the video length according to the specified multimedia resource And preset duration, determine the pumping frame strategy of the specified multimedia resource, comprising:

When the video length of the specified multimedia resource is greater than the preset duration, determine the pumpings frame strategy for every first Period extracts a video frame;

When the video length of the specified multimedia resource is less than the preset duration, determine the pumpings frame strategy for every second Period extracts a video frame;

The video frame sum and preset quantity according to the specified multimedia resource, determines the specified multimedia resource Take out number of frames, comprising:

When the video frame sum of the specified multimedia resource is greater than preset quantity, determine the pumpings number of frames for the first quantity;

When the video frame sum of the specified multimedia resource is less than preset quantity, determine the pumpings number of frames for the second quantity;

Wherein, the first time period is greater than the second time period, and first quantity is greater than second quantity.

5. according to the method described in claim 3, specifying more matchmakers to described it is characterized in that, described according to the pumping frame parameter Body resource carries out pumping frame, obtains the designated frame set, comprising:

Video frame identical with the pumping number of frames is extracted from the specified multimedia resource according to the pumping frame strategy;

Resource identification is arranged in each video frame to be extracted;

Each video frame is stored with corresponding resource identification into the designated frame set.

6. the method according to claim 1, wherein described be sent to the end for the designated frame set End, comprising:

According to the required video frame quantity of the specified services and type, chosen from the designated frame set with it is described Video frame quantity and at least one corresponding target video frame of type;

At least one described target video frame is sent to the terminal.

7. method according to any one of claim 1 to 6, which is characterized in that the method also includes:

The resource identification that each video frame in the designated frame set is calculated using hash algorithm, obtains the designated The cryptographic Hash of each video frame in frame set;

The Hamming distance in the designated frame set between the cryptographic Hash of two adjacent video frames is calculated frame by frame;

If the Hamming distance between any video frame and the cryptographic Hash of adjacent video frames is less than pre-determined distance, by the video frame It is deleted from the designated frame set.

8. a kind of multimedia resource takes out frame device, which is characterized in that described device includes:

Enquiry module, for being requested when the pumping frame to specified multimedia resource for receiving the transmission of terminal used in specified services When, it inquires in specified database and whether is stored with designated frame set, the designated frame set is applied to the finger Determine in the different detection scenes that multimedia resource is detected, the designated frame set includes providing from the specified multimedia At least one video frame extracted in source;

Sending module is stored with the designated frame set for working as in the specified database, by the designated frame Set is sent to the terminal;

Gather generation module, for having the designated frame set when not stored in the specified database, generates the finger Determine sets of video frames, and the designated frame set is sent to the terminal.

9. a kind of server, which is characterized in that the server includes processor and memory, be stored in the memory to Few an instruction, at least a Duan Chengxu, code set or instruction set, it is at least one instruction, an at least Duan Chengxu, described Code set or described instruction collection are loaded as the processor and are executed more as described in any one of claims 1 to 7 to realize Media resource takes out frame method.

10. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, extremely in the storage medium A few Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or described Instruction set is loaded as processor and is executed to realize that the multimedia resource as described in any one of claims 1 to 7 takes out frame method.

Technical field

This disclosure relates to multimedia technology field, in particular to a kind of multimedia resource take out frame method, device, server and Storage medium.

Background technique

Multimedia resource takes out frame technique and refers to a kind of technology for extracting certain dry video frame from multimedia resource.Multimedia money A kind of important means that frame technique is read as multimedia resource feature is taken out in source, can be used for detecting multimedia resource.In When detecting to media resource, based on the video frame extracted from multimedia resource, detection efficiency can be improved.

Usual same multimedia resource can be applied in a variety of detection business, and every kind of detection business has different pumping frames again Logic, this just needs to carry out multimedia resource for every kind of detection business to take out frame processing, and stores every kind of detection business pair The video frame answered.A large amount of computing resource and storage resource can be consumed using this kind of method, therefore, it is urgent to provide a kind of multimedias The pumping frame method of resource takes out computing resource and storage resource consumed by frame process to reduce.

Summary of the invention

The embodiment of the present disclosure provides a kind of multimedia resource and takes out frame method, device, server and storage medium, at least It is big to solve the problems, such as to carry out multimedia resource computing resource and storage resource consumption when pumping frame.The technical solution is as follows:

On the one hand, a kind of multimedia resource pumping frame method is provided, which comprises

When the pumping frame to specified multimedia resource for receiving the transmission of terminal used in specified services is requested, inquiry refers to Determine designated frame set whether is stored in database, the designated frame set is applied to provide the specified multimedia In the different detection scenes that source is detected, the designated frame set includes extracting from the specified multimedia resource At least one video frame;

When being stored with the designated frame set in the specified database, the designated frame set is sent to The terminal;

There is the designated frame set when not stored in the specified database, generate the designated frame set, And the designated frame set is sent to the terminal.

It is described to generate the designated frame set in another embodiment of the disclosure, comprising:

Obtain the video metamessage of the specified multimedia resource, the video metamessage, which is used to indicate, described specifies more matchmakers The attribute information of body resource;

According to the video metamessage, the pumping frame parameter for take out to the specified multimedia resource frame is determined;

According to the pumping frame parameter, pumping frame is carried out to the specified multimedia resource, obtains the designated frame set.

In another embodiment of the disclosure, according to the video metamessage, determine to the specified multimedia resource Take out the pumping frame parameter of frame, comprising:

From the video metamessage, the video length and video frame sum of the specified multimedia resource are obtained;

According to the video length and preset duration of the specified multimedia resource, the pumping of the specified multimedia resource is determined Frame strategy;

According to the video frame of specified multimedia resource sum and preset quantity, the specified multimedia resource is determined Take out number of frames;

Wherein, described to take out the video length that frame parameter includes the specified multimedia resource, pumping number of frames and take out frame strategy.

In another embodiment of the disclosure, the video length according to the specified multimedia resource and it is default when It is long, determine the pumping frame strategy of the specified multimedia resource, comprising:

When the specified multimedia resource video length be greater than the preset duration, determine the pumpings frame strategy for every First time period extracts a video frame;

When the specified multimedia resource video length be less than the preset duration, determine the pumpings frame strategy for every Second time period extracts a video frame;

The video frame sum and preset quantity according to the specified multimedia resource determines the specified multimedia money The pumping number of frames in source, comprising:

When the video frame sum of the specified multimedia resource is greater than preset quantity, determine that the pumpings number of frames is first several Amount;

When the video frame sum of the specified multimedia resource is less than preset quantity, determine that the pumpings number of frames is second several Amount;

Wherein, the first time period is greater than the second time period, and first quantity is greater than second quantity.

It is described according to the pumping frame parameter in another embodiment of the disclosure, to the specified multimedia resource into Row takes out frame, obtains the designated frame set, comprising:

Video frame identical with the pumping number of frames is extracted from the specified multimedia resource according to the pumping frame strategy;

Resource identification is arranged in each video frame to be extracted;

Each video frame is stored with corresponding resource identification into the designated frame set.

It is described that the designated frame set is sent to the terminal in another embodiment of the disclosure, comprising:

According to the required video frame quantity of the specified services and type, chosen from the designated frame set with The video frame quantity and at least one corresponding target video frame of type;

At least one described target video frame is sent to the terminal.

In another embodiment of the disclosure, the method also includes:

Asking to the inquiry for taking out frame parameter for the terminal transmission is received when taking out frame metadata interface by multimedia resource When asking, frame metadata interface is taken out by multimedia resource, the pumping frame parameter is sent to the terminal;

Wherein, the multimedia resource takes out the pumping frame parameter that frame metadata interface is used for terminal inquiry multimedia resource.

In another embodiment of the disclosure, the method also includes:

Obtaining to sets of video frames for the terminal transmission is received when taking out frame data access interface by multimedia resource When taking request or preview request, frame data access interface is taken out by the multimedia resource and sends the designated frame set To the terminal;

Wherein, it is corresponding for terminal acquisition and browsing multimedia resource to take out frame data access interface for the multimedia resource Sets of video frames.

In another embodiment of the disclosure, the method also includes:

The resource identification that each video frame in the designated frame set is calculated using hash algorithm is obtained described specified The cryptographic Hash of each video frame in sets of video frames;

The Hamming distance in the designated frame set between the cryptographic Hash of two adjacent video frames is calculated frame by frame;

If the Hamming distance between any video frame and the cryptographic Hash of adjacent video frames is less than pre-determined distance, by the view Frequency frame is deleted from the designated frame set.

On the other hand, a kind of multimedia resource pumping frame device is provided, described device includes:

Enquiry module, for when the pumping frame to specified multimedia resource for receiving the transmission of terminal used in specified services It when request, inquires in specified database and whether is stored with designated frame set, the designated frame set is applied to institute It states in the different detection scenes that specified multimedia resource is detected, the designated frame set includes specifying more matchmakers from described At least one video frame extracted in body resource;

Sending module is stored with the designated frame set for working as in the specified database, by the specified view Frequency frame set is sent to the terminal;

Gather generation module, for having the designated frame set when not stored in the specified database, generates institute Designated frame set is stated, and the designated frame set is sent to the terminal.

In another embodiment of the disclosure, the set generation module is also used to obtain the specified multimedia money The video metamessage in source, the video metamessage are used to indicate the attribute information of the specified multimedia resource;According to the view Frequency metamessage determines the pumping frame parameter for take out to the specified multimedia resource frame;According to the pumping frame parameter, to the finger Determine multimedia resource and carry out pumping frame, obtains the designated frame set.

In another embodiment of the disclosure, the set generation module is also used to from the video metamessage, obtains Take the video length and video frame sum of the specified multimedia resource;According to the video length of the specified multimedia resource and Preset duration determines the pumping frame strategy of the specified multimedia resource;According to the video frame of specified multimedia resource sum And preset quantity, determine the pumping number of frames of the specified multimedia resource;

Wherein, described to take out the video length that frame parameter includes the specified multimedia resource, pumping number of frames and take out frame strategy.

In another embodiment of the disclosure, the set generation module is also used to when the specified multimedia resource Video length be greater than the preset duration, determine the pumpings frame strategy be every first time period extraction one video frame;When The video length of the specified multimedia resource is less than the preset duration, determines that the pumping frame strategy is every second time period Extract a video frame;

The set generation module is also used to be greater than preset quantity when the video frame sum of the specified multimedia resource, Determine that the pumping number of frames is the first quantity;When the video frame sum of the specified multimedia resource is less than preset quantity, determination The pumping number of frames is the second quantity;

Wherein, the first time period is greater than the second time period, and first quantity is greater than second quantity.

In another embodiment of the disclosure, the set generation module, for according to the pumping frame strategy from described Video frame identical with the pumping number of frames is extracted in specified multimedia resource;Resource mark is arranged in each video frame to be extracted Know;Each video frame is stored with corresponding resource identification into the designated frame set.

In another embodiment of the disclosure, the sending module, for according to the required view of the specified services Frequency number of frames and type, from the designated frame set choose it is corresponding with the video frame quantity and type at least one Target video frame;At least one described target video frame is sent to the terminal.

In another embodiment of the disclosure,

The sending module, for when pair for receiving the terminal transmission by multimedia resource pumping frame metadata interface When taking out the inquiry request of frame parameter, frame metadata interface is taken out by multimedia resource, the pumping frame parameter is sent to the end End;

Wherein, the multimedia resource takes out the pumping frame parameter that frame metadata interface is used for terminal inquiry multimedia resource.

In another embodiment of the disclosure,

The sending module, for receiving terminal transmission when smoking frame data access interface by multimedia resource When to the acquisition request or preview request of sets of video frames, frame data access interface is taken out for the finger by the multimedia resource Determine sets of video frames and is sent to the terminal;

Wherein, it is corresponding for terminal acquisition and browsing multimedia resource to take out frame data access interface for the multimedia resource Sets of video frames.

In another embodiment of the disclosure, described device further include:

Computing module, for calculating the resource mark of each video frame in the designated frame set using hash algorithm Know, obtains the cryptographic Hash of each video frame in the designated frame set;

The computing module, for calculate frame by frame two adjacent video frames in the designated frame set cryptographic Hash it Between Hamming distance;

Removing module, if be less than for the Hamming distance between any video frame and the cryptographic Hash of adjacent video frames default Distance deletes the video frame from the designated frame set.

On the other hand, a kind of server is provided, the server includes processor and memory, is deposited in the memory Contain at least one instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Cheng Sequence, the code set or described instruction collection are loaded by the processor and are executed to realize that multimedia resource takes out frame method.

On the other hand, a kind of computer readable storage medium is provided, at least one finger is stored in the storage medium Enable, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or Described instruction collection is loaded by processor and is executed to realize that multimedia resource takes out frame method.

The technical solution that the embodiment of the present disclosure provides has the benefit that

When receiving pumping frame request, inquire in specified database whether deposit designated frame set, it is direct in storage It obtains, the designated frame set is generated when not stored, and then the designated frame set is sent to terminal.Due to specified Sets of video frames can be applied in the different detection scenes detected to specified multimedia resource, because without for difference Detection scene carry out respectively take out frame processing, reduce the consumption of computing resource and storage resource.

Detailed description of the invention

In order to illustrate more clearly of the technical solution in the embodiment of the present disclosure, will make below to required in embodiment description Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present disclosure, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.

Fig. 1 is that the multimedia resource that the embodiment of the present disclosure provides takes out implementation environment involved in frame method;

Fig. 2 is that a kind of multimedia resource that the embodiment of the present disclosure provides takes out frame method flow chart;

Fig. 3 is the timing diagram that a kind of multimedia resource that the embodiment of the present disclosure provides takes out frame;

Fig. 4 is that a kind of multimedia resource that the embodiment of the present disclosure provides takes out frame apparatus structure schematic diagram;

Fig. 5 is a kind of server that frame is taken out for multimedia resource shown according to an exemplary embodiment.

Specific embodiment

To keep the purposes, technical schemes and advantages of the disclosure clearer, below in conjunction with attached drawing to disclosure embodiment party Formula is described in further detail.

Implement ring involved in frame method referring to FIG. 1, taking out it illustrates the multimedia resource that the embodiment of the present disclosure provides Border, the implementation environment include: terminal 101 and server 102.

Wherein, terminal 101 can be smart phone, tablet computer, laptop etc., and the embodiment of the present disclosure is not to terminal 101 product type makees specific limit.

Server 102 has storage capacity, can be stored with multimedia resource and carry out smoking what frame obtained to multimedia resource Sets of video frames;The server 102 also has computing capability, can carry out taking out frame processing to multimedia resource, and to obtained view Frequency frame set optimizes.

It can be communicated by cable network or wireless network between above-mentioned terminal 101 and server 102.

The embodiment of the present disclosure provides a kind of multimedia resource pumping frame method, executes the embodiment of the present disclosure with server and is Example, referring to fig. 2, the method flow that the embodiment of the present disclosure provides includes:

201, when the pumping frame to specified multimedia resource for receiving the transmission of terminal used in specified services is requested, clothes Designated frame set whether is stored in business device inquiry specified database.

Wherein, specified services are a kind of business that multimedia resource is detected.Terminal is used in the specified services Terminal.Take out the resource identification etc. that frame request carries specified multimedia resource.Specified database is used to store designated frame set, The specified database can be TiDB database etc..Wherein, TiDB database is a kind of NewSQL database, can be by traditional number It is combined according to library with non-relational database.(A is Atomicity (atom by TiDB database support level resilient expansion, ACID Property) write a Chinese character in simplified form, C is that Consistency (consistency) writes a Chinese character in simplified form, and I is writing a Chinese character in simplified form for Isolation (isolation), and D is Durability (durability) is write a Chinese character in simplified form) affairs, stsndard SQL (Structured Query Language, structuralized query language Speech), MySQL grammer and MySQL agreement, the High Availabitity characteristic with data strongly consistent is not only suitable for OLTP (On-Line Transaction Processing, Transaction Processing process) scene, it is also suitable for OLAP (On-Line Analytical Processing, on-line analytical processing) scene.In view of the quantity of multimedia resource is at least one, for the ease of distinguishing not The corresponding sets of video frames with multimedia resource, specified database can provide multimedia according to the resource identification of multimedia resource The corresponding sets of video frames in source is stored.Designated frame set is applied to the difference detected to specified multimedia resource It detects in scene, which includes at least one video frame extracted from specified multimedia resource.

When receiving to the request of the pumping frame of specified multimedia resource, server according to the resource identification of multimedia resource, It whether is stored with designated frame set in inquiry specified database, if specified database is stored with designated frame set, 202 are thened follow the steps, if not stored in specified database have designated frame set, thens follow the steps 203.

202, when being stored with designated frame set in specified database, designated frame set is sent to end by server End.

When being stored with designated frame set in specified database, server can directly be sent designated frame set To terminal.When designated frame set is sent to terminal by server, kafk message can be sent to terminal, and then be based on the kafk Designated frame set is sent to terminal by message.Wherein, kafk is a kind of Distributed Message Queue, with high-performance, persistently Change, the backup of more copies, ability extending transversely.Message is written in transmitting terminal in the kafk, and receiving end can be obtained from the kafk to disappear It ceases and executes service logic.

203, there is designated frame set when not stored in specified database, server generates designated frame set, and Designated frame set is sent to terminal.

There is designated frame set when not stored in specified database, server will take out specified multimedia resource Frame, to generate designated frame set.Specifically, following steps can be used:

2031, server obtains the video metamessage of specified multimedia resource.

Wherein, video metamessage is used to indicate the attribute information of specified multimedia resource.Server is according in pumping frame request The resource identification of the specified multimedia resource carried is obtained specified multimedia resource, and is provided using ffprobe from specified multimedia Video metamessage is obtained in source.

2032, server determines the pumping frame parameter for take out to specified multimedia resource frame according to video metamessage.

Wherein, the video length that frame parameter includes specified multimedia resource, pumping number of frames are taken out and takes out frame strategy.Take out frame strategy Including extracted video frame type (for example, extract key frame or non-key frame), interval time is (for example, at interval of 1 minute Extract video frame etc.) etc..

Server can be used when determination carries out taking out the pumping frame parameter of frame to specified multimedia resource according to video metamessage Following method:

20321, server determines the video length and video frame sum of specified multimedia resource according to video metamessage.

The attribute information of specified multimedia resource according to indicated by video metamessage, server can obtain specified institute's media The video length of resource, and obtain the video frame sum that the specified multimedia resource includes.

20322, server determines according to the video length and video frame sum of specified multimedia resource and takes out number of frames and pumping Frame strategy.

Server presets the video length of multimedia resource and takes out the corresponding relationship between frame strategy, for example, setting When the video length of multimedia resource is greater than preset duration, taking out frame strategy is to extract a video frame every first time period;If When setting the video length of multimedia resource less than preset duration, taking out frame strategy is to extract a video frame every second time period. Wherein, preset duration can be determined according to the statistical result to multiple multimedia resources.First time period is greater than second time period, this Open embodiment does not make specific limit to first time period and second time period.Based on set corresponding relationship, work as acquisition To the video length of specified multimedia resource, server compares the video length of specified multimedia resource with preset duration Compared with when the video length of specified multimedia resource is greater than preset duration, server determines that taking out frame strategy is every first time period Extract a video frame;When the video length of specified multimedia resource is less than preset duration, server determines that it is every for taking out frame strategy A video frame is extracted every second time period.

Server also can be preset video frame sum and take out the corresponding relationship between number of frames, for example, setting video frame When sum is greater than preset quantity, the pumping number of frames for carrying out taking out frame to multimedia resource is the first quantity;It is small that video frame sum is set When preset quantity, the pumping number of frames for carrying out taking out frame to multimedia resource is the second quantity.Wherein, preset quantity can be according to more The statistical result of a multimedia resource determines.First quantity is greater than the second quantity, and the embodiment of the present disclosure is not to the first quantity and the Two quantity make specific limit.Based on set corresponding relationship, when the video frame sum for getting specified multimedia resource, clothes The video frame sum of specified multimedia resource is compared by business device with preset quantity, when the video frame of specified multimedia resource is total Number is greater than preset quantity, and server determines that the pumping number of frames for carrying out taking out frame to specified multimedia resource is the first quantity;When specified The video frame sum of multimedia resource is less than preset quantity, and server determines the pumping frame number for take out to specified multimedia resource frame Amount is the second quantity.

2033, server carries out pumping frame to specified multimedia resource, obtains designated frame set according to frame parameter is taken out.

Server carries out pumping frame to specified multimedia resource, when obtaining designated frame set, can adopt according to frame parameter is taken out With the following method:

20331, server extracts video frame identical with number of frames is taken out according to frame strategy is taken out from specified multimedia resource.

Server uses ffmepg, and view identical with number of frames is taken out is extracted from specified multimedia resource according to frame strategy is taken out Frequency frame.Wherein, ffmepg be it is a set of can be used to record, converted digital audio, video, and the open source meter of stream can be translated into Calculation machine program.Ffmepg uses LGPL or GPL licensing, is capable of providing recording, conversion and the complete solution for fluidizing audio-video Scheme.

For example, taking out number of frames is 9 frames, taking out frame strategy is then to be based on the pumping frame number every one video frame of extraction in one minute Amount and take out frame strategy, server using specify multimedia resource starting play position as starting point, using ffmepg every 1 minute from A video frame is extracted in specified multimedia resource, until the video frame quantity extracted reaches 9 frames.

In another embodiment of the disclosure, server is extracting at least one video frame from specified multimedia resource When, the multimedia resource of separate sources is carried out pumping frame using identical pumping frame mode by maskable pumping frame mode.Based on shielding Frame mode is taken out, no matter multimedia resource is stored in server internal, is also stored in the storage mediums such as video cloud, server is equal Take identical pumping frame mode.

20332, server is that resource identification is arranged in each video frame.

In order to preferably be managed to the video frame extracted, server will be also arranged for each video frame extracted Resource identification, the resource identification being capable of each video frames of unique identification.

20333, server stores each video frame into designated frame set with corresponding resource identification.

After obtaining designated frame set, server can be by cable network or wireless network by designated frame set It is sent to terminal.

In another embodiment of the disclosure, it is contemplated that the different required video frames of detection business may be different , in order to meet the needs of different detection business, after obtaining designated frame set, server can also be according to specified services Required video frame quantity and type choose at least one target video frame from designated frame set, and then by having At least one selected target video frame is sent to terminal by gauze network or wireless network.

Primary pumping frame is realized using the method that the embodiment of the present disclosure provides, is repeatedly obtained, the subsequent essence for taking out frame is facilitated Refinement and optimization process shield different resources and take out frame logic, system resource, human resources is greatly saved.

In another disclosed embodiment, server provides a multimedia resource and takes out frame metadata interface, more matchmakers Body resource takes out frame metadata interface and takes out frame parameter for terminal inquiry.Frame metadata is taken out based on set multimedia resource to connect Mouthful, the terminal of different business can inquire the pumping frame parameter for take out to specified multimedia resource frame.For example, when passing through multimedia Resource take out frame metadata interface receive terminal transmission to take out frame parameter inquiry request when, server can be provided by multimedia It takes out frame metadata interface and is sent to terminal for frame parameter is taken out in source.

In another disclosed embodiment, server also provides a multimedia resource and takes out frame data access interface, should Multimedia resource takes out frame data access interface and obtains and browse designated frame set for terminal.Based on set multimedia Resource take out frame data access interface, the terminal of different business can obtain and browse to specified multimedia resource carry out take out frame obtain Designated frame set.For example, when by multimedia resource take out frame data access interface receive terminal send to video When the acquisition request or preview request of frame set, server can take out frame data access interface for designated by multimedia resource Frame set is sent to terminal.

Since the video frame quality extracted directly affects the testing result to specified multimedia resource, in order to improve to finger Determine the testing result of multimedia resource, server will also optimize designated frame set.Specific optimization process are as follows:

The first step, server are calculated the resource identification of each video frame in designated frame set using hash algorithm, obtained The cryptographic Hash of each video frame into designated frame set.

Server is calculated according to being in advance resource identification set by each video frame in designated frame set using Hash Method calculates the resource identification of each video frame in designated frame set, obtains the Kazakhstan of each video frame in designated frame set Uncommon value.

Second step, server calculate the Hamming in designated frame set between the cryptographic Hash of two adjacent video frames frame by frame Distance.

Using first video frame in designated frame set as starting point, server calculates phase in designated frame set frame by frame Hamming distance between the cryptographic Hash of adjacent two video frames.

Third step, if the Hamming distance between any video frame and the cryptographic Hash of adjacent video frames is less than pre-determined distance, Server deletes video frame from designated frame set.

Wherein, pre-determined distance can be configured according to the accuracy requirement of detection business.When any video frame and adjacent video Hamming distance between the cryptographic Hash of frame is less than pre-determined distance, illustrates that this two frames video frame is more similar, is based on similar video Frame detects multimedia resource, and testing result is inaccurate.For this purpose, working as the cryptographic Hash of any video frame and adjacent video frames Between Hamming distance be less than pre-determined distance when, server can delete the video frame from designated frame set, to ensure Testing result.

Fig. 3 is the process for carrying out taking out frame to multimedia resource, is provided when receiving to multimedia referring to Fig. 3 because of business demand Source pumping frame request when, server inquiry whether pumping frame has been carried out to the multimedia resource, if to the multimedia resource into Row takes out frame, then sends kafka message to business side, and to notify business side, multimedia resource is taken out in kafka message carrying The sets of video frames that frame obtains;If not carrying out pumping frame to the multimedia resource, using ffprobe to the basic letter of video frame Breath is detected, and obtains taking out frame parameter, and then based on frame parameter is taken out, carry out pumping frame to multimedia resource.When getting video frame After set, similar video frame is removed using hash algorithm, and the sets of video frames after duplicate removal is sent to business side.

Whether the method that the embodiment of the present disclosure provides deposits specified when receiving pumping frame request in inquiry specified database Sets of video frames directly acquires in storage, generates the designated frame set when not stored, and then by the designated frame Set is sent to terminal.Since designated frame set can be applied to the different detections detected to specified multimedia resource In scene, because reducing computing resource and storage resource without carrying out taking out frame processing respectively for different detection scenes Consumption.

Referring to fig. 4, the embodiment of the present disclosure provides a kind of multimedia resource pumping frame device, which includes:

Enquiry module 401, for when receive terminal used in specified services transmission to specified multimedia resource It when taking out frame request, inquires in specified database and whether is stored with designated frame set, designated frame set is applied to finger Determine in the different detection scenes that multimedia resource is detected, designated frame set includes extracting from specified multimedia resource At least one video frame;

Sending module 402, for when being stored with designated frame set in specified database, designated frame set to be sent out It send to terminal;

Gather generation module 403, for having designated frame set when not stored in specified database, generates designated Frame set, and designated frame set is sent to terminal.

In another embodiment of the disclosure, gathers generation module 403, be also used to obtain the view of specified multimedia resource Frequency metamessage, video metamessage are used to indicate the attribute information of specified multimedia resource;According to video metamessage, determine to specified Multimedia resource take out the pumping frame parameter of frame;According to frame parameter is taken out, pumping frame is carried out to specified multimedia resource, obtains specified view Frequency frame set.

In another embodiment of the disclosure, gathers generation module 403, be also used to from video metamessage, acquisition refers to Determine the video length and video frame sum of multimedia resource;According to the video length and preset duration of specified multimedia resource, really Surely the pumping frame strategy of specified multimedia resource;According to the video frame of specified multimedia resource sum and preset quantity, determine specified The pumping number of frames of multimedia resource;

Wherein, the video length that frame parameter includes specified multimedia resource, pumping number of frames are taken out and takes out frame strategy.

In another embodiment of the disclosure, gather generation module 403, is also used to the video when specified multimedia resource Duration is greater than preset duration, determines that taking out frame strategy is to extract a video frame every first time period;When specified multimedia resource Video length be less than preset duration, determine take out frame strategy be every second time period extract a video frame;

Gather generation module 403, is also used to be greater than preset quantity when the video frame sum of specified multimedia resource, determines and take out Number of frames is the first quantity;When the video frame sum of specified multimedia resource is less than preset quantity, determining number of frames of taking out is second Quantity;

Wherein, first time period is greater than second time period, and the first quantity is greater than the second quantity.

In another embodiment of the disclosure, gather generation module 403, for according to taking out frame strategy from specified multimedia Video frame identical with number of frames is taken out is extracted in resource;Resource identification is arranged in each video frame to be extracted;By each video Frame is stored with corresponding resource identification into designated frame set.

In another embodiment of the disclosure, sending module 402, for according to the required video frame number of specified services Amount and type choose at least one target video frame corresponding with video frame quantity and type from designated frame set;It will At least one target video frame is sent to terminal.

In another embodiment of the disclosure,

Sending module 402, for when by multimedia resource take out frame metadata interface receive terminal transmission to pumping frame When the inquiry request of parameter, frame metadata interface is taken out by multimedia resource and is sent to terminal for frame parameter is taken out;

Wherein, multimedia resource takes out the pumping frame parameter that frame metadata interface is used for terminal inquiry multimedia resource.

In another embodiment of the disclosure,

Sending module 402, for when by multimedia resource take out frame data access interface receive terminal send to view When the acquisition request or preview request of frequency frame set, frame data access interface is taken out for designated frame set by multimedia resource It is sent to terminal;

Wherein, multimedia resource takes out frame data access interface for terminal acquisition and the corresponding video of browsing multimedia resource Frame set.

In another embodiment of the disclosure, the device further include:

Computing module is obtained for being calculated the resource identification of each video frame in designated frame set using hash algorithm The cryptographic Hash of each video frame into designated frame set;

Computing module, for calculating the Hamming in designated frame set between the cryptographic Hash of two adjacent video frames frame by frame Distance;

Removing module, if be less than for the Hamming distance between any video frame and the cryptographic Hash of adjacent video frames default Distance deletes video frame from designated frame set.

To sum up, whether the device that the embodiment of the present disclosure provides is inquired in specified database and is deposited when receiving pumping frame request Designated frame set is directly acquired in storage, the designated frame set is generated when not stored, and then this is specified view Frequency frame set is sent to terminal.Since designated frame set can be applied to the difference detected to specified multimedia resource It detects in scene, because reducing computing resource and storage money without carrying out taking out frame processing respectively for different detection scenes The consumption in source.

Fig. 5 is a kind of server that frame is taken out for multimedia resource shown according to an exemplary embodiment.Reference Fig. 5, Server 500 includes processing component 522, further comprises one or more processors, and as representated by memory 532 Memory resource, can be by the instruction of the execution of processing component 522, such as application program for storing.It is stored in memory 532 Application program may include it is one or more each correspond to one group of instruction module.In addition, 522 quilt of processing component It is configured to execute instruction, takes out function performed by server in frame method to execute above-mentioned multimedia resource.

Server 500 can also include that a power supply module 526 be configured as the power management of execute server 500, and one A wired or wireless network interface 550 is configured as server 500 being connected to network and input and output (I/O) interface 558.Server 500 can be operated based on the operating system for being stored in memory 532, such as Windows ServerTM, Mac OS XTM, UnixTM,LinuxTM, FreeBSDTMOr it is similar.

The server that the embodiment of the present disclosure provides inquires in specified database whether deposit finger when receiving pumping frame request Determine sets of video frames, directly acquired in storage, generate the designated frame set when not stored, and then by the designated Frame set is sent to terminal.Since designated frame set can be applied to the different inspections detected to specified multimedia resource It surveys in scene, because reducing computing resource and storage resource without carrying out taking out frame processing respectively for different detection scenes Consumption.

The embodiment of the present disclosure provides a kind of computer readable storage medium, is stored at least one in the storage medium Instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set Or described instruction collection is loaded by processor and is executed to realize that multimedia resource shown in Fig. 2 takes out frame method.

The computer readable storage medium that the embodiment of the present disclosure provides inquires specified data when receiving pumping frame request Designated frame set whether is deposited in library, is directly acquired in storage, the designated frame set is generated when not stored, in turn The designated frame set is sent to terminal.Since designated frame set can be applied to carry out specified multimedia resource In the different detection scenes of detection, because reducing calculating money without carrying out taking out frame processing respectively for different detection scenes The consumption in source and storage resource.

It should be understood that multimedia resource provided by the above embodiment, which takes out frame device, is carrying out pumping frame to multimedia resource When, only the example of the division of the above functional modules, in practical application, it can according to need and divide above-mentioned function With being completed by different functional modules, i.e., the internal structure that multimedia resource takes out frame device is divided into different functional modules, To complete all or part of the functions described above.In addition, multimedia resource provided by the above embodiment takes out frame device and more Media resource takes out frame method embodiment and belongs to same design, and specific implementation process is detailed in embodiment of the method, and which is not described herein again.

Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..

The foregoing is merely the preferred embodiments of the disclosure, not to limit the disclosure, all spirit in the disclosure and Within principle, any modification, equivalent replacement, improvement and so on be should be included within the protection scope of the disclosure.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:直播控制方法与装置、存储介质及电子装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类