WO2022033137A1 - Method for generating gif file on basis of hand-drawn video - Google Patents

Method for generating gif file on basis of hand-drawn video Download PDF

Info

Publication number
WO2022033137A1
WO2022033137A1 PCT/CN2021/098207 CN2021098207W WO2022033137A1 WO 2022033137 A1 WO2022033137 A1 WO 2022033137A1 CN 2021098207 W CN2021098207 W CN 2021098207W WO 2022033137 A1 WO2022033137 A1 WO 2022033137A1
Authority
WO
WIPO (PCT)
Prior art keywords
animation
scene
interval
hand
filling
Prior art date
Application number
PCT/CN2021/098207
Other languages
French (fr)
Chinese (zh)
Inventor
邵猛
魏博
Original Assignee
深圳市前海手绘科技文化有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市前海手绘科技文化有限公司 filed Critical 深圳市前海手绘科技文化有限公司
Publication of WO2022033137A1 publication Critical patent/WO2022033137A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Definitions

  • the invention belongs to the technical field of animation rendering, and in particular relates to a method, device, electronic device and storage medium for generating a GIF file based on a hand-drawn video.
  • the existing technology mainly converts video files such as MP4 into GIF files through video format tools or generates GIF files through direct recording. accomplish.
  • the video format tool conversion method or the direct recording and generating GIF method can meet the deficiencies of special video scene adjustment, and at the same time take into account the use and dissemination of video files, however, the number of frames and file size of the GIF files generated in this way are large, resulting in consumption of drawing performance. high.
  • the present invention provides a method for generating GIF files based on hand-painted videos.
  • the GIF files generated by the method can effectively reduce the number of frames and file volume, reduce the consumption of drawing performance, and are beneficial to the use and dissemination of video files. .
  • a method for generating a GIF file based on a hand-drawn video comprising the following steps:
  • the scene animation is filled with animation frames according to the animation duration, and interval frames are filled according to the number of intervals.
  • the step of filling animation frames to the scene animation includes:
  • the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
  • the scene animation is a hand-drawn animation
  • the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
  • the animation frame can be filled to Fill the fixed area of the background, form a full call and use of the fixed area of the filled background, avoid a large number of area calculations before filling, and save computing resources.
  • the use of filling the fixed area of the background also reduces the animation volume and reduces the drawing performance consumption.
  • the step of filling animation frames to the scene animation includes:
  • the scene animation is a dynamic animation
  • the scene animation is a dynamic animation
  • the last frame of the image before the start of the dynamic animation is used as the filling background, and the animation area is calculated in each frame of the dynamic animation to fill the animation frame. to the calculated animation area, so that the complete animation at the beginning of the animation is preserved, and the animation area of each frame of animation is updated.
  • the step of filling animation frames to the scene animation includes:
  • the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
  • the scene animation is a dynamic animation
  • the described step of filling interval frames according to the number of intervals includes:
  • the number of intervals is counted to fill the interval frame.
  • the animation duration is a default duration or a user-specified duration.
  • the animation duration provides the option of default duration or user-specified duration. You can preset an appropriate animation volume under the default duration, or meet the user's personalized needs for animation volume under the user-specified duration.
  • the non-animation interval duration output is displayed for the user to select and configure the filling interval frame.
  • the scene animation includes filling the background
  • the interval frame includes a start time and an end time.
  • the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
  • the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed in the processor to implement any one of the above methods.
  • the present invention provides a storage medium storing a computer program, the computer program being executed in a processor to implement any of the above methods.
  • the present invention provides a kind of GIF file generation device based on hand-painted video, including:
  • the reading module is used to read the scene animation in the hand-drawn video project
  • a calculation module for calculating the animation duration of the scene animation and the interval between the scene animations
  • a filling module configured to fill animation frames into the scene animation according to the animation duration, and fill interval frames according to the number of intervals.
  • the filling module includes:
  • a hand-drawn animation judgment unit used for judging whether the scene animation is a hand-drawn animation
  • the first filling unit is configured to use the last frame of image before the start of the hand-drawn animation as a filling background if the scene animation is a hand-drawn animation, so as to fill the animation frame into a designated area of the image.
  • the filling module includes:
  • a dynamic animation judging unit for judging whether the scene animation is a dynamic animation
  • the second filling unit is configured to, if the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as a filling background, and calculate the animation area in each frame of the dynamic animation to fill the Animation frames to the specified area of the image.
  • Interval duration acquisition unit which acquires the non-animation interval duration between any two adjacent scene animations
  • the interval frame filling unit is used for outputting and displaying the non-animation interval duration, so as to allow the user to choose and configure the interval frame filling.
  • a changing unit configured to receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
  • Jumping unit when filling data information and/or control information to each frame in the GIF file based on the interval frame, skip the non-animated interval in the GIF file;
  • the interval frame includes a start time and an end time.
  • the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
  • the method for generating a GIF file based on a hand-drawn video provided by the present invention, by reading the scene animation in the hand-drawn video project, calculating the animation duration of the scene animation and the interval between the scene animation, according to the animation duration to the scene animation
  • the scene animation fills the animation frames, and fills the interval frames according to the number of the intervals, which can effectively reduce the number of frames and the file volume, reduce the consumption of drawing performance, and is beneficial to the use and dissemination of video files.
  • FIG. 1 is a flowchart of a method for generating a GIF file based on a hand-drawn video provided by an embodiment
  • Fig. 2 is a module architecture diagram corresponding to the method of Fig. 1 provided by an embodiment
  • Fig. 3 is the schematic diagram to the hand-painted video project among Fig. 1;
  • FIG. 5 is a module architecture diagram corresponding to the method of FIG. 4 according to an embodiment.
  • the term “storage medium” may be various media that can store computer programs, such as ROM, RAM, magnetic disk or optical disk.
  • the term "processor” can be CPLD (Complex Programmable Logic Device: Complex Programmable Logic Device), FPGA (Field-Programmable Gate Array: Field Programmable Gate Array), MCU (Microcontroller Unit: Micro Control Unit), PLC (Programmable Logic) Controller: programmable logic controller) and CPU (Central Processing Unit: central processing unit) and other chips or circuits with data processing functions.
  • electronic device may be any device with data processing and storage functions, and may generally include both stationary and mobile terminals. Fixed terminals such as desktops, etc. Mobile terminals such as mobile phones, PADs and mobile robots. In addition, the technical features involved in the different embodiments of the present invention described later can be combined with each other as long as there is no conflict with each other.
  • the present embodiment provides a method for generating a GIF file based on a hand-drawn video, comprising the following steps:
  • the present embodiment provides a device for generating a GIF file based on a hand-drawn video, including:
  • the reading module 1 is used to read the scene animation in the hand-painted video project
  • Calculation module 2 for calculating the animation duration of the scene animation and the interval between the scene animation
  • Filling module 3 configured to fill animation frames to the scene animation according to the animation duration, and fill interval frames according to the number of intervals.
  • a hand-drawn video project refers to a project created to generate a hand-drawn video file (eg, MP4 format file), and the project consists of a project configuration file and a corresponding resource file.
  • the configuration file contains multiple scenes, and each scene includes multiple animations.
  • each scene page contains animation information of animation elements
  • the resource file saves the corresponding resource file in units of scene pages.
  • each scene animation has a duration
  • each scene animation also has a duration.
  • the duration of the scene animation and the duration between the scene animations may be default values or values specified by the user. Because the corresponding screen area and duration are required when GIF is exported, if the user makes the corresponding designation, it can be based on the user's designation. If the user does not designate it, the default data of the current hand-drawn video project is used.
  • Image frame refers to the component of GIF file, which includes image data and control data in addition to the file header.
  • Image data refers to the pixel composition, that is, the image of the current frame.
  • Control data refers to the delay time of the current frame relative to the previous frame.
  • the delay time of each frame is equal, it can be simply understood as having a fixed frame rate of equal length; if the delay of each frame is unequal, it is understood as an unequal frame rate.
  • the advantage of this is that in some pictures If there is no change for a period of time, the number of frames can be saved, file size and drawing performance consumption can be reduced.
  • the resolution of the scene animation can also be calculated, and the resolution refers to the size of the animation scene.
  • the resolution can default to the full size of the scene animation, or it can be a user-specified partial size of the scene animation.
  • the resolution can not only meet the user's production requirements for scene animation, but also reduce the number of frames and animation volume.
  • the transparency requirements specified by the user can also be read. If the transparency is specified to be retained, the animation background will be processed as a transparent channel when processing subsequent data to reduce the number of frames and animation volume.
  • the animation frame is inserted into the animation part to form an animation
  • the interval frame is inserted into the interval part to form a continuous animation.
  • the function of interval frames is to separate adjacent animations, which can effectively reduce the number of frames and animation volume, reduce the consumption of drawing performance, and is conducive to the use and dissemination of video files.
  • the step of filling the interval frames according to the number of intervals includes: calculating the number of the intervals according to the start point and the end point of each interval, and filling the interval frames.
  • the number of intervals can be accurately calculated, so as to ensure that the interval frames can be filled in the interval, which can effectively reduce the number of frames and animation volume as a whole, reduce the consumption of drawing performance, and is conducive to the improvement of video files. use and dissemination.
  • the animation duration is a default duration or a user-specified duration.
  • the animation duration provides the option of a default duration or a user-specified duration.
  • An appropriate animation volume can be preset under the default duration, or the user's personalized needs for the animation volume can be met under the user-specified duration.
  • the present embodiment provides a step of filling animation frames into scene animation, including:
  • the scene animation is a hand-drawn animation
  • the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
  • this embodiment provides a filling module, including:
  • a hand-drawn animation judgment unit used to judge whether the scene animation is a hand-drawn animation
  • the first filling unit is used for filling the animation frame to the designated area of the image by using the last frame of image before the start of the hand-drawn animation as the filling background if the scene animation is a hand-drawn animation.
  • a dynamic animation judgment unit used for judging whether the scene animation is a dynamic animation
  • the second filling unit is used for if the scene animation is a dynamic animation, the last frame of the image before the start of the dynamic animation is used as the filling background, and the animation area is calculated in each frame of the dynamic animation to fill the animation frame to the designated area of the image .
  • hand-drawn animation is an animation in which the position does not change, and the animation gradually appears in the form of hand-drawn.
  • Dynamic animation is an animation of position changes, such as moving, rotating, scaling, etc.
  • the animation frame can be Fill to the fixed area of the filled background to form a full call and use of the fixed area of the filled background, avoid a large number of area calculations before filling, and save computing resources.
  • the type of scene animation is distinguished.
  • the scene animation is a hand-drawn animation
  • the fixed area is filled
  • the scene animation is a dynamic animation
  • the dynamic area is filled, so as to fully call and use the fixed area of the filled background to avoid The area calculation before a large number of filling saves computing resources.
  • the use of the fixed area of the filled background also reduces the animation volume and the consumption of drawing performance.
  • the use of the dynamic area of the filled background allows the complete animation at the beginning of the animation to be preserved, and the animation area of each frame of animation can be dynamically updated.
  • the non-animation interval duration output is displayed for the user to select and configure the filling interval frame.
  • the no-animation interval duration is output and displayed for the user to choose and configure the filling interval frame.
  • the interval frames can be optionally filled to suit a variety of situations.
  • the scene animation includes filling the background
  • the transparency can be changed when the hand-drawn video is made into a GIF file, so that the generated GIF file has the desired transparency.
  • the interval frame includes a start time and an end time.
  • the scene animation can be filled with the corresponding filling data information and/or control information, and there is no need to fill the non-animation interval, which effectively reduces the size of the GIF file.
  • filling data information and ⁇ or control information it will be According to the start time and end time of the interval frame, confirm the corresponding non-animation interval and perform skip processing.
  • the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
  • the exported GIF file is a GIF file without an animation interval, although its resolution is the same as that of the hand-drawn video. However, the amount of data is smaller than that of a complete hand-drawn video.
  • Interval duration acquisition unit to obtain the non-animation interval duration between any two adjacent scene animations; in the process of determining the non-animation interval duration, you can calculate all the animations in the entire hand-drawn animation process according to the element animation type and the entry and exit time of the element. No animation interval.
  • the interval frame filling unit is used for outputting and displaying the non-animation interval duration, so as to allow the user to choose and configure the interval frame filling.
  • the duration of no animation interval is output and displayed for the user to choose and configure the filling interval frame.
  • the interval frames can be optionally filled to suit a variety of situations.
  • the scene animation includes filling the background
  • a changing unit configured to receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
  • the transparency can be changed when the hand-drawn video is made into a GIF file, so that the generated GIF file has the desired transparency.
  • Jumping unit when filling data information and/or control information to each frame in the GIF file based on the interval frame, skip the non-animated interval in the GIF file;
  • the interval frame includes a start time and an end time.
  • the scene animation can be filled with the corresponding filling data information and/or control information, and there is no need to fill the non-animation interval, which effectively reduces the size of the GIF file.
  • filling the data information and ⁇ or control information it will be According to the start time and end time of the interval frame, confirm the corresponding non-animation interval and perform skip processing.
  • the technical solution provided by the present invention also includes a generating unit for performing the following steps, including:
  • the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
  • the exported GIF file is a GIF file without an animation interval, although its resolution is the same as that of the hand-drawn video. However, the amount of data is smaller than that of a complete hand-drawn video.
  • the methods involved in the above embodiments may be implemented in the form of computer programs.
  • the computer program for implementing the methods in the above embodiments may be executed in an electronic device or stored in a storage medium.
  • an electronic device includes a memory and a processor.
  • the memory stores a computer program, and the computer program is executed by the processor to implement the methods involved in the above embodiments.
  • a storage medium stores a computer program, and the computer program is executed in the processor to implement the methods involved in the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

A method for generating a GIF file on the basis of a hand-drawn video, which method belongs to the technical field of hand-drawn videos. The method comprises: reading scene animations from a hand-drawn video item (S1); calculating animation durations of the scene animations and intervals between the scene animations (S2); and filling the scene animations with animation frames according to the animation durations, and filling the scene animations with interval frames according to the number of intervals (S3). As such, the number of frames and the file volume can be effectively reduced, and drawing performance depletion is reduced, thereby facilitating the use and propagation of video files.

Description

一种基于手绘视频的GIF文件生成方法A method for generating GIF files based on hand-drawn video 技术领域technical field
本发明属于动画渲染技术领域,尤其涉及一种基于手绘视频的GIF文件生成方法、装置、电子设备和存储介质。The invention belongs to the technical field of animation rendering, and in particular relates to a method, device, electronic device and storage medium for generating a GIF file based on a hand-drawn video.
背景技术Background technique
由于视频文件形式易于传播,播放过程中不需要额外控制和适配操作,因此目前的手绘视频创作编辑,最终都是以视频文件形式存在。但是,在需要去除视频播放控制按钮,或调整特殊宽高比例,或利用透明度做图层叠加等特殊视频场景调整时,视频文件不能满足需求。Since the video file format is easy to spread, no additional control and adaptation operations are required during the playback process, so the current hand-drawn video creation and editing ultimately exists in the form of video files. However, when you need to remove the video playback control buttons, adjust special aspect ratios, or use transparency for layer overlays and other special video scene adjustments, video files cannot meet the needs.
为了克服视频文件不能满足特殊视频场景调整的缺陷,同时兼顾视频文件的使用和传播,现有技术,主要通过视频格式工具把MP4等视频文件转换为GIF文件或通过直接的录制方式生成GIF文件来实现。In order to overcome the defect that video files cannot meet the adjustment of special video scenes, and at the same time take into account the use and dissemination of video files, the existing technology mainly converts video files such as MP4 into GIF files through video format tools or generates GIF files through direct recording. accomplish.
虽然,视频格式工具转换方式或直接录制生成GIF方式可以满足特殊视频场景调整的缺陷,同时兼顾视频文件的使用和传播,但是,如此生成的GIF文件帧数和文件体积较大,造成绘制性能消耗高。Although the video format tool conversion method or the direct recording and generating GIF method can meet the deficiencies of special video scene adjustment, and at the same time take into account the use and dissemination of video files, however, the number of frames and file size of the GIF files generated in this way are large, resulting in consumption of drawing performance. high.
发明内容SUMMARY OF THE INVENTION
为解决上述技术缺陷,本发明提供一种基于手绘视频的GIF文件生成方法,该方法生成的GIF文件,能够有效减小帧数和文件体积,降低绘制性能消耗,有利于视频文件的使用和传播。In order to solve the above-mentioned technical defects, the present invention provides a method for generating GIF files based on hand-painted videos. The GIF files generated by the method can effectively reduce the number of frames and file volume, reduce the consumption of drawing performance, and are beneficial to the use and dissemination of video files. .
一种基于手绘视频的GIF文件生成方法,包括如下步骤:A method for generating a GIF file based on a hand-drawn video, comprising the following steps:
读取手绘视频项目中的场景动画;Read scene animations in hand-drawn video projects;
计算所述场景动画的动画时长和所述场景动画之间的间隔;Calculate the animation duration of the scene animation and the interval between the scene animations;
根据所述动画时长向所述场景动画填充动画帧,根据所述间隔的数量填充间隔帧。The scene animation is filled with animation frames according to the animation duration, and interval frames are filled according to the number of intervals.
技术效果说明:在手绘视频项目中,可以提取多个场景中任意场景的动画,再将任意场景的动画进行间隔统计,区分出动画部分和间隔部分,对动画部分***动画帧形成动画,对间隔部分***间隔帧连续动画。间隔帧作用在于间隔相邻动画,能够有效减小帧数和动画体积,降低绘制性能消耗,有利于视频文件的使用和传播。Technical effect description: In the hand-painted video project, you can extract the animation of any scene in multiple scenes, and then perform interval statistics on the animation of any scene, distinguish the animation part and the interval part, insert animation frames into the animation part to form animation, and analyze the interval. Partially insert interval frames for continuous animation. The function of interval frames is to separate adjacent animations, which can effectively reduce the number of frames and animation volume, reduce the consumption of drawing performance, and is conducive to the use and dissemination of video files.
改进的,所述的向所述场景动画填充动画帧的步骤包括:Improved, the step of filling animation frames to the scene animation includes:
判断所述场景动画是否为手绘动画;Determine whether the scene animation is a hand-drawn animation;
如果所述场景动画为手绘动画,则以所述手绘动画开始前的最后一帧图像作为填充背景,以填充所述动画帧到图像指定区域。If the scene animation is a hand-drawn animation, the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
技术效果说明:对场景动画进行类型区分,在场景动画为手绘动画的情况下,以手绘动画开始前的最后一帧图像作为填充背景,以填充动画帧到图像指定区域,可以将动画帧填充到填充背景的固定区域,形成对填充背景固定区域的充分调取使用,避免大量填充前的区域计算,节约计算资源。另外,对填充背景固定区域的使用也减小了动画体积,降低绘制性能消耗。Technical effect description: Differentiate the type of scene animation. If the scene animation is a hand-drawn animation, the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image. The animation frame can be filled to Fill the fixed area of the background, form a full call and use of the fixed area of the filled background, avoid a large number of area calculations before filling, and save computing resources. In addition, the use of filling the fixed area of the background also reduces the animation volume and reduces the drawing performance consumption.
改进的,所述的向所述场景动画填充动画帧的步骤包括:Improved, the step of filling animation frames to the scene animation includes:
判断所述场景动画是否为动态动画;Determine whether the scene animation is a dynamic animation;
如果所述场景动画为动态动画,则以所述动态动画开始前的最后一帧图像作为填充背景,在所述动态动画每一帧中计算动画区域,以填充所述动画帧到计算得到的动画区域。If the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as the filling background, and calculate the animation area in each frame of the dynamic animation to fill the animation frame to the calculated animation area.
技术效果说明:对场景动画进行类型区分,在场景动画为动态动画的情况下,以动态动画开始前的最后一帧图像作为填充背景,在动态动画每一帧中计算动画区域,以填充动画帧到计算得到的动画区 域,从而使得动画开始时的完整动画得以保留,每一帧动画的动画区域得以更新。Technical effect description: Differentiate the type of scene animation. When the scene animation is a dynamic animation, the last frame of the image before the start of the dynamic animation is used as the filling background, and the animation area is calculated in each frame of the dynamic animation to fill the animation frame. to the calculated animation area, so that the complete animation at the beginning of the animation is preserved, and the animation area of each frame of animation is updated.
改进的,所述的向所述场景动画填充动画帧的步骤包括:Improved, the step of filling animation frames to the scene animation includes:
判断所述场景动画是否为手绘动画;Determine whether the scene animation is a hand-drawn animation;
如果所述场景动画为手绘动画,则以所述手绘动画开始前的最后一帧图像作为填充背景,以填充所述动画帧到图像指定区域。If the scene animation is a hand-drawn animation, the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
判断所述场景动画是否为动态动画;Determine whether the scene animation is a dynamic animation;
如果所述场景动画为动态动画,则以所述动态动画开始前的最后一帧图像作为填充背景,在所述动态动画每一帧中计算动画区域,以填充所述动画帧到计算得到的动画区域。If the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as the filling background, and calculate the animation area in each frame of the dynamic animation to fill the animation frame to the calculated animation area.
技术效果说明:对场景动画进行类型区分,在场景动画为手绘动画时进行固定区域填充,在场景动画为动态动画时进行动态区域填充,形成对填充背景固定区域的充分调取使用,避免大量填充前的区域计算,节约计算资源。另外,对填充背景固定区域的使用也减小了动画体积,降低绘制性能消耗,对填充背景动态区域的使用,使得动画开始时的完整动画得以保留,每一帧动画的动画区域得以动态更新。Technical effect description: Differentiate the types of scene animations, fill in fixed areas when the scene animations are hand-drawn animations, and fill in dynamic areas when the scene animations are dynamic animations, so as to fully call and use the fixed areas of the filled background and avoid a lot of filling The previous regional calculation saves computing resources. In addition, the use of the fixed area of the filled background also reduces the animation volume and the consumption of drawing performance. The use of the dynamic area of the filled background allows the complete animation at the beginning of the animation to be preserved, and the animation area of each frame of animation can be dynamically updated.
改进的,所述的根据所述间隔的数量填充间隔帧的步骤包括:Improved, the described step of filling interval frames according to the number of intervals includes:
根据每个所述间隔的起点和终点,计算所述间隔的数量,填充所述间隔帧。From the start and end points of each of the intervals, the number of intervals is counted to fill the interval frame.
技术效果说明:通过间隔起点和终点的统计,可以精确计算得到间隔数量,从而确保间隔内都能填充间隔帧,能够从整体上有效减小帧数和动画体积,降低绘制性能消耗,有利于视频文件的使用和传播。Technical effect description: Through the statistics of the start and end points of the interval, the number of intervals can be accurately calculated, so as to ensure that the interval frames can be filled in the interval, which can effectively reduce the number of frames and animation volume as a whole, and reduce the consumption of drawing performance, which is beneficial to video. Use and dissemination of documents.
改进的,所述动画时长为默认时长或用户指定时长。Improved, the animation duration is a default duration or a user-specified duration.
技术效果说明:动画时长提供默认时长或用户指定时长的选项, 可以在默认时长情况下预设适当的动画体积,也可以在用户指定时长情况下满足用户对动画体积的个性化需求。Technical effect description: The animation duration provides the option of default duration or user-specified duration. You can preset an appropriate animation volume under the default duration, or meet the user's personalized needs for animation volume under the user-specified duration.
改进的,还包括:Improved, also includes:
获取任意两个相邻场景动画之间的无动画间隔时长;Get the no-animation interval between any two adjacent scene animations;
将所述无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。The non-animation interval duration output is displayed for the user to select and configure the filling interval frame.
改进的,还包括:Improved, also includes:
所述场景动画包括填充背景;the scene animation includes filling the background;
接收输入的透明度信息,基于所述透明度信息对所述填充背景做透明通道处理。Receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
改进的,还包括:Improved, also includes:
在基于所述间隔帧对GIF文件中的每一帧填充数据信息和\或控制信息时,跳过GIF文件中的无动画区间;When each frame in the GIF file is filled with data information and/or control information based on the interval frame, skip the no-animation interval in the GIF file;
所述间隔帧包括起始时刻和结束时刻。The interval frame includes a start time and an end time.
改进的,还包括:Improved, also includes:
读取用户在手绘视频中指定的导出区域、分辨率和导出场景页范围,生成GIF文件。Read the export area, resolution and export scene page range specified by the user in the hand-drawn video, and generate a GIF file.
若用户未指定导出区域和分辨率,则生成的GIF文件默认导出全部场景页的完整区域并且分辨率为手绘视频的区域实际尺寸。If the user does not specify the export area and resolution, the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
另外,本发明提供一种电子设备,包括存储器和处理器,所述存储器存储计算机程序,所述计算机程序在所述处理器中执行可实现上述任一种方法。In addition, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed in the processor to implement any one of the above methods.
另外,本发明提供一种存储介质,存储计算机程序,所述计算机程序在处理器中执行可实现上述任一种方法。In addition, the present invention provides a storage medium storing a computer program, the computer program being executed in a processor to implement any of the above methods.
对应的,本发明提供一种基于手绘视频的GIF文件生成装置,包 括:Correspondingly, the present invention provides a kind of GIF file generation device based on hand-painted video, including:
读取模块,用于读取手绘视频项目中的场景动画;The reading module is used to read the scene animation in the hand-drawn video project;
计算模块,用于计算所述场景动画的动画时长和所述场景动画之间的间隔;a calculation module for calculating the animation duration of the scene animation and the interval between the scene animations;
填充模块,用于根据所述动画时长向所述场景动画填充动画帧,根据所述间隔的数量填充间隔帧。A filling module, configured to fill animation frames into the scene animation according to the animation duration, and fill interval frames according to the number of intervals.
改进的,所述填充模块包括:Improved, the filling module includes:
手绘动画判断单元,用于判断所述场景动画是否为手绘动画;A hand-drawn animation judgment unit, used for judging whether the scene animation is a hand-drawn animation;
第一填充单元,用于如果所述场景动画为手绘动画,则以所述手绘动画开始前的最后一帧图像作为填充背景,以填充所述动画帧到图像指定区域。The first filling unit is configured to use the last frame of image before the start of the hand-drawn animation as a filling background if the scene animation is a hand-drawn animation, so as to fill the animation frame into a designated area of the image.
改进的,所述填充模块包括:Improved, the filling module includes:
动态动画判断单元,用于判断所述场景动画是否为动态动画;a dynamic animation judging unit for judging whether the scene animation is a dynamic animation;
第二填充单元,用于如果所述场景动画为动态动画,则以所述动态动画开始前的最后一帧图像作为填充背景,在所述动态动画每一帧中计算动画区域,以填充所述动画帧到图像指定区域。The second filling unit is configured to, if the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as a filling background, and calculate the animation area in each frame of the dynamic animation to fill the Animation frames to the specified area of the image.
改进的,还包括:Improved, also includes:
间隔时长获取单元,获取任意两个相邻场景动画之间的无动画间隔时长;Interval duration acquisition unit, which acquires the non-animation interval duration between any two adjacent scene animations;
间隔帧填充单元,用于将所述无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。The interval frame filling unit is used for outputting and displaying the non-animation interval duration, so as to allow the user to choose and configure the interval frame filling.
改进的,还包括:Improved, also includes:
改变单元,用于接收输入的透明度信息,基于所述透明度信息对所述填充背景做透明通道处理。A changing unit, configured to receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
改进的,还包括:Improved, also includes:
跳跃单元,用于在基于所述间隔帧对GIF文件中的每一帧填充数据信息和\或控制信息时,跳过GIF文件中的无动画区间;Jumping unit, when filling data information and/or control information to each frame in the GIF file based on the interval frame, skip the non-animated interval in the GIF file;
所述间隔帧包括起始时刻和结束时刻。The interval frame includes a start time and an end time.
改进的,还包括生成单元,用于执行以下步骤,包括:Improved, also comprising a generating unit for performing the following steps, including:
读取用户在手绘视频中指定的导出区域、分辨率和导出场景页范围,生成GIF文件。Read the export area, resolution and export scene page range specified by the user in the hand-drawn video, and generate a GIF file.
若用户未指定导出区域和分辨率,则生成的GIF文件默认导出全部场景页的完整区域并且分辨率为手绘视频的区域实际尺寸。If the user does not specify the export area and resolution, the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
本发明提供的基于手绘视频的GIF文件生成方法,通过读取手绘视频项目中的场景动画,计算所述场景动画的动画时长和所述场景动画之间的间隔,根据所述动画时长向所述场景动画填充动画帧,根据所述间隔的数量填充间隔帧,能够有效减小帧数和文件体积,降低绘制性能消耗,有利于视频文件的使用和传播。The method for generating a GIF file based on a hand-drawn video provided by the present invention, by reading the scene animation in the hand-drawn video project, calculating the animation duration of the scene animation and the interval between the scene animation, according to the animation duration to the scene animation The scene animation fills the animation frames, and fills the interval frames according to the number of the intervals, which can effectively reduce the number of frames and the file volume, reduce the consumption of drawing performance, and is beneficial to the use and dissemination of video files.
附图说明Description of drawings
图1为一实施例提供的基于手绘视频的GIF文件生成方法的流程图;1 is a flowchart of a method for generating a GIF file based on a hand-drawn video provided by an embodiment;
图2为一实施例提供的与图1方法对应的模块架构图;Fig. 2 is a module architecture diagram corresponding to the method of Fig. 1 provided by an embodiment;
图3为对图1中手绘视频项目的示意图;Fig. 3 is the schematic diagram to the hand-painted video project among Fig. 1;
图4为一实施例提供的向场景动画填充动画帧的流程图;4 is a flowchart of filling animation frames to scene animation provided by an embodiment;
图5为一实施例提供的与图4方法对应的模块架构图。FIG. 5 is a module architecture diagram corresponding to the method of FIG. 4 according to an embodiment.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,在本发明的描述中,除非另有明确的规定和限定,术语“存储介质”可以是 ROM、RAM、磁碟或者光盘等各种可以存储计算机程序的介质。术语“处理器”可以是CPLD(Complex Programmable Logic Device:复杂可编程逻辑器件)、FPGA(Field-Programmable Gate Array:现场可编程门阵列)、MCU(Microcontroller Unit:微控制单元)、PLC(Programmable Logic Controller:可编程逻辑控制器)以及CPU(Central Processing Unit:中央处理器)等具备数据处理功能的芯片或电路。术语“电子设备”可以是具有数据处理功能和存储功能的任何设备,通常可以包括固定终端和移动终端。固定终端如台式机等。移动终端如手机、PAD以及移动机器人等。此外,后续所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that in the description of the present invention, unless otherwise expressly specified and limited, the term "storage medium" may be various media that can store computer programs, such as ROM, RAM, magnetic disk or optical disk. The term "processor" can be CPLD (Complex Programmable Logic Device: Complex Programmable Logic Device), FPGA (Field-Programmable Gate Array: Field Programmable Gate Array), MCU (Microcontroller Unit: Micro Control Unit), PLC (Programmable Logic) Controller: programmable logic controller) and CPU (Central Processing Unit: central processing unit) and other chips or circuits with data processing functions. The term "electronic device" may be any device with data processing and storage functions, and may generally include both stationary and mobile terminals. Fixed terminals such as desktops, etc. Mobile terminals such as mobile phones, PADs and mobile robots. In addition, the technical features involved in the different embodiments of the present invention described later can be combined with each other as long as there is no conflict with each other.
下面,本发明提出部分优选实施例以教导本领域技术人员实现。Below, the present invention provides some preferred embodiments to teach those skilled in the art to realize them.
实施例一Example 1
参见图1,本实施例提供一种基于手绘视频的GIF文件生成方法,包括如下步骤:Referring to Fig. 1, the present embodiment provides a method for generating a GIF file based on a hand-drawn video, comprising the following steps:
S1、读取手绘视频项目中的场景动画;S1. Read the scene animation in the hand-drawn video project;
S2、计算场景动画的动画时长和场景动画之间的间隔;S2. Calculate the animation duration of the scene animation and the interval between the scene animations;
S3、根据动画时长向场景动画填充动画帧,根据间隔的数量填充间隔帧。S3. Fill the scene animation with animation frames according to the animation duration, and fill the interval frames according to the number of intervals.
实施例二 Embodiment 2
参见图2,本实施例提供一种基于手绘视频的GIF文件生成装置,包括:Referring to FIG. 2, the present embodiment provides a device for generating a GIF file based on a hand-drawn video, including:
读取模块1,用于读取手绘视频项目中的场景动画;The reading module 1 is used to read the scene animation in the hand-painted video project;
计算模块2,用于计算所述场景动画的动画时长和所述场景动画之间的间隔; Calculation module 2, for calculating the animation duration of the scene animation and the interval between the scene animation;
填充模块3,用于根据所述动画时长向所述场景动画填充动画帧,根据所述间隔的数量填充间隔帧。Filling module 3, configured to fill animation frames to the scene animation according to the animation duration, and fill interval frames according to the number of intervals.
需要说明的是,参见图3,手绘视频项目是指为了生成手绘视频文件(例如,MP4格式文件)而创建的项目,项目组成形式为项目配置文件和对应的资源文件。其中,配置文件中包含了多个场景,每个场景下包括多个动画。具体的,可以用场景页的形式进行说明,每个场景页中包含动画元素的动画信息,资源文件以场景页为单位保存了对应的资源文件。It should be noted that, referring to FIG. 3 , a hand-drawn video project refers to a project created to generate a hand-drawn video file (eg, MP4 format file), and the project consists of a project configuration file and a corresponding resource file. Among them, the configuration file contains multiple scenes, and each scene includes multiple animations. Specifically, the description can be made in the form of scene pages, each scene page contains animation information of animation elements, and the resource file saves the corresponding resource file in units of scene pages.
还需要说明的是,每个场景动画具有时长,每个场景动画之间也具有时长,场景动画的时长以及场景动画之间的时长可以为默认值,也可以为用户指定值。因为GIF导出时需要对应的画面区域和时长,如果用户做了对应的指定,可以依据用户的指定,若用户未指定,则使用当前手绘视频项目的默认数据。It should also be noted that each scene animation has a duration, and each scene animation also has a duration. The duration of the scene animation and the duration between the scene animations may be default values or values specified by the user. Because the corresponding screen area and duration are required when GIF is exported, if the user makes the corresponding designation, it can be based on the user's designation. If the user does not designate it, the default data of the current hand-drawn video project is used.
还需要说明的是,动画帧和间隔帧都是一种图像帧。图像帧是指GIF文件的组成部分,除文件头外,还包括图像数据和控制数据。It should also be noted that both the animation frame and the interval frame are a kind of image frame. Image frame refers to the component of GIF file, which includes image data and control data in addition to the file header.
图像数据指的是像素组成,也即当前帧的图像。Image data refers to the pixel composition, that is, the image of the current frame.
控制数据指的是当前帧相对于上一帧的延迟时长。Control data refers to the delay time of the current frame relative to the previous frame.
如果每一帧的延迟时长都是相等的,可以简单理解为有固定等长的帧率;如果每帧的延迟不等,则理解为非等长帧率,这样的好处,是在某些画面保持一段时间无变化的情况下,可以节约帧数,减少文件体积和绘制性能消耗。If the delay time of each frame is equal, it can be simply understood as having a fixed frame rate of equal length; if the delay of each frame is unequal, it is understood as an unequal frame rate. The advantage of this is that in some pictures If there is no change for a period of time, the number of frames can be saved, file size and drawing performance consumption can be reduced.
还需要说明的是,还可以计算场景动画的分辨率,该分辨率是指动画场景的尺寸。分辨率可以默认是场景动画的完整尺寸,也可以是用户指定的场景动画的局部尺寸。在基于用户指定分辨率时,可以不但满足用户对场景动画的制作需求,而且可以减小帧数和动画体积。It should also be noted that the resolution of the scene animation can also be calculated, and the resolution refers to the size of the animation scene. The resolution can default to the full size of the scene animation, or it can be a user-specified partial size of the scene animation. When the resolution is specified by the user, it can not only meet the user's production requirements for scene animation, but also reduce the number of frames and animation volume.
还需要说明的是,还可以读取用户指定的透明度要求,若指定保留透明度,在处理后续数据时会把动画背景做透明通道处理,以减小帧数和动画体积。It should also be noted that the transparency requirements specified by the user can also be read. If the transparency is specified to be retained, the animation background will be processed as a transparent channel when processing subsequent data to reduce the number of frames and animation volume.
还需要说明的是,对动画部分***动画帧形成动画,对间隔部分***间隔帧连续动画。间隔帧作用在于间隔相邻动画,能够有效减小帧数和动画体积,降低绘制性能消耗,有利于视频文件的使用和传播。It should also be noted that the animation frame is inserted into the animation part to form an animation, and the interval frame is inserted into the interval part to form a continuous animation. The function of interval frames is to separate adjacent animations, which can effectively reduce the number of frames and animation volume, reduce the consumption of drawing performance, and is conducive to the use and dissemination of video files.
还需要说明的是,根据间隔的数量填充间隔帧的步骤包括:根据每个间隔的起点和终点,计算所述间隔的数量,填充所述间隔帧。其中,通过间隔起点和终点的统计,可以精确计算得到间隔数量,从而确保间隔内都能填充间隔帧,能够从整体上有效减小帧数和动画体积,降低绘制性能消耗,有利于视频文件的使用和传播。It should also be noted that the step of filling the interval frames according to the number of intervals includes: calculating the number of the intervals according to the start point and the end point of each interval, and filling the interval frames. Among them, through the statistics of the start and end points of the interval, the number of intervals can be accurately calculated, so as to ensure that the interval frames can be filled in the interval, which can effectively reduce the number of frames and animation volume as a whole, reduce the consumption of drawing performance, and is conducive to the improvement of video files. use and dissemination.
还需要说明的是,动画时长为默认时长或用户指定时长。其中,动画时长提供默认时长或用户指定时长的选项,可以在默认时长情况下预设适当的动画体积,也可以在用户指定时长情况下满足用户对动画体积的个性化需求。It should also be noted that the animation duration is a default duration or a user-specified duration. Among them, the animation duration provides the option of a default duration or a user-specified duration. An appropriate animation volume can be preset under the default duration, or the user's personalized needs for the animation volume can be met under the user-specified duration.
实施例三 Embodiment 3
参见图4,本实施例提供一种向场景动画填充动画帧的步骤,包括:Referring to FIG. 4 , the present embodiment provides a step of filling animation frames into scene animation, including:
S30、判断所述场景动画是否为手绘动画;S30, determine whether the scene animation is a hand-drawn animation;
S31、如果场景动画为手绘动画,则以手绘动画开始前的最后一帧图像作为填充背景,以填充动画帧到图像指定区域。S31. If the scene animation is a hand-drawn animation, the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
S32、判断所述场景动画是否为动态动画;S32, determine whether the scene animation is a dynamic animation;
S33、如果所述场景动画为动态动画,则以所述动态动画开始前的最后一帧图像作为填充背景,在所述动态动画每一帧中计算动画区域,以填充所述动画帧到计算得到的动画区域。S33, if the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as the filling background, and calculate the animation area in each frame of the dynamic animation to fill the animation frame until the calculation is obtained. animation area.
实施例四Embodiment 4
参见图5,本实施例提供一种填充模块,包括:Referring to FIG. 5, this embodiment provides a filling module, including:
30、手绘动画判断单元,用于判断场景动画是否为手绘动画;30. A hand-drawn animation judgment unit, used to judge whether the scene animation is a hand-drawn animation;
31、第一填充单元,用于如果场景动画为手绘动画,则以手绘动画开始前的最后一帧图像作为填充背景,以填充动画帧到图像指定区域。31. The first filling unit is used for filling the animation frame to the designated area of the image by using the last frame of image before the start of the hand-drawn animation as the filling background if the scene animation is a hand-drawn animation.
32、动态动画判断单元,用于判断场景动画是否为动态动画;32. A dynamic animation judgment unit, used for judging whether the scene animation is a dynamic animation;
33、第二填充单元,用于如果场景动画为动态动画,则以动态动画开始前的最后一帧图像作为填充背景,在动态动画每一帧中计算动画区域,以填充动画帧到图像指定区域。33. The second filling unit is used for if the scene animation is a dynamic animation, the last frame of the image before the start of the dynamic animation is used as the filling background, and the animation area is calculated in each frame of the dynamic animation to fill the animation frame to the designated area of the image .
需要说明的是,手绘动画是一种位置不变,而动画以手绘形式逐渐出现的动画。动态动画是一种位置变化的动画,如移动、旋转、缩放等。It should be noted that the hand-drawn animation is an animation in which the position does not change, and the animation gradually appears in the form of hand-drawn. Dynamic animation is an animation of position changes, such as moving, rotating, scaling, etc.
还需要说明的是:对场景动画进行类型区分,在场景动画为手绘动画的情况下,以手绘动画开始前的最后一帧图像作为填充背景,以填充动画帧到图像指定区域,可以将动画帧填充到填充背景的固定区域,形成对填充背景固定区域的充分调取使用,避免大量填充前的区域计算,节约计算资源。It should also be noted that: to distinguish the type of scene animation, if the scene animation is a hand-drawn animation, the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image, and the animation frame can be Fill to the fixed area of the filled background to form a full call and use of the fixed area of the filled background, avoid a large number of area calculations before filling, and save computing resources.
另外,对填充背景固定区域的使用也减小了动画体积,降低绘制性能消耗。In addition, the use of filling the fixed area of the background also reduces the animation volume and reduces the drawing performance consumption.
还需要说明的是,对场景动画进行类型区分,在场景动画为手绘动画时进行固定区域填充,在场景动画为动态动画时进行动态区域填充,形成对填充背景固定区域的充分调取使用,避免大量填充前的区域计算,节约计算资源。It should also be noted that the type of scene animation is distinguished. When the scene animation is a hand-drawn animation, the fixed area is filled, and when the scene animation is a dynamic animation, the dynamic area is filled, so as to fully call and use the fixed area of the filled background to avoid The area calculation before a large number of filling saves computing resources.
另外,对填充背景固定区域的使用也减小了动画体积,降低绘制 性能消耗,对填充背景动态区域的使用,使得动画开始时的完整动画得以保留,每一帧动画的动画区域得以动态更新。In addition, the use of the fixed area of the filled background also reduces the animation volume and the consumption of drawing performance. The use of the dynamic area of the filled background allows the complete animation at the beginning of the animation to be preserved, and the animation area of each frame of animation can be dynamically updated.
实施例五Embodiment 5
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
获取任意两个相邻场景动画之间的无动画间隔时长;在确定无动画间隔时长的过程中,可以根据元素动画类型和元素出入场时间计算整个手绘动画过程中的所有无动画区间。Get the duration of the no-animation interval between any two adjacent scene animations; in the process of determining the duration of the no-animation interval, you can calculate all the no-animation intervals in the entire hand-drawn animation process according to the element animation type and the entry and exit time of the element.
将所述无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。The non-animation interval duration output is displayed for the user to select and configure the filling interval frame.
通过以上的步骤,将无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。通过将所有的无动画间隔时长进行显示,可以供有选择的填充间隔帧,以适应各种情况。Through the above steps, the no-animation interval duration is output and displayed for the user to choose and configure the filling interval frame. By displaying all non-animation interval durations, the interval frames can be optionally filled to suit a variety of situations.
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
所述场景动画包括填充背景;the scene animation includes filling the background;
接收输入的透明度信息,基于所述透明度信息对所述填充背景做透明通道处理。Receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
通过以上的步骤,能够对在将手绘视频制作为GIF文件时进行透明度的改变,使得生成的GIF文件具有期望的透明度。Through the above steps, the transparency can be changed when the hand-drawn video is made into a GIF file, so that the generated GIF file has the desired transparency.
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
在基于所述间隔帧对GIF文件中的每一帧填充数据信息和\或控制信息时,跳过GIF文件中的无动画区间;When each frame in the GIF file is filled with data information and/or control information based on the interval frame, skip the no-animation interval in the GIF file;
所述间隔帧包括起始时刻和结束时刻。The interval frame includes a start time and an end time.
通过以上的步骤,能够对场景动画填充相应的填充数据信息和\或控制信息,不需要对无动画区间进行填充,有效降低了GIF文件的大小,在填充数据信息和\或控制信息时,会根据间隔帧的起始时刻 和结束时刻确认相应的无动画区间进行跳过处理。Through the above steps, the scene animation can be filled with the corresponding filling data information and/or control information, and there is no need to fill the non-animation interval, which effectively reduces the size of the GIF file. When filling data information and\or control information, it will be According to the start time and end time of the interval frame, confirm the corresponding non-animation interval and perform skip processing.
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
读取用户在手绘视频中指定的导出区域、分辨率和导出场景页范围,生成GIF文件。在生成GIF文件时,其中一种实施方式是根据用户的选定得到,得到GIF文件更加满足用户的定制需求。Read the export area, resolution and export scene page range specified by the user in the hand-drawn video, and generate a GIF file. When generating the GIF file, one of the implementations is to obtain the GIF file according to the user's selection, and the obtained GIF file can better meet the user's customized needs.
若用户未指定导出区域和分辨率,则生成的GIF文件默认导出全部场景页的完整区域并且分辨率为手绘视频的区域实际尺寸。在生成GIF文件时,如果用户为指定导出区域和分辨率,则进行完整区域导出,此时导出的GIF文件为不具有无动画区间的GIF文件,虽然其分辨率与手绘视频的分辨率相同,但是其相较于完整的手绘视频数据量更小。If the user does not specify the export area and resolution, the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video. When generating a GIF file, if the user specifies the export area and resolution, complete area export is performed. At this time, the exported GIF file is a GIF file without an animation interval, although its resolution is the same as that of the hand-drawn video. However, the amount of data is smaller than that of a complete hand-drawn video.
实施例六Embodiment 6
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
间隔时长获取单元,获取任意两个相邻场景动画之间的无动画间隔时长;在确定无动画间隔时长的过程中,可以根据元素动画类型和元素出入场时间计算整个手绘动画过程中的所有无动画区间。Interval duration acquisition unit, to obtain the non-animation interval duration between any two adjacent scene animations; in the process of determining the non-animation interval duration, you can calculate all the animations in the entire hand-drawn animation process according to the element animation type and the entry and exit time of the element. No animation interval.
间隔帧填充单元,用于将所述无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。The interval frame filling unit is used for outputting and displaying the non-animation interval duration, so as to allow the user to choose and configure the interval frame filling.
通过以上的单元,将无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。通过将所有的无动画间隔时长进行显示,可以供有选择的填充间隔帧,以适应各种情况。Through the above units, the duration of no animation interval is output and displayed for the user to choose and configure the filling interval frame. By displaying all non-animation interval durations, the interval frames can be optionally filled to suit a variety of situations.
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
所述场景动画包括填充背景;the scene animation includes filling the background;
改变单元,用于接收输入的透明度信息,基于所述透明度信息对所述填充背景做透明通道处理。A changing unit, configured to receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
通过以上的单元,能够对在将手绘视频制作为GIF文件时进行透明度的改变,使得生成的GIF文件具有期望的透明度。Through the above units, the transparency can be changed when the hand-drawn video is made into a GIF file, so that the generated GIF file has the desired transparency.
本发明提供的技术方案还包括:The technical solution provided by the present invention also includes:
跳跃单元,用于在基于所述间隔帧对GIF文件中的每一帧填充数据信息和\或控制信息时,跳过GIF文件中的无动画区间;Jumping unit, when filling data information and/or control information to each frame in the GIF file based on the interval frame, skip the non-animated interval in the GIF file;
所述间隔帧包括起始时刻和结束时刻。The interval frame includes a start time and an end time.
通过以上的单元,能够对场景动画填充相应的填充数据信息和\或控制信息,不需要对无动画区间进行填充,有效降低了GIF文件的大小,在填充数据信息和\或控制信息时,会根据间隔帧的起始时刻和结束时刻确认相应的无动画区间进行跳过处理。Through the above units, the scene animation can be filled with the corresponding filling data information and/or control information, and there is no need to fill the non-animation interval, which effectively reduces the size of the GIF file. When filling the data information and\or control information, it will be According to the start time and end time of the interval frame, confirm the corresponding non-animation interval and perform skip processing.
本发明提供的技术方案还包括生成单元,用于执行以下步骤,包括:The technical solution provided by the present invention also includes a generating unit for performing the following steps, including:
读取用户在手绘视频中指定的导出区域、分辨率和导出场景页范围,生成GIF文件。在生成GIF文件时,其中一种实施方式是根据用户的选定得到,得到GIF文件更加满足用户的定制需求。Read the export area, resolution and export scene page range specified by the user in the hand-drawn video, and generate a GIF file. When generating the GIF file, one of the implementations is to obtain the GIF file according to the user's selection, and the obtained GIF file can better meet the user's customized needs.
若用户未指定导出区域和分辨率,则生成的GIF文件默认导出全部场景页的完整区域并且分辨率为手绘视频的区域实际尺寸。在生成GIF文件时,如果用户为指定导出区域和分辨率,则进行完整区域导出,此时导出的GIF文件为不具有无动画区间的GIF文件,虽然其分辨率与手绘视频的分辨率相同,但是其相较于完整的手绘视频数据量更小。If the user does not specify the export area and resolution, the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video. When generating a GIF file, if the user specifies the export area and resolution, complete area export is performed. At this time, the exported GIF file is a GIF file without an animation interval, although its resolution is the same as that of the hand-drawn video. However, the amount of data is smaller than that of a complete hand-drawn video.
需要总体说明的是,以上实施例中涉及的方法,可以通过计算机程序的方式实现。其中,实现以上实施例方法的计算机程序可以运行在电子设备中,也可以存放在存储介质中。It should be generally noted that the methods involved in the above embodiments may be implemented in the form of computer programs. Wherein, the computer program for implementing the methods in the above embodiments may be executed in an electronic device or stored in a storage medium.
具体的,电子设备,包括存储器和处理器,存储器存储计算机程 序,计算机程序在处理器执行,可实现以上实施例中涉及的方法。Specifically, an electronic device includes a memory and a processor. The memory stores a computer program, and the computer program is executed by the processor to implement the methods involved in the above embodiments.
另外,存储介质,存储计算机程序,计算机程序在处理器中执行,可实现以上实施例中涉及的方法。In addition, a storage medium stores a computer program, and the computer program is executed in the processor to implement the methods involved in the above embodiments.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the protection of the present invention. within the range.

Claims (18)

  1. 一种基于手绘视频的GIF文件生成方法,其特征在于,包括如下步骤:A kind of GIF file generation method based on hand-painted video, is characterized in that, comprises the steps:
    读取手绘视频项目中的场景动画;Read scene animations in hand-drawn video projects;
    计算所述场景动画的动画时长和所述场景动画之间的间隔;Calculate the animation duration of the scene animation and the interval between the scene animations;
    根据所述动画时长向所述场景动画填充动画帧,根据所述间隔的数量填充间隔帧。The scene animation is filled with animation frames according to the animation duration, and interval frames are filled according to the number of intervals.
  2. 如权利要求1所述的方法,其特征在于,所述的向所述场景动画填充动画帧的步骤包括:The method of claim 1, wherein the step of filling animation frames into the scene animation comprises:
    判断所述场景动画是否为手绘动画;Determine whether the scene animation is a hand-drawn animation;
    如果所述场景动画为手绘动画,则以所述手绘动画开始前的最后一帧图像作为填充背景,以填充所述动画帧到图像指定区域。If the scene animation is a hand-drawn animation, the last frame of the image before the start of the hand-drawn animation is used as the filling background to fill the animation frame to the designated area of the image.
  3. 如权利要求1所述的方法,其特征在于,所述的向所述场景动画填充动画帧的步骤包括:The method of claim 1, wherein the step of filling animation frames into the scene animation comprises:
    判断所述场景动画是否为动态动画;Determine whether the scene animation is a dynamic animation;
    如果所述场景动画为动态动画,则以所述动态动画开始前的最后一帧图像作为填充背景,在所述动态动画每一帧中计算动画区域,以填充所述动画帧到计算得到的动画区域。If the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as the filling background, and calculate the animation area in each frame of the dynamic animation to fill the animation frame to the calculated animation area.
  4. 如权利要求1所述的方法,其特征在于,所述的根据所述间隔的数量填充间隔帧的步骤包括:The method of claim 1, wherein the step of filling spaced frames according to the number of spaces comprises:
    根据每个所述间隔的起点和终点,计算所述间隔的数量,填充所述间隔帧。From the start and end points of each of the intervals, the number of intervals is counted to fill the interval frame.
  5. 如权利要求1所述的方法,其特征在于,所述动画时长为默认时长或用户指定时长。The method of claim 1, wherein the animation duration is a default duration or a user-specified duration.
  6. 一种基于手绘视频的GIF文件生成装置,其特征在于,包括:A device for generating a GIF file based on a hand-painted video, comprising:
    读取模块,用于读取手绘视频项目中的场景动画;The reading module is used to read the scene animation in the hand-drawn video project;
    计算模块,用于计算所述场景动画的动画时长和所述场景动画之间的间隔;a calculation module for calculating the animation duration of the scene animation and the interval between the scene animations;
    填充模块,用于根据所述动画时长向所述场景动画填充动画帧,根据所述间隔的数量填充间隔帧。A filling module, configured to fill animation frames into the scene animation according to the animation duration, and fill interval frames according to the number of intervals.
  7. 如权利要求6所述的装置,其特征在于,所述填充模块包括:The apparatus of claim 6, wherein the filling module comprises:
    手绘动画判断单元,用于判断所述场景动画是否为手绘动画;A hand-drawn animation judgment unit, used for judging whether the scene animation is a hand-drawn animation;
    第一填充单元,用于如果所述场景动画为手绘动画,则以所述手绘动画开始前的最后一帧图像作为填充背景,以填充所述动画帧到图像指定区域。The first filling unit is configured to use the last frame of image before the start of the hand-drawn animation as a filling background if the scene animation is a hand-drawn animation, so as to fill the animation frame into a designated area of the image.
  8. 如权利要求6所述的装置,其特征在于,所述填充模块包括:The apparatus of claim 6, wherein the filling module comprises:
    动态动画判断单元,用于判断所述场景动画是否为动态动画;a dynamic animation judging unit for judging whether the scene animation is a dynamic animation;
    第二填充单元,用于如果所述场景动画为动态动画,则以所述动态动画开始前的最后一帧图像作为填充背景,在所述动态动画每一帧中计算动画区域,以填充所述动画帧到计算得到的动画区域。The second filling unit is configured to, if the scene animation is a dynamic animation, use the last frame of the image before the dynamic animation starts as a filling background, and calculate the animation area in each frame of the dynamic animation to fill the Animation frames to the calculated animation area.
  9. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    获取任意两个相邻场景动画之间的无动画间隔时长;Get the no-animation interval between any two adjacent scene animations;
    将所述无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。The non-animation interval duration output is displayed for the user to select and configure the filling interval frame.
  10. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    所述场景动画包括填充背景;the scene animation includes filling the background;
    接收输入的透明度信息,基于所述透明度信息对所述填充背景做透明通道处理。Receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
  11. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    在基于所述间隔帧对GIF文件中的每一帧填充数据信息和\或控制信息时,跳过GIF文件中的无动画区间;When each frame in the GIF file is filled with data information and/or control information based on the interval frame, skip the no-animation interval in the GIF file;
    所述间隔帧包括起始时刻和结束时刻。The interval frame includes a start time and an end time.
  12. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    读取用户在手绘视频中指定的导出区域、分辨率和导出场景页范围,生成GIF文件。Read the export area, resolution and export scene page range specified by the user in the hand-drawn video, and generate a GIF file.
    若用户未指定导出区域和分辨率,则生成的GIF文件默认导出全部场景页的完整区域并且分辨率为手绘视频的区域实际尺寸。If the user does not specify the export area and resolution, the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
  13. 如权利要求6所述的装置,其特征在于,还包括:The apparatus of claim 6, further comprising:
    间隔时长获取单元,获取任意两个相邻场景动画之间的无动画间隔时长;Interval duration acquisition unit, which acquires the non-animation interval duration between any two adjacent scene animations;
    间隔帧填充单元,用于将所述无动画间隔时长输出显示,用以供用户选择配置填充间隔帧。The interval frame filling unit is used for outputting and displaying the non-animation interval duration, so as to allow the user to choose and configure the interval frame filling.
  14. 如权利要求6所述的装置,其特征在于,还包括:The apparatus of claim 6, further comprising:
    所述场景动画包括填充背景;the scene animation includes filling the background;
    改变单元,用于接收输入的透明度信息,基于所述透明度信息对所述填充背景做透明通道处理。A changing unit, configured to receive input transparency information, and perform transparent channel processing on the filled background based on the transparency information.
  15. 如权利要求6所述的装置,其特征在于,还包括:The apparatus of claim 6, further comprising:
    跳跃单元,用于在基于所述间隔帧对GIF文件中的每一帧填充数据信息和\或控制信息时,跳过GIF文件中的无动画区间;Jumping unit, when filling data information and/or control information to each frame in the GIF file based on the interval frame, skip the non-animated interval in the GIF file;
    所述间隔帧包括起始时刻和结束时刻。The interval frame includes a start time and an end time.
  16. 如权利要求1所述的方法,其特征在于,还包括生成单元,用于执行以下步骤,包括:The method of claim 1, further comprising a generating unit configured to perform the following steps, comprising:
    读取用户在手绘视频中指定的导出区域、分辨率和导出场景页范围,生成GIF文件。Read the export area, resolution and export scene page range specified by the user in the hand-drawn video, and generate a GIF file.
    若用户未指定导出区域和分辨率,则生成的GIF文件默认导出全部场景页的完整区域并且分辨率为手绘视频的区域实际尺寸。If the user does not specify the export area and resolution, the generated GIF file will export the complete area of all scene pages by default and the resolution is the actual size of the area of the hand-drawn video.
  17. 一种电子设备,包括存储器和处理器,所述存储器存储计算机程序,其特征在于,所述计算机程序在所述处理器中执行可实现权利要求1-5、9-12中任一种方法。An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the computer program is executed in the processor to implement any one of the methods in claims 1-5 and 9-12.
  18. 一种存储介质,存储计算机程序,其特征在于,所述计算机程序在处理器中执行可实现权利要求1-5、9-12中任一种方法。A storage medium storing a computer program, wherein the computer program can be executed in a processor to implement any one of the methods in claims 1-5 and 9-12.
PCT/CN2021/098207 2020-08-11 2021-06-03 Method for generating gif file on basis of hand-drawn video WO2022033137A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010803251.9A CN111968200A (en) 2020-08-11 2020-08-11 GIF file generation method based on hand-drawn video
CN202010803251.9 2020-08-11

Publications (1)

Publication Number Publication Date
WO2022033137A1 true WO2022033137A1 (en) 2022-02-17

Family

ID=73365636

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/098207 WO2022033137A1 (en) 2020-08-11 2021-06-03 Method for generating gif file on basis of hand-drawn video

Country Status (2)

Country Link
CN (1) CN111968200A (en)
WO (1) WO2022033137A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968200A (en) * 2020-08-11 2020-11-20 深圳市前海手绘科技文化有限公司 GIF file generation method based on hand-drawn video
CN112738423B (en) * 2021-01-19 2022-02-25 深圳市前海手绘科技文化有限公司 Method and device for exporting animation video
CN112835500B (en) * 2021-03-16 2023-05-30 深圳市前海手绘科技文化有限公司 Transition method and device for demonstration template

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6300959B1 (en) * 1998-05-13 2001-10-09 Compaq Computer Corporation Method and system condensing animated images
US20050058431A1 (en) * 2003-09-12 2005-03-17 Charles Jia Generating animated image file from video data file frames
CN101075258A (en) * 2007-05-14 2007-11-21 腾讯科技(深圳)有限公司 Method and device for generating video microform
CN104268917A (en) * 2014-09-28 2015-01-07 厦门幻世网络科技有限公司 Method and device for converting 3D animation into GIF dynamic graph
CN104517307A (en) * 2013-09-29 2015-04-15 北京新媒传信科技有限公司 Method and device for animation producing
CN105610931A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 Method and device for recording event
CN107180443A (en) * 2017-04-28 2017-09-19 深圳市前海手绘科技文化有限公司 A kind of Freehandhand-drawing animation producing method and its device
CN107592565A (en) * 2017-09-29 2018-01-16 深圳市前海手绘科技文化有限公司 A kind of method that Freehandhand-drawing video elementary is quickly combined in video
CN111968200A (en) * 2020-08-11 2020-11-20 深圳市前海手绘科技文化有限公司 GIF file generation method based on hand-drawn video

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6300959B1 (en) * 1998-05-13 2001-10-09 Compaq Computer Corporation Method and system condensing animated images
US20050058431A1 (en) * 2003-09-12 2005-03-17 Charles Jia Generating animated image file from video data file frames
CN101075258A (en) * 2007-05-14 2007-11-21 腾讯科技(深圳)有限公司 Method and device for generating video microform
CN104517307A (en) * 2013-09-29 2015-04-15 北京新媒传信科技有限公司 Method and device for animation producing
CN104268917A (en) * 2014-09-28 2015-01-07 厦门幻世网络科技有限公司 Method and device for converting 3D animation into GIF dynamic graph
CN105610931A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 Method and device for recording event
CN107180443A (en) * 2017-04-28 2017-09-19 深圳市前海手绘科技文化有限公司 A kind of Freehandhand-drawing animation producing method and its device
CN107592565A (en) * 2017-09-29 2018-01-16 深圳市前海手绘科技文化有限公司 A kind of method that Freehandhand-drawing video elementary is quickly combined in video
CN111968200A (en) * 2020-08-11 2020-11-20 深圳市前海手绘科技文化有限公司 GIF file generation method based on hand-drawn video

Also Published As

Publication number Publication date
CN111968200A (en) 2020-11-20

Similar Documents

Publication Publication Date Title
WO2022033137A1 (en) Method for generating gif file on basis of hand-drawn video
CN104244024B (en) Video cover generation method and device and terminal
US8996996B2 (en) Dynamic real-time playback
US11600301B2 (en) Method and device of editing a video
TWI686768B (en) Method and device for animating images on mobile equipment
US8098261B2 (en) Pillarboxing correction
US9237322B2 (en) Systems and methods for performing selective video rendering
SG173703A1 (en) Method for generating gif, and system and media player thereof
JP2018110011A (en) Image analysis based automatic image editing device, method and computer readable recording medium
US11972514B2 (en) Animation file processing method and apparatus, computer-readable storage medium, and computer device
CN107005458B (en) Unscripted digital media message generation method, device, electronic equipment and readable medium
JP2008141746A (en) System and method for playing moving images
WO2017202170A1 (en) Method and device for video compression and electronic device
KR20090076388A (en) Method and apparatus for controlling video display in mobile terminal
JP2008136213A (en) Method for generating frame information for moving image, system utilizing the same and recording medium
WO2021008427A1 (en) Image synthesis method and apparatus, electronic device, and storage medium
CN103297729A (en) Video processing method and device
WO2023231235A1 (en) Method and apparatus for editing dynamic image, and electronic device
TW201617860A (en) Method and apparatus for screen capture on a display device
CN112511896A (en) Video rendering method and device
US9424624B2 (en) System and method for graphics upscaling
WO2022134548A1 (en) Hand-drawn animation material editing method and apparatus
CN113055730B (en) Video generation method, device, electronic equipment and storage medium
WO2022033319A1 (en) Method for applying combined source materials to hand-drawn animation
US10789693B2 (en) System and method for performing pre-processing for blending images

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21855193

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 13.06.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21855193

Country of ref document: EP

Kind code of ref document: A1