CN106686452A - Dynamic picture generation method and device - Google Patents
Dynamic picture generation method and device Download PDFInfo
- Publication number
- CN106686452A CN106686452A CN201611245811.3A CN201611245811A CN106686452A CN 106686452 A CN106686452 A CN 106686452A CN 201611245811 A CN201611245811 A CN 201611245811A CN 106686452 A CN106686452 A CN 106686452A
- Authority
- CN
- China
- Prior art keywords
- image
- video
- frequency band
- target
- similar
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
- H04N21/44008—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
Abstract
The embodiment of the invention provides a dynamic picture generation method and device. The method comprises: determining a target play moment when the scene changing happens in the target video; taking the target play moment as a break point, and dividing the target video as video sections; and generating dynamic pictures according to each obtained video section through division. According to the scheme provided by the embodiment of the invention, compared to the prior art, the dynamic picture generation method and device realize the purpose that the video sections are extracted from the video to automatically generate dynamic pictures on the basis without a training video section model; and moreover, the requirement on the computing source is small, and the operation that the video sections are directly captured from the video on one machine to dynamically generate dynamic pictures.
Description
Technical field
The present invention relates to field of computer technology, the generation method and device of more particularly to a kind of dynamic picture.
Background technology
Dynamic picture is made up of multiframe static images, and is shown according to certain playing sequence, the equipment such as computer
Static images included in dynamic picture can frame by frame be read out and are shown on screen, and then shown simple dynamic
Draw, for example, common GIF (Graphics Interchange Format, graphic interchange format) picture, WebP (Google's exploitations
A kind of picture format) dynamic picture etc..At present, in various internet exchange platforms, dynamic picture has extremely wide making
With rate.
Dynamic picture can be obtained by artificial combination static images, it is also possible to intercept video-frequency band from video to give birth to automatically
Into.It is existing to intercept video-frequency band come in the method for automatically generating dynamic picture by from video, it is necessary first to be selected from video
The video-frequency band for being adapted to generation dynamic picture is selected, dynamic picture is then generated using selected video-frequency band, reached from video certainly
The purpose of dynamic generation dynamic picture.In the prior art, can be trained beforehand through deep learning neutral net and be adapted to generation GIF
The video segment model of picture, then in the specific generation method of dynamic picture, is directly selected to be adapted to generate to move with the model
The video-frequency band of state picture.
Can be very good to generate GIF pictures using aforesaid way, but, when being trained to above-mentioned neural network model,
Needing substantial amounts of dynamic picture and its corresponding video source, training process not only needs substantial amounts of data, in addition it is also necessary to which consumption is a large amount of
Computing resource.
The content of the invention
The purpose of the embodiment of the present invention is the generation method and device for providing a kind of dynamic picture, that need not train
On the basis of video segment model, video-frequency band is extracted in realization from video, and automatically generates the purpose of dynamic picture.Particular technique side
Case is as follows:
It is up to above-mentioned purpose, in a first aspect, the embodiment of the invention provides a kind of generation method of dynamic picture, the side
Method includes:
Determine the target play moment of occurrence scene change in target video;
With the target play moment as cut-point, the target video is divided into video-frequency band;
Each video-frequency band for being obtained according to division respectively, generates dynamic picture.
Preferably, described each video-frequency band for being obtained according to division respectively, generates dynamic picture, including:
For each video-frequency band, operations described below is performed:
Determine target image in the image included from the video-frequency band;
According to the playing sequence of each image in the video-frequency band, judge respectively every a pair adjacent target images whether phase
Seemingly;
According to default selection rule, image is selected from identified target image, and it is true according to selected image
Determine first kind image sets;Wherein, the selection rule is:Arbitrary neighborhood image is similar in selected image, the first image with
Second image is dissimilar, or the first two field picture that described first image is the video-frequency band;3rd image and the 4th image not phase
Seemingly, or last frame image that the 3rd image is the video-frequency band, described first image is:In selected image
One two field picture, second image is:The previous frame image of the first image described in the video-frequency band, the 3rd image is:Institute
Last frame image in the image of selection, the 4th image is:The latter two field picture of the 3rd image described in the video-frequency band;
Based on identified first kind image sets, dynamic picture is generated.
Preferably, target image is determined in the image included from the video-frequency band, including:
Abstract image is used as target image in the image included from the video-frequency band.
Preferably, the playing sequence according to each image in the video-frequency band, judges every a pair adjacent targets respectively
Whether image is similar, including:
Obtain the thumbnail of target image determined by per frame;
According to the playing sequence of each image in the video-frequency band, the corresponding contracting of every a pair adjacent target images is judged respectively
Whether sketch map is similar;
If it is, judging that adjacent target image is similar;
If it has not, judging that adjacent target image is dissimilar.
Preferably, it is described to judge whether the corresponding thumbnail of every a pair adjacent target images is similar respectively, including:
The similarity value between the corresponding thumbnail of every a pair adjacent target images is calculated respectively;
Judge the similarity value whether more than predetermined threshold value;
If it is, it is similar to judge that adjacent target image distinguishes corresponding thumbnail;
If it has not, it is dissimilar to judge that adjacent target image distinguishes corresponding thumbnail.
Second aspect, the embodiment of the invention provides a kind of generating means of dynamic picture, and described device includes:
Determining module, the target play moment for determining occurrence scene change in target video;
Division module, for the target play moment as cut-point, the target video being divided into video-frequency band;
Generation module, for each video-frequency band for being obtained according to division respectively, generates dynamic picture.
Preferably, the generation module, including:
Determination sub-module, for being directed to each video-frequency band respectively, target image is determined from the image that video-frequency band is included;
Judging submodule, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band, difference
Judge whether every a pair adjacent target images are similar;
Selection submodule, for being directed to each video-frequency band respectively, according to default selection rule, from identified target figure
Image is selected as in, and first kind image sets are determined according to selected image;Wherein, the selection rule is:It is selected
Arbitrary neighborhood image is similar in image, and the first image and the second image are dissimilar, or described first image is the video-frequency band
First two field picture;3rd image and the 4th image are dissimilar, or the last frame image that the 3rd image is the video-frequency band,
Described first image is:The first two field picture in selected image, second image is:First figure described in the video-frequency band
The previous frame image of picture, the 3rd image is:Last frame image in selected image, the 4th image is:Should
The latter two field picture of the 3rd image described in video-frequency band;
Generation submodule, for being directed to each video-frequency band respectively, based on identified first kind image sets, generates Dynamic Graph
Piece.
Preferably, the determination sub-module, specifically for:
Abstract image is used as target image in the image included from the video-frequency band.
Preferably, the judging submodule, including:
Obtain subelement, the thumbnail for obtaining target image determined by every frame;
First judgment sub-unit, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band,
Judge whether the corresponding thumbnail of every a pair adjacent target images is similar respectively;
First judges subelement, for being in the case of being, to judge phase in the judged result of first judgment sub-unit
Adjacent target image is similar;
Second judges subelement, in the case of being no in the judged result of first judgment sub-unit, judges phase
Adjacent target image is dissimilar.
Preferably, the judging submodule, including:
Computation subunit, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band, difference
Calculate the similarity value between the corresponding thumbnail of every a pair adjacent target images;
Second judgment sub-unit, for judging the similarity value whether more than predetermined threshold value;
3rd judges subelement, for being in the case of being, to judge phase in the judged result of second judgment sub-unit
It is similar that adjacent target image distinguishes corresponding thumbnail;
4th judges subelement, in the case of being no in the judged result of second judgment sub-unit, judges phase
It is dissimilar that adjacent target image distinguishes corresponding thumbnail.
As seen from the above, in the generation method and device of a kind of dynamic picture provided in an embodiment of the present invention, it is first determined
The target play moment of occurrence scene change in target video;Then with target play moment as cut-point, target video is drawn
It is divided into video-frequency band;Each video-frequency band for finally being obtained according to division respectively, generates dynamic picture.The embodiment of the present invention is broadcast with target
It is constantly cut-point to put, and target video is divided into multiple video-frequency bands, and each video-frequency band for marking off is and is adapted to generation dynamic
The video-frequency band of picture, compared with prior art, the embodiment of the present invention do not need training video segment model on the basis of, realize from
Video-frequency band is extracted in video, and automatically generates the purpose of dynamic picture;And the embodiment of the present invention is few to the demand of computing resource,
Directly can complete to intercept video-frequency band from video on unit to automatically generate the operation of dynamic picture.
Certainly, implementing any product of the invention or method must be not necessarily required to while reaching all the above excellent
Point.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
A kind of schematic flow sheet of the generation method of dynamic picture that Fig. 1 is provided for one embodiment of the invention;
A kind of schematic flow sheet of the generation method of dynamic picture that Fig. 2 is provided for another embodiment of the present invention;
A kind of structural representation of the generating means of dynamic picture that Fig. 3 is provided for one embodiment of the invention;
A kind of structural representation of the generating means of dynamic picture that Fig. 4 is provided for another embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
The schematic flow sheet of the generation method of a kind of dynamic picture that Fig. 1 is provided for one embodiment of the invention, such as Fig. 1 institutes
Show, the method includes:
S101:Determine the target play moment of occurrence scene change in target video.
Under normal circumstances, the content in video between consecutive frame has similitude, but may be deposited when video is shot
Switching to the phenomenon of another photographed scene from photographed scene, or the later stage carries out during video production image content at two
Or the phenomenon switched between multiple photographed scenes, the content deltas between so adjacent two frame are larger.When in video adjacent two
When content deltas between frame reach to a certain degree, it is believed that there occurs that scene switches in the video, that is, there occurs above-mentioned field
Scape changes.
It should be noted that the target play moment of above-mentioned occurrence scene change, also referred to as scene changes timestamp, should
Target play moment is determined relative to the reproduction time of whole target video.
For example, for when the target video of a length of 90 minutes, it is assumed that there are 45 points of a target play moment 35 seconds, then show
The target play moment be target video play the 45th point 35 seconds;For another example, for when the target video of a length of 60 minutes, it is assumed that
In the presence of 23 points of a target play moment 06 second, then show that the target play moment played for target video the 23rd point 06 second.
In embodiments of the present invention, can be detected by professional tool of the prior art occurrence scene change when
Carve, for example:FFmpeg (it is a set of can be used to record, converted digital audio, video, and the calculating of increasing income of stream can be translated into
Machine program) provide a scene changes timestamp detection function, the moment for detecting scene changes;Therefore, herein can be with
All target play moments of occurrence scene change in target video are determined by FFmpeg.
Certainly, in practical application, directly can also judge whether there occurs using the difference degree between adjacent two frame
Scene switches, wherein, above-mentioned difference degree can be believed according to the motion vector of the histogram information of adjacent two frame, each encoding block
Breath etc. is calculated, and the application is defined not to this.
S102:With target play moment as cut-point, target video is divided into video-frequency band.
The content type that scene changes in video frequently can lead to video changes, continuous two scene changes moment
Between video-frequency band, video background do not have big change, and it is dynamic that the video-frequency band between continuous two scene changes moment is adapted to generation
State picture.
It should be noted that the video-frequency band for marking off should be determined by two adjacent target play moments, mark off
Video-frequency band in addition to the point of rear and front end, it is not possible to comprising other target play moments.For example, for a length of 2 minutes for the moment
Target video, it is determined that target play moment include 0 point 30 seconds, 0 point 51 seconds, 1 point 04 second;The video that then can now mark off
Section can have 0 point 0 second~0 point 30 seconds, 0 point 30 seconds~0 point 51 seconds, 0 point 51 seconds~1 point 04 second and 1 point 04 second~2 points 0 second;
And 0~0 point 51 seconds then cannot be used as the above-mentioned video-frequency band for marking off and.
For ease of carrying out video-frequency band division, when the initial time of target video can be defined as into first aim broadcasting
Carve, the end time of target video is defined as last target play moment.
S103:Each video-frequency band for being obtained according to division respectively, generates dynamic picture.
Dynamic picture including common GIF pictures, WebP dynamic pictures etc., for example, for GIF pictures since birth in 1987
Raw, just into a kind of expression way of people on internet, after nearly 30 years, GIF pictures of today were more and more fiery, wechat, QQ,
The social networking applications such as Line are found everywhere its trace, such as the expression bag in the expression store in such social networking application, appear in each
GIF pictures on website.
It should be noted that for a video-frequency band, the quantity of the dynamic picture that can be generated is not limited, Ke Yishi
1 group, or multigroup, for example, for a certain video-frequency band, ultimately generating 3 groups of GIF pictures.
Specifically, according to each video-frequency band for obtaining of division, during generation dynamic picture, can be in video-frequency band it is original
Image generates dynamic picture, first the original image in video-frequency band can also be zoomed in and out, cut, beautify etc. and processes, Ran Houzai
Dynamic picture is generated according to the image after above-mentioned treatment, the embodiment of the present invention is only illustrated as example, in practical application
It is defined not to this.
In addition, after the video-frequency band for being adapted to generate dynamic picture is determined, implementing for above-mentioned steps S103 can lead to
Prior art is crossed, and in embodiments of the present invention, as shown in Fig. 2 above-mentioned each video-frequency band for being obtained according to division respectively, generation
Dynamic picture (S103), can include:
For each video-frequency band, operations described below is performed:
S301:Determine target image in the image included from the video-frequency band.
In embodiments of the present invention, it may be determined that all images contained by the video-frequency band are target image.
Those skilled in that art it is understood that the data volume of image is larger, if in considering video-frequency band frame by frame
Each two field picture, the speed for being easily caused generation dynamic picture is slow, is that this can only select video according to rule set in advance
A part of image in section, and selected image is defined as target image.
In embodiments of the present invention, target image (S301) is determined in the above-mentioned image included from the video-frequency band, can be wrapped
Include:
Abstract image is used as target image in the image included from the video-frequency band.
It will be appreciated by persons skilled in the art that above-mentioned steps are considered as one takes out frame treatment, for example, for continuous
Play 100 two field pictures, numbering be respectively 1~100, can now extract numbering be odd number image as target image;
Can extract numbering be even number image as target image;Can also be extracted at interval of 3 frames since the image that numbering is 1
One image, the image that will be drawn into is used as target image.
S302:According to the playing sequence of each image in the video-frequency band, judge that every a pair adjacent target images are respectively
It is no similar.
As above example, for continuous 100 two field pictures played, it is assumed that extract image that numbering is odd number as target image,
Then adjacent target image include target image 1 and 3,3 and 5,5 and 7 ..., 97 and 99.
It should be noted that herein judge whether every a pair adjacent target images similar, that is, determine every a pair adjacent mesh
The similitude of logo image.It is appreciated that video generally has frame rate higher, usually per second 15 with reference to above-mentioned prior art
Or 25 frames, even more high, frame figure similitude detection needs certain amount of calculation, so in embodiments of the present invention, in order to reduce
The amount of calculation of similitude detection, employs the processing mode of step S301.
It should be noted that in embodiments of the present invention, only determine the similar of two adjacent frame target images, and not as existing
There is technology equally to compare the similarity of present frame and multiple image before, further reduce the amount of calculation of similarity.
In addition, the resolution ratio of target image determined by step S301 is general higher, so in order to further reduce similar
The amount of calculation of property, in embodiments of the present invention, the above-mentioned playing sequence according to each image in the video-frequency band judges each respectively
It is whether similar to adjacent target image, can include:
Obtain the thumbnail of target image determined by per frame;
According to the playing sequence of each image in the video-frequency band, the corresponding contracting of every a pair adjacent target images is judged respectively
Whether sketch map is similar;
If it is, judging that adjacent target image is similar;
If it has not, judging that adjacent target image is dissimilar.
It should be noted that the thumbnail of above-mentioned acquisition target image determined by per frame, can keep original figure
In the case of the ratio of width to height of picture, by the reduced width of every frame target image to default value, such as by the width contracting of former target image
It is small to 100;Can also be that preset multiple will be directly reduced per frame target image, for example, 5 times will be directly reduced per frame target image.
It is above-mentioned to judge whether the corresponding thumbnail of every a pair adjacent target images is similar respectively in the embodiment of the present invention,
Can include:
The similarity value between the corresponding thumbnail of every a pair adjacent target images is calculated respectively;
Judge the similarity value whether more than predetermined threshold value;
If it is, it is similar to judge that adjacent target image distinguishes corresponding thumbnail;
If it has not, it is dissimilar to judge that adjacent target image distinguishes corresponding thumbnail.
It should be noted that the circular of similarity value can use prior art, for example in the prior art
Similarity is determined by mean square error and pixel error percentage, and in embodiments of the present invention, SSIM can also be used
(structural similarity index, structural similarity) algorithm determines two similarities of thumbnail.
For example, predetermined threshold value is x, existing two hypertonics sketch map 1 ' and 2 ', its corresponding target image is respectively image 1 and 2,
And the SSIM values for passing through SSIM algorithms calculating two hypertonic sketch maps 1 ' and 2 ' of acquisition are y:If y is more than x, two hypertonic sketch maps are judged
1 ' and 2 ' is similar, i.e., target image 1 and 2 is similar;Otherwise, it is determined that the dissmilarity of two hypertonic sketch map 1 ' and 2 ', i.e. target image 1 and 2
It is dissimilar.
S303:According to default selection rule, image is selected from identified target image, and according to selected figure
As determining first kind image sets.
Wherein, the selection rule is:Arbitrary neighborhood image is similar in selected image, and the first image and the second image are not
It is similar, or the first two field picture that first image is the video-frequency band;3rd image and the 4th image are dissimilar, or the 3rd
Image is the last frame image of the video-frequency band, and first image is:The first two field picture in selected image, second figure
As being:The previous frame image of first image in the video-frequency band, the 3rd image is:Last frame figure in selected image
Picture, the 4th image is:The latter two field picture of the 3rd image in the video-frequency band.
It is appreciated that in embodiments of the present invention, identified each first kind image sets should at least meet as follows
Two conditions:
One:Each target image in first kind image sets is continuous similar frame.
Two:The first two field picture in first kind image sets is the first two field picture of the video-frequency band, or, first kind image sets
In the first two field picture and its previous frame image it is dissimilar;Last frame image in first kind image sets be the video-frequency band most
Latter two field picture, or, the last frame image in first kind image sets is dissimilar with its latter two field picture.
For example, existing 100 frame target image, according to video playback order, the label of 100 frame target images is respectively 1~
100, now determine that 1~45 frame target image is continuously similar, the 45th frame target image and the 46th frame target image are dissimilar, and 46~79
Frame target image is similar, and 79~82 frame target images are dissimilar, and 82~100 frame target images are continuously similar;Then now determine
First kind image sets can have 3 groups:1~45 frame target image, 46~79 frame target images and 82~100 frame target figures
Picture.
Determine that the complete operation of first kind image sets specifically can be as follows from a video-frequency band:
The total quantity N of the first step, all target images that input video section is included, and target image, by all mesh
Logo image is 1 according to the playing sequence numbering of target video, 2,3 ..., n, it is clear that, numerically, N=n;
Second step, the initial frame index x=1, current frame index y=1 of the continuous similar frame of initialization;
Whether the 3rd step, judge current y values less than n;If it is, the 4th step is performed, if not, performing the 7th step;
4th step, calculates the corresponding thumbnail of target image that numbering is y, corresponding with the target image that numbering is y+1
The similarity value of thumbnail;
5th step, whether the similarity value that judgement is calculated is more than predetermined threshold value;If it is, updating y=y+1, and return
The step of receipt row the 3rd, if not, performing the 6th step;
6th step, with current xth frame target image as start frame, current y frames target image is end frame, record
Continuous similar frame x~y;Meanwhile, x=y+1, y=y+1 are updated, and return to the 3rd step of execution;
7th step, terminates whole process, all continuous similar frame of output record.
It should be noted that in embodiments of the present invention, can also limit under the quantity of target image in the first image sets
Limit, it is 5 for example to set numerical lower limits, then show target image quantity included in the first kind image sets of last determination not
Should be less than 5.
S304:Based on identified first kind image sets, dynamic picture is generated.
For each first kind image sets, can according to the image of each in image sets target video playing sequence
Line up, and set dynamic picture frame rate and setting whether circulate.For example, for the image in first kind image sets
1~20, frame rate can be set as 8 frames are per second, and set loop play.
If additionally, the quantity of the image included in first kind image sets is excessive, a transformation can also be set,
For example, the transformation for setting is 20, existing to include 30 two field pictures in a first kind image sets, according to playing sequence, this 30
The numbering of two field picture is respectively 1~30, then at this point it is possible to from above-mentioned First Kind Graph as group selection continuous phase 20 two field pictures,
For example:1~20,6~25,11~30.
It is appreciated that in embodiments of the present invention, although in the video-frequency band by the determination of continuous two target play moments,
Video background does not have big change, and the video-frequency band is adapted to generation dynamic picture, but this have it is certain probability, can not
Ensure that the background of all target images in video-frequency band does not change, so introducing step S301~S303, more accurately find out
Much the same those target images of background in video-frequency band.
As seen from the above, in the generation method and device of a kind of dynamic picture provided in an embodiment of the present invention, it is first determined
The target play moment of occurrence scene change in target video;Then with target play moment as cut-point, target video is drawn
It is divided into video-frequency band;Each video-frequency band for finally being obtained according to division respectively, generates dynamic picture.The embodiment of the present invention is broadcast with target
It is constantly cut-point to put, and target video is divided into multiple video-frequency bands, and each video-frequency band for marking off is and is adapted to generation dynamic
The video-frequency band of picture, compared with prior art, the embodiment of the present invention do not need training video segment model on the basis of, realize from
Video-frequency band is extracted in video, and automatically generates the purpose of dynamic picture;And the embodiment of the present invention is few to the demand of computing resource,
Directly can complete to intercept video-frequency band from video on unit to automatically generate the operation of dynamic picture.
The embodiment of the present invention is simply introduced below by an instantiation.
An existing target video, first computer can use FFmpeg tool detection scene changes timestamps, that is, determine
The target play moment of occurrence scene change in target video.
Corresponding order is:Ffmpeg-i video_path-vf'select=gt (scene, 0.4), showinfo'-
fnull-2>&1|awk-F'pts_time:″/pts_time:/ { split ($ 2, out, " ");print out[1]}'
Wherein, video_path is the path of video file.Thus obtained a timestamp list [t (0), t (1),
T (2) ...], each timestamp represents the moment that new scene starts.
In above-mentioned timestamp list, timestamp t (k) stabs t (k+1) and a video segment is determined with future time.With k
As a example by=2, it is determined that the corresponding broadcasting moment of a video-frequency band is t (2)~t (3), and the video segment is taken out using FFmpeg
Frame treatment, according to following order abstract images as target image:
Ffmpeg-y-ss start_time-t duration-i video_path-lavfi'fps=8'%04d.png
Wherein, start_time is video segment start time, that is, t (2), duration are video segment duration,
The namely difference of t (3) and t (2), video_path is the path of target video file, and %04d.png is the frame figure of generation
File name pattern.So, the filename of the target image of extraction is as follows:
0001.png、0002.png、0003.png…
Then, to the every target image extracted in the video segment, corresponding breviary is generated by following orders
Figure:
Order and be:mogrify-path thumbnail-resize 100-format png@images.txt
Wherein, mogrify is the picture processing work that a kind of ImageMagick (photo handling software) project is provided
Tool, thumbnail is thumbnail storing directory, and artwork is kept the ratio of width to height to zoom to width 100, images.txt by 100 expressions
It is input text, the every a line in file content is the path of the target image that previous step is extracted.
After generation thumbnail, thumbnail is traveled through by the playing sequence of the corresponding target image of thumbnail, use SSIM algorithms
The similarity value between current thumbnail figure and next thumbnail is calculated, if metric is more than threshold value set in advance, is recognized
For they are similar, otherwise it is assumed that dissimilar;If current thumbnail figure is similar to next thumbnail, continue more next thumbnail
The next thumbnail with, until running into dissmilarity untill.With this determination first kind image sets.
In this example, it is assumed that for video segment A, it is determined that the first kind image sets a and b, then can respectively by first
All target images generation GIF pictures in class image sets a and b.
The order of specific generation GIF pictures is:
convert-delay 1x8-loop 0@images.txt result.gif
Wherein, convert is another picture processing instrument that ImageMagick projects are provided, and 1x8 represents that GIF schemes
Delay time in piece between every frame, loop option values are that 0 expression GIF Infinite Cyclics are played, and images.txt is input text
File, every a line in file content is the path of continuous similar frame, and result.gif is exactly the GIF pictures of generation.
Corresponding to embodiment of the method shown in Fig. 1, as shown in figure 3, the embodiment of the present invention additionally provides a kind of dynamic picture
Generating means, described device includes:
Determining module 110, the target play moment for determining occurrence scene change in target video;
Division module 120, for the target play moment as cut-point, the target video being divided into video
Section;
Generation module 130, for each video-frequency band for being obtained according to division respectively, generates dynamic picture.
Corresponding to embodiment of the method shown in Fig. 2, as shown in figure 4, in actual applications, the generation module 130 can be wrapped
Include:
Determination sub-module 1301, for being directed to each video-frequency band respectively, determines target figure from the image that video-frequency band is included
Picture;
Judging submodule 1302, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band,
Judge whether every a pair adjacent target images are similar respectively;
Selection submodule 1303, for being directed to each video-frequency band respectively, according to default selection rule, from identified mesh
Image is selected in logo image, and first kind image sets are determined according to selected image;Wherein, the selection rule is:It is selected
Arbitrary neighborhood image is similar in the image selected, and the first image and the second image are dissimilar, or described first image is the video
First two field picture of section;3rd image and the 4th image are dissimilar, or the last frame that the 3rd image is the video-frequency band
Image, described first image is:The first two field picture in selected image, second image is:Described in the video-frequency band
The previous frame image of the first image, the 3rd image is:Last frame image in selected image, the 4th image
For:The latter two field picture of the 3rd image described in the video-frequency band;
Generation submodule 1304, for being directed to each video-frequency band respectively, based on identified first kind image sets, generation is dynamic
State picture.
In actual applications, the determination sub-module 1301, can be specifically for:
Abstract image is used as target image in the image included from the video-frequency band.
In actual applications, the judging submodule 1302, can include obtaining subelement, the first judgment sub-unit, the
One judges that subelement and second judges subelement (not shown):
Obtain subelement, the thumbnail for obtaining target image determined by every frame;
First judgment sub-unit, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band,
Judge whether the corresponding thumbnail of every a pair adjacent target images is similar respectively;
First judges subelement, for being in the case of being, to judge phase in the judged result of first judgment sub-unit
Adjacent target image is similar;
Second judges subelement, in the case of being no in the judged result of first judgment sub-unit, judges phase
Adjacent target image is dissimilar.
In actual applications, the judging submodule 1302, can include computation subunit, the second judgment sub-unit, the
Three judge that subelement and the 4th judges subelement (not shown):
Computation subunit, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band, difference
Calculate the similarity value between the corresponding thumbnail of every a pair adjacent target images;
Second judgment sub-unit, for judging the similarity value whether more than predetermined threshold value;
3rd judges subelement, for being in the case of being, to judge phase in the judged result of second judgment sub-unit
It is similar that adjacent target image distinguishes corresponding thumbnail;
4th judges subelement, in the case of being no in the judged result of second judgment sub-unit, judges phase
It is dissimilar that adjacent target image distinguishes corresponding thumbnail.
As seen from the above, in the generation method and device of a kind of dynamic picture provided in an embodiment of the present invention, it is first determined
The target play moment of occurrence scene change in target video;Then with target play moment as cut-point, target video is drawn
It is divided into video-frequency band;Each video-frequency band for finally being obtained according to division respectively, generates dynamic picture.The embodiment of the present invention is broadcast with target
It is constantly cut-point to put, and target video is divided into multiple video-frequency bands, and each video-frequency band for marking off is and is adapted to generation dynamic
The video-frequency band of picture, compared with prior art, the embodiment of the present invention do not need training video segment model on the basis of, realize from
Video-frequency band is extracted in video, and automatically generates the purpose of dynamic picture;And the embodiment of the present invention is few to the demand of computing resource,
Directly can complete to intercept video-frequency band from video on unit to automatically generate the operation of dynamic picture.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or deposited between operating
In any this actual relation or order.And, term " including ", "comprising" or its any other variant be intended to
Nonexcludability is included, so that process, method, article or equipment including a series of key elements not only will including those
Element, but also other key elements including being not expressly set out, or also include being this process, method, article or equipment
Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that
Also there is other identical element in process, method, article or equipment including the key element.
Each embodiment in this specification is described by the way of correlation, identical similar portion between each embodiment
Divide mutually referring to what each embodiment was stressed is the difference with other embodiment.Especially for system reality
Apply for example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
Presently preferred embodiments of the present invention is the foregoing is only, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent substitution and improvements made within the spirit and principles in the present invention etc., are all contained in protection scope of the present invention
It is interior.
Claims (10)
1. a kind of generation method of dynamic picture, it is characterised in that methods described includes:
Determine the target play moment of occurrence scene change in target video;
With the target play moment as cut-point, the target video is divided into video-frequency band;
Each video-frequency band for being obtained according to division respectively, generates dynamic picture.
2. method according to claim 1, it is characterised in that described each video-frequency band for being obtained according to division respectively, it is raw
Into dynamic picture, including:
For each video-frequency band, operations described below is performed:
Determine target image in the image included from the video-frequency band;
According to the playing sequence of each image in the video-frequency band, judge whether every a pair adjacent target images are similar respectively;
According to default selection rule, image is selected from identified target image, and determine the according to selected image
One class image sets;Wherein, the selection rule is:Arbitrary neighborhood image is similar in selected image, the first image and second
Image is dissimilar, or the first two field picture that described first image is the video-frequency band;3rd image and the 4th image are dissimilar, or
The 3rd image is the last frame image of the video-frequency band described in person, and described first image is:The first frame in selected image
Image, second image is:The previous frame image of the first image described in the video-frequency band, the 3rd image is:It is selected
Image in last frame image, the 4th image is:The latter two field picture of the 3rd image described in the video-frequency band;
Based on identified first kind image sets, dynamic picture is generated.
3. method according to claim 2, it is characterised in that target figure is determined in the image included from the video-frequency band
Picture, including:
Abstract image is used as target image in the image included from the video-frequency band.
4. method according to claim 2, it is characterised in that the broadcasting according to each image in the video-frequency band is suitable
Sequence, judges whether every a pair adjacent target images are similar respectively, including:
Obtain the thumbnail of target image determined by per frame;
According to the playing sequence of each image in the video-frequency band, the corresponding thumbnail of every a pair adjacent target images is judged respectively
It is whether similar;
If it is, judging that adjacent target image is similar;
If it has not, judging that adjacent target image is dissimilar.
5. method according to claim 4, it is characterised in that described to judge every a pair adjacent target images correspondences respectively
Thumbnail it is whether similar, including:
The similarity value between the corresponding thumbnail of every a pair adjacent target images is calculated respectively;
Judge the similarity value whether more than predetermined threshold value;
If it is, it is similar to judge that adjacent target image distinguishes corresponding thumbnail;
If it has not, it is dissimilar to judge that adjacent target image distinguishes corresponding thumbnail.
6. a kind of generating means of dynamic picture, it is characterised in that described device includes:
Determining module, the target play moment for determining occurrence scene change in target video;
Division module, for the target play moment as cut-point, the target video being divided into video-frequency band;
Generation module, for each video-frequency band for being obtained according to division respectively, generates dynamic picture.
7. device according to claim 6, it is characterised in that the generation module, including:
Determination sub-module, for being directed to each video-frequency band respectively, target image is determined from the image that video-frequency band is included;
Judging submodule, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band, judges respectively
Whether every a pair adjacent target images are similar;
Selection submodule, for being directed to each video-frequency band respectively, according to default selection rule, from identified target image
Selection image, and first kind image sets are determined according to selected image;Wherein, the selection rule is:Selected image
Middle arbitrary neighborhood image is similar, and the first image and the second image are dissimilar, or first that described first image is the video-frequency band
Two field picture;3rd image and the 4th image are dissimilar, or the last frame image that the 3rd image is the video-frequency band, described
First image is:The first two field picture in selected image, second image is:First image described in the video-frequency band
Previous frame image, the 3rd image is:Last frame image in selected image, the 4th image is:The video
The latter two field picture of the 3rd image described in section;
Generation submodule, for being directed to each video-frequency band respectively, based on identified first kind image sets, generates dynamic picture.
8. device according to claim 7, it is characterised in that the determination sub-module, specifically for:
Abstract image is used as target image in the image included from the video-frequency band.
9. device according to claim 7, it is characterised in that the judging submodule, including:
Obtain subelement, the thumbnail for obtaining target image determined by every frame;
First judgment sub-unit, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band, difference
Judge whether the corresponding thumbnail of every a pair adjacent target images is similar;
First judges subelement, for being in the case of being, to judge adjacent in the judged result of first judgment sub-unit
Target image is similar;
Second judges subelement, in the case of being no in the judged result of first judgment sub-unit, judges adjacent
Target image is dissimilar.
10. device according to claim 9, it is characterised in that the judging submodule, including:
Computation subunit, for being directed to each video-frequency band respectively, according to the playing sequence of each image in video-frequency band, calculates respectively
Similarity value between the corresponding thumbnail of every a pair adjacent target images;
Second judgment sub-unit, for judging the similarity value whether more than predetermined threshold value;
3rd judges subelement, for being in the case of being, to judge adjacent in the judged result of second judgment sub-unit
It is similar that target image distinguishes corresponding thumbnail;
4th judges subelement, in the case of being no in the judged result of second judgment sub-unit, judges adjacent
It is dissimilar that target image distinguishes corresponding thumbnail.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611245811.3A CN106686452B (en) | 2016-12-29 | 2016-12-29 | Method and device for generating dynamic picture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611245811.3A CN106686452B (en) | 2016-12-29 | 2016-12-29 | Method and device for generating dynamic picture |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106686452A true CN106686452A (en) | 2017-05-17 |
CN106686452B CN106686452B (en) | 2020-03-27 |
Family
ID=58872471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611245811.3A Active CN106686452B (en) | 2016-12-29 | 2016-12-29 | Method and device for generating dynamic picture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106686452B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107071483A (en) * | 2017-05-19 | 2017-08-18 | 北京视诀科技有限公司 | Image processing method, image processing apparatus and terminal |
CN108600864A (en) * | 2018-04-25 | 2018-09-28 | 中影数字巨幕(北京)有限公司 | A kind of preview generation method and device |
CN108632668A (en) * | 2018-05-04 | 2018-10-09 | 百度在线网络技术(北京)有限公司 | Method for processing video frequency and device |
CN108632641A (en) * | 2018-05-04 | 2018-10-09 | 百度在线网络技术(北京)有限公司 | Method for processing video frequency and device |
CN108648253A (en) * | 2018-05-08 | 2018-10-12 | 北京三快在线科技有限公司 | The generation method and device of dynamic picture |
CN108664912A (en) * | 2018-05-04 | 2018-10-16 | 北京学之途网络科技有限公司 | A kind of information processing method, device, computer storage media and terminal |
CN109672776A (en) * | 2017-10-16 | 2019-04-23 | 华为技术有限公司 | Show the method and terminal of dynamic image |
CN110659616A (en) * | 2019-09-26 | 2020-01-07 | 新华智云科技有限公司 | Method for automatically generating gif from video |
CN112492375A (en) * | 2021-01-18 | 2021-03-12 | 新东方教育科技集团有限公司 | Video processing method, storage medium, electronic device and video live broadcast system |
CN113160273A (en) * | 2021-03-25 | 2021-07-23 | 常州工学院 | Intelligent monitoring video segmentation method based on multi-target tracking |
CN113365104A (en) * | 2021-06-04 | 2021-09-07 | 中国建设银行股份有限公司 | Video concentration method and device |
CN113438538A (en) * | 2021-06-28 | 2021-09-24 | 康键信息技术(深圳)有限公司 | Short video preview method, device, equipment and storage medium |
CN114549712A (en) * | 2022-04-25 | 2022-05-27 | 北京搜狐新媒体信息技术有限公司 | Method and device for generating dynamic webp format picture |
US11968482B2 (en) | 2017-10-16 | 2024-04-23 | Huawei Technologies Co., Ltd. | Method for displaying dynamic image and terminal |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101193248A (en) * | 2006-11-21 | 2008-06-04 | 明基电通股份有限公司 | Method for sectioning image data according to scenario change |
CN101707711A (en) * | 2009-11-03 | 2010-05-12 | 上海大学 | Method for detecting tampering of video sequence by Copy-Move based on compressed domain |
CN102163201A (en) * | 2010-02-24 | 2011-08-24 | 腾讯科技(深圳)有限公司 | Multimedia file segmentation method, device thereof and code converter |
CN104184925A (en) * | 2014-09-11 | 2014-12-03 | 刘鹏 | Video scene change detection method |
CN104394422A (en) * | 2014-11-12 | 2015-03-04 | 华为软件技术有限公司 | Video segmentation point acquisition method and device |
CN105376658A (en) * | 2014-08-26 | 2016-03-02 | 无锡天脉聚源传媒科技有限公司 | Device and method for generating video file overview |
CN105827963A (en) * | 2016-03-22 | 2016-08-03 | 维沃移动通信有限公司 | Scene changing detection method during shooting process and mobile terminal |
CN105872675A (en) * | 2015-12-22 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Method and device for intercepting video animation |
CN105939483A (en) * | 2016-06-06 | 2016-09-14 | 乐视控股(北京)有限公司 | Video processing method and device |
-
2016
- 2016-12-29 CN CN201611245811.3A patent/CN106686452B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101193248A (en) * | 2006-11-21 | 2008-06-04 | 明基电通股份有限公司 | Method for sectioning image data according to scenario change |
CN101707711A (en) * | 2009-11-03 | 2010-05-12 | 上海大学 | Method for detecting tampering of video sequence by Copy-Move based on compressed domain |
CN102163201A (en) * | 2010-02-24 | 2011-08-24 | 腾讯科技(深圳)有限公司 | Multimedia file segmentation method, device thereof and code converter |
CN105376658A (en) * | 2014-08-26 | 2016-03-02 | 无锡天脉聚源传媒科技有限公司 | Device and method for generating video file overview |
CN104184925A (en) * | 2014-09-11 | 2014-12-03 | 刘鹏 | Video scene change detection method |
CN104394422A (en) * | 2014-11-12 | 2015-03-04 | 华为软件技术有限公司 | Video segmentation point acquisition method and device |
CN105872675A (en) * | 2015-12-22 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Method and device for intercepting video animation |
CN105827963A (en) * | 2016-03-22 | 2016-08-03 | 维沃移动通信有限公司 | Scene changing detection method during shooting process and mobile terminal |
CN105939483A (en) * | 2016-06-06 | 2016-09-14 | 乐视控股(北京)有限公司 | Video processing method and device |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107071483A (en) * | 2017-05-19 | 2017-08-18 | 北京视诀科技有限公司 | Image processing method, image processing apparatus and terminal |
CN109672776A (en) * | 2017-10-16 | 2019-04-23 | 华为技术有限公司 | Show the method and terminal of dynamic image |
US11431951B2 (en) | 2017-10-16 | 2022-08-30 | Huawei Technologies Co., Ltd. | Method for displaying dynamic image and terminal |
US11968482B2 (en) | 2017-10-16 | 2024-04-23 | Huawei Technologies Co., Ltd. | Method for displaying dynamic image and terminal |
CN108600864B (en) * | 2018-04-25 | 2020-08-28 | 中影数字巨幕(北京)有限公司 | Movie preview generation method and device |
CN108600864A (en) * | 2018-04-25 | 2018-09-28 | 中影数字巨幕(北京)有限公司 | A kind of preview generation method and device |
CN108664912A (en) * | 2018-05-04 | 2018-10-16 | 北京学之途网络科技有限公司 | A kind of information processing method, device, computer storage media and terminal |
CN108632641A (en) * | 2018-05-04 | 2018-10-09 | 百度在线网络技术(北京)有限公司 | Method for processing video frequency and device |
CN108632668A (en) * | 2018-05-04 | 2018-10-09 | 百度在线网络技术(北京)有限公司 | Method for processing video frequency and device |
CN108648253A (en) * | 2018-05-08 | 2018-10-12 | 北京三快在线科技有限公司 | The generation method and device of dynamic picture |
CN108648253B (en) * | 2018-05-08 | 2019-08-20 | 北京三快在线科技有限公司 | The generation method and device of dynamic picture |
US11257270B2 (en) | 2018-05-08 | 2022-02-22 | Beijing Sankuai Online Technology Co., Ltd | Generation of dynamic picture sequence |
CN110659616A (en) * | 2019-09-26 | 2020-01-07 | 新华智云科技有限公司 | Method for automatically generating gif from video |
CN112492375A (en) * | 2021-01-18 | 2021-03-12 | 新东方教育科技集团有限公司 | Video processing method, storage medium, electronic device and video live broadcast system |
CN113160273A (en) * | 2021-03-25 | 2021-07-23 | 常州工学院 | Intelligent monitoring video segmentation method based on multi-target tracking |
CN113365104A (en) * | 2021-06-04 | 2021-09-07 | 中国建设银行股份有限公司 | Video concentration method and device |
CN113365104B (en) * | 2021-06-04 | 2022-09-09 | 中国建设银行股份有限公司 | Video concentration method and device |
CN113438538A (en) * | 2021-06-28 | 2021-09-24 | 康键信息技术(深圳)有限公司 | Short video preview method, device, equipment and storage medium |
CN113438538B (en) * | 2021-06-28 | 2023-02-10 | 康键信息技术(深圳)有限公司 | Short video preview method, device, equipment and storage medium |
CN114549712A (en) * | 2022-04-25 | 2022-05-27 | 北京搜狐新媒体信息技术有限公司 | Method and device for generating dynamic webp format picture |
CN114549712B (en) * | 2022-04-25 | 2022-07-12 | 北京搜狐新媒体信息技术有限公司 | Method and device for generating dynamic webp format picture |
Also Published As
Publication number | Publication date |
---|---|
CN106686452B (en) | 2020-03-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106686452A (en) | Dynamic picture generation method and device | |
CN107707931B (en) | Method and device for generating interpretation data according to video data, method and device for synthesizing data and electronic equipment | |
CN104394422B (en) | A kind of Video segmentation point acquisition methods and device | |
WO2020220968A1 (en) | Video data processing method and related device | |
CN104618803B (en) | Information-pushing method, device, terminal and server | |
CN103761284B (en) | A kind of video retrieval method and system | |
CN103797783B (en) | Comment information generating means and comment information generation method | |
CN111540055B (en) | Three-dimensional model driving method, three-dimensional model driving device, electronic equipment and storage medium | |
WO2022184117A1 (en) | Deep learning-based video clipping method, related device, and storage medium | |
CN107222795B (en) | Multi-feature fusion video abstract generation method | |
US8897603B2 (en) | Image processing apparatus that selects a plurality of video frames and creates an image based on a plurality of images extracted and selected from the frames | |
CN111464834B (en) | Video frame processing method and device, computing equipment and storage medium | |
CN112367551B (en) | Video editing method and device, electronic equipment and readable storage medium | |
CN108769733A (en) | Video clipping method and video clipping device | |
JPWO2012137493A1 (en) | Image processing apparatus, image processing method, image processing program, and integrated circuit | |
CN107430780B (en) | Method for output creation based on video content characteristics | |
KR102252730B1 (en) | Apparatus and methdo for generating animation | |
CN111757175A (en) | Video processing method and device | |
KR101642200B1 (en) | Apparatus and method for generating motion effects by analyzing motion of object | |
US10924637B2 (en) | Playback method, playback device and computer-readable storage medium | |
CN113207038B (en) | Video processing method, video processing device and electronic equipment | |
Kumano et al. | Video editing support system based on video grammar and content analysis | |
CN109299777B (en) | Data processing method and system based on artificial intelligence | |
CN108320331A (en) | A kind of method and apparatus for the augmented reality video information generating user's scene | |
CN113269854B (en) | Method for intelligently generating interview-type comprehensive programs |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |