CN106657821B - Animation subtitle drawing method with changeable effect - Google Patents

Animation subtitle drawing method with changeable effect Download PDF

Info

Publication number
CN106657821B
CN106657821B CN201611239019.7A CN201611239019A CN106657821B CN 106657821 B CN106657821 B CN 106657821B CN 201611239019 A CN201611239019 A CN 201611239019A CN 106657821 B CN106657821 B CN 106657821B
Authority
CN
China
Prior art keywords
animation
characters
character
matrix
effect
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.)
Active
Application number
CN201611239019.7A
Other languages
Chinese (zh)
Other versions
CN106657821A (en
Inventor
林传杰
张金矿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Xiaoying Innovation Technology Co.,Ltd.
Original Assignee
Hangzhou Quwei Science & Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Quwei Science & Technology Co ltd filed Critical Hangzhou Quwei Science & Technology Co ltd
Priority to CN201611239019.7A priority Critical patent/CN106657821B/en
Publication of CN106657821A publication Critical patent/CN106657821A/en
Application granted granted Critical
Publication of CN106657821B publication Critical patent/CN106657821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/278Subtitling

Abstract

The invention discloses an animation subtitle drawing method with changeable effects, which specifically comprises the following steps of drawing characters, obtaining character effects and rendering the characters; each animation only needs one configuration file, a plurality of picture files do not need to be packed, the size is small, and the performance on a mobile phone is good.

Description

Animation subtitle drawing method with changeable effect
Technical Field
The invention relates to the field of video subtitles, in particular to an animation subtitle drawing method with changeable effect.
Background
With the popularization of mobile internet, more and more people use mobile phones to make micro videos and share the micro videos on line. Many short films (such as teaching videos, making fun films, etc.) require caption aids. However, most of the existing caption tools in the market can only add basic static characters or store animation captions by a group of picture sequences, and have large volume and poor expansibility. In addition, the simple animation effect cannot satisfy diversified production requirements.
Disclosure of Invention
The invention aims to provide an animation subtitle drawing method with changeable effects, so that each animation only needs one configuration file, a plurality of picture files do not need to be packed, the size is small, and the performance on a mobile phone is good.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a method for drawing animation subtitles with changeable effects specifically comprises the following steps:
101) and a step of drawing characters: drawing characters on another blank picture, and transmitting the characters into OpenGL, wherein the OpenGL is a professional graphical program interface which defines a cross-programming language and cross-platform programming interface specification;
102) a step of acquiring characters: analyzing the caption configuration file to obtain the attribute of the characters, and constructing a cubic Bezier curve to obtain the path and position information of the characters;
103) character effect step: calculating an animation matrix of the characters according to an interpolation mode and animation attributes, wherein the interpolation mode determines a position matrix of the characters according to the character path and the position information obtained in the step 102), and an animation matrix is superposed on the position matrix of each character to achieve an animation effect;
104) rendering characters: transmitting the texture obtained by drawing in the step 101) into OpenGL, rendering by a Shader, namely a Shader, and putting the character texture on a corresponding position according to the matrix obtained in the step 103) to synthesize the character texture with a background video or a picture to form an animation subtitle effect.
Further, in the step 101), the area information of the characters on the blank picture is calculated by measuring each drawn character.
Further, the attributes of the text in the step 102) include coordinates of curve points, animation attributes, time points and animation interpolation modes.
Further, the animation attributes include displacement, scaling, rotation, and blurring.
Further, the following formula (1) is adopted for obtaining the path and position information of the characters in the step 102):
[x,y]=(1-t)3P0+3(1-t)2tP1+3(1-t)2P2+t3P3formula (1)
Wherein [ x, y]Is the position of a point on the Bezier curve, t is a Bezier curve parameter, and the value P is between 0 and 10,P1,P2,P3Four control points on the bezier curve.
Further, the animation interpolation mode of step 103) includes triangle change, smooth change, fade-out change and fade-in change, and the specific processing is respectively as the following formula (2), formula (3), formula (4) and formula (5),
r ═ 0.5? r 2.0 (1.0-r) formula (2)
This formula (2) is a conditional expression, which indicates that if r < 0.5 holds, r < 2.0 r, and if r < 0.5 does not hold, r < 2.0 (1.0-r);
Figure BDA0001195890280000021
r ═ (1-R) × (1-R) formula (4)
R ═ R formula (5)
Wherein R is the ratio of the position of a certain character relative to the width of the whole line of characters, and R is a coefficient obtained by processing; abs is a function of the absolute value of a floating-point number.
Compared with the prior art, the invention has the advantages that:
1. the subtitle file of the invention has various effects (including character-by-character animation, integral character movement, three-dimensional transformation, character blurring and the like). Only the relevant properties of the configuration file need to be changed, and theoretically, an infinite animation form exists.
2. The user can select different animation templates at the mobile phone end, freely edit the text content and generate corresponding animation subtitles.
3. Each animation only needs one configuration file, a plurality of picture files do not need to be packaged, the size is small, and the performance on a mobile phone is good.
Drawings
Fig. 1 is a flowchart of an animation subtitle rendering method with changeable effects according to the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
As shown in fig. 1, a method for drawing an animation subtitle with a changeable effect specifically includes the following steps:
101) and a step of drawing characters: and drawing characters on another blank picture, and transmitting the characters into OpenGL, wherein the OpenGL is a professional graphical program interface which defines a cross-programming language and cross-platform programming interface specification. And measuring each drawn character to calculate the region information of the character on the blank picture. Therefore, each animation only needs one configuration file, a plurality of picture files do not need to be packed, and each character can be selected in different matching sequences, so that the stored animation characters are small in size and small in storage capacity, and can be operated on a mobile phone with good performance.
102) A step of acquiring characters: and analyzing the caption configuration file to obtain the attribute of the characters, and constructing a cubic Bezier curve to obtain the path and position information of the characters. The attributes of the characters comprise curve point coordinates, animation attributes, time points and animation interpolation modes. The animation properties include displacement, zoom, rotation, blur, and the like. The path and position information of the obtained characters adopts the following formula (1):
[x,y]=(1-t)3P0+3(1-t)2tP1+3(1-t)2P2+t3P3formula (1)
Wherein [ x, y]Is the position of a point on the Bezier curve, t is a Bezier curve parameter, and the value P is between 0 and 10,P1,P2,P3Four control points on the bezier curve.
103) Character effect step: and calculating an animation matrix of the characters according to the interpolation mode and the animation attribute, wherein the interpolation mode determines the position matrix of the characters according to the character path and the position information obtained in the step 102), and the animation matrix is superposed on the position matrix of each character so as to achieve the animation effect. The animation interpolation mode comprises triangle change, smooth change, fade-out change and fade-in change, and the specific processing is respectively the following formula (2), formula (3), formula (4) and formula (5),
r ═ 0.5? r 2.0 (1.0-r) formula (2)
This formula (2) is a conditional expression, which indicates that if r < 0.5 holds, r < 2.0 r, and if r < 0.5 does not hold, r < 2.0 (1.0-r);
Figure BDA0001195890280000041
r ═ (1-R) × (1-R) formula (4)
R ═ R formula (5)
Wherein R is the ratio of the position of a certain character relative to the width of the whole line of characters, and R is a coefficient obtained by processing; abs is a function of the absolute value of a floating-point number.
104) Rendering characters: transmitting the texture obtained by drawing in the step 101) into OpenGL, and rendering by a Shader, namely a color Shader, so that the color, transparency, fuzzy degree and the like of each character can be changed, and the Shader also has infinite expansibility. And (4) putting the character texture on a corresponding position according to the matrix obtained in the step 103), and synthesizing the character texture with the background video or the picture to finally achieve the expected animation subtitle effect.
In summary, after selecting a movie in the mobile phone video app, the animation configuration file in the step 101) of presetting and downloading is added, so that the user can select a desired effect or a system recommended effect by himself to generate a corresponding animation, and perform text rendering of subtitles. The system can generate visible animation subtitles on the screen through the processing method.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the spirit of the present invention, and these modifications and decorations should also be regarded as being within the scope of the present invention.

Claims (4)

1. A method for drawing animation subtitles with changeable effects is characterized by comprising the following steps:
101) and a step of drawing characters: drawing characters on another blank picture, and transmitting the characters into OpenGL, wherein the OpenGL is a professional graphical program interface which defines a cross-programming language and cross-platform programming interface specification;
102) a step of acquiring characters: analyzing the caption configuration file to obtain the attribute of the characters, and constructing a cubic Bezier curve to obtain the path and position information of the characters;
103) character effect step: calculating an animation matrix of the characters according to the interpolation mode and the animation attribute, determining a position matrix of the characters according to the character path and the position information obtained in the step 102) in the interpolation mode, and superposing an animation matrix on the position matrix of each character to achieve the animation effect;
104) rendering characters: transmitting the texture obtained by drawing in the step 101) into OpenGL, rendering by a Shader, namely a Shader, and putting the character texture on a corresponding position according to the position matrix and the animation matrix obtained in the step 103) to synthesize the character texture and the background video or the picture to form an animation subtitle effect;
the attributes of the characters in the step 102) comprise curve point coordinates, animation attributes, time points and animation interpolation modes;
the path and position information of the characters obtained in the step 102) adopts the following formula (1):
[x,y]=(1-t)3P0+3(1-t)2tP1+3(1-t)2P2+t3P3formula (1)
Wherein [ x, y]Is the position of a point on the Bezier curve, t is a Bezier curve parameter, and the value P is between 0 and 10,P1,P2,P3Four control points on the Bezier curve;
after selecting a film in the mobile phone video app, adding an animation configuration file preset and downloaded in the step 101), selecting a desired effect or a system recommended effect by a user, generating a corresponding animation by the system, and performing text rendering of subtitles.
2. The method as claimed in claim 1, wherein the step 101) is performed by measuring each drawn text to calculate the region information of the text on the blank screen.
3. The method of claim 1, wherein the animation property comprises shift, zoom, rotation, and blur.
4. The method of claim 1, wherein the interpolation modes of the animation of step 103) include triangle change, smooth change, fade-out change and fade-in change.
CN201611239019.7A 2016-12-28 2016-12-28 Animation subtitle drawing method with changeable effect Active CN106657821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611239019.7A CN106657821B (en) 2016-12-28 2016-12-28 Animation subtitle drawing method with changeable effect

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611239019.7A CN106657821B (en) 2016-12-28 2016-12-28 Animation subtitle drawing method with changeable effect

Publications (2)

Publication Number Publication Date
CN106657821A CN106657821A (en) 2017-05-10
CN106657821B true CN106657821B (en) 2020-04-28

Family

ID=58835759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611239019.7A Active CN106657821B (en) 2016-12-28 2016-12-28 Animation subtitle drawing method with changeable effect

Country Status (1)

Country Link
CN (1) CN106657821B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107592565A (en) * 2017-09-29 2018-01-16 深圳市前海手绘科技文化有限公司 A kind of method that Freehandhand-drawing video elementary is quickly combined in video
CN108364335A (en) * 2018-01-23 2018-08-03 腾讯科技(深圳)有限公司 A kind of animation method for drafting and device
CN112307715A (en) * 2020-11-13 2021-02-02 深圳市前海手绘科技文化有限公司 Method and device for making hand-drawn material based on character typesetting
CN114697573A (en) * 2020-12-30 2022-07-01 深圳Tcl新技术有限公司 Subtitle generating method, computer device, computer-readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102074030A (en) * 2009-11-25 2011-05-25 新奥特(北京)视频技术有限公司 Method for acquiring and editing custom graphics and system for making subtitle graphics
CN102122502A (en) * 2011-03-15 2011-07-13 深圳芯邦科技股份有限公司 Method and related device for displaying three-dimensional (3D) font
CN103136169A (en) * 2011-11-29 2013-06-05 中兴通讯股份有限公司 Method and device of displaying characters
CN103714724A (en) * 2013-12-31 2014-04-09 江西迈思科技有限公司 Information processing method and electronic device
CN103744833A (en) * 2014-01-21 2014-04-23 厦门美图网科技有限公司 Path based text creating method
CN103810739A (en) * 2014-02-20 2014-05-21 南京师范大学 Image character morphing animation generating method
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102074030A (en) * 2009-11-25 2011-05-25 新奥特(北京)视频技术有限公司 Method for acquiring and editing custom graphics and system for making subtitle graphics
CN102122502A (en) * 2011-03-15 2011-07-13 深圳芯邦科技股份有限公司 Method and related device for displaying three-dimensional (3D) font
CN103136169A (en) * 2011-11-29 2013-06-05 中兴通讯股份有限公司 Method and device of displaying characters
CN103714724A (en) * 2013-12-31 2014-04-09 江西迈思科技有限公司 Information processing method and electronic device
CN103744833A (en) * 2014-01-21 2014-04-23 厦门美图网科技有限公司 Path based text creating method
CN103810739A (en) * 2014-02-20 2014-05-21 南京师范大学 Image character morphing animation generating method
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device

Also Published As

Publication number Publication date
CN106657821A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106657821B (en) Animation subtitle drawing method with changeable effect
US10909664B2 (en) Generating and displaying blur in images
CN110266971B (en) Short video making method and system
US7898542B1 (en) Creating animation effects
US6147692A (en) Method and apparatus for controlling transformation of two and three-dimensional images
US8281281B1 (en) Setting level of detail transition points
CN107197341B (en) Dazzle screen display method and device based on GPU and storage equipment
EP1564687A2 (en) Method and apparatus for high speed visualization of depth image-based 3D graphic data
US20190035054A1 (en) System for generation of custom animated characters
CN111356000A (en) Video synthesis method, device, equipment and storage medium
JP2004523036A (en) Image-based digital representation of landscape
CN106776732A (en) The implementation method and device of virtual electronic specification
WO2019228013A1 (en) Method, apparatus and device for displaying rich text on 3d model
CN104836957A (en) Photo shooting processing method and device
CN101976195B (en) Method and device for setting user interface
US9639924B2 (en) Adding objects to digital photographs
JP4987124B2 (en) Graphic data providing method and graphic data display method
JP2005327314A (en) Image display method and device
US20030090485A1 (en) Transition effects in three dimensional displays
US8228335B1 (en) Snapsheet animation visualization
CN104866266A (en) Crop character display method and device
Trapp Interactive rendering techniques for focus+ context visualization of 3d geovirtual environments
CN108305307A (en) The implementation method of three-dimensional geometry body animation realizes system and terminal
CN112417061B (en) Three-dimensional dynamic plotting display method based on time drive
KR20150135591A (en) Capture two or more faces using a face capture tool on a smart phone, combine and combine them with the animated avatar image, and edit the photo animation avatar and server system, avatar database interworking and transmission method , And photo animation on smartphone Avatar display How to display caller

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 310000 16 / F, HANGGANG metallurgical technology building, 294 Tianmushan Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Xiaoying Innovation Technology Co.,Ltd.

Address before: 310000 16 / F, HANGGANG metallurgical technology building, 294 Tianmushan Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Xiaoying Innovation Technology Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 310000 16 / F, HANGGANG metallurgical technology building, 294 Tianmushan Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Xiaoying Innovation Technology Co.,Ltd.

Address before: 310013 16th floor, metallurgical science and technology building, no.294, Tianmushan Road, Hangzhou City, Zhejiang Province

Patentee before: HANGZHOU QUWEI SCIENCE & TECHNOLOGY Co.,Ltd.