CN110609684A - Method for converting video into character animation under Spring boot frame - Google Patents

Method for converting video into character animation under Spring boot frame Download PDF

Info

Publication number
CN110609684A
CN110609684A CN201910883313.9A CN201910883313A CN110609684A CN 110609684 A CN110609684 A CN 110609684A CN 201910883313 A CN201910883313 A CN 201910883313A CN 110609684 A CN110609684 A CN 110609684A
Authority
CN
China
Prior art keywords
video
file
spring boot
boot frame
stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910883313.9A
Other languages
Chinese (zh)
Other versions
CN110609684B (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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910883313.9A priority Critical patent/CN110609684B/en
Publication of CN110609684A publication Critical patent/CN110609684A/en
Application granted granted Critical
Publication of CN110609684B publication Critical patent/CN110609684B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Landscapes

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

Abstract

The invention discloses a method for converting video into character animation under a Spring boot frame, which comprises the following steps: step 1: acquiring a video File from a front-end page and transmitting the video File to a back end, reading video content after receiving the video File by the back end, converting the File received by the back end into a File type and then writing the File type into a byte stream; step 2: segmenting the byte stream, writing the segmented byte stream into File objects, and then converting each File object into a corresponding picture stream; and step 3: graying the picture stream, filling the picture stream with the character string, returning the filled character string to the front end for display, and setting a frame time interval at the front end to maintain the number of playing frames per second of the original video.

Description

Method for converting video into character animation under Spring boot frame
Technical Field
The invention relates to the field of computer video processing, in particular to a method for converting video into character animation under a Spring boot frame.
Background
The invention aims to solve the problem that no method for quickly and conveniently converting video into character animation exists in the current JAVA EE development. The reason for this problem is that the processing support of JAVA to video is not perfect, so most solutions to this problem are implemented by python, and JAVA implementation solutions are few. If JAVA is used for processing, external software is required to capture each frame and then code each frame for processing. Therefore, when a person engaged in JAVA development needs to complete a task of converting a video into a character animation under a spring boot frame, the code amount is very large and the degree of reduction of the character animation is not high enough.
Disclosure of Invention
The invention aims to provide a method for converting a video into a character animation under a Spring boot frame, which is used for solving the problems that in the prior art, when a JAVA developer needs to complete a task of converting the video into the character animation under the Spring boot frame, the code amount is extremely large and the reduction degree of the character animation is not high enough.
The invention solves the problems through the following technical scheme:
a method of animating video to characters under a Spring boot frame, the method comprising the steps of:
step 1: acquiring a video File from a front-end page and transmitting the video File to a back end, reading video content after receiving the video File by the back end, converting the File received by the back end into a File type and then writing the File type into a byte stream;
step 2: segmenting the byte stream, writing the segmented byte stream into File objects, and then converting each File object into a corresponding picture stream;
and step 3: graying the picture stream, filling the picture stream with the character string, returning the filled character string to the front end for display, and setting a frame time interval at the front end to maintain the number of playing frames per second of the original video.
Preferably, in step 1, MultipartFile reception is adopted when the video file is received at the back end.
Preferably, in the step 3, the picture stream is grayed by using buffer image.
Preferably, when filling the picture stream in step 3, the color of each pixel point is determined first, and the color is close to black filled characters and close to white filled spaces.
Preferably, in step 3, when the front end is returned, the populated character string is returned in JSON format by using ResponseBody of the Spring boot frame.
Preferably, when the picture stream is divided in step 2, the picture stream is divided according to a fixed size.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the invention provides a method for converting video into character animation based on JAVA under a spring boot frame.
Drawings
FIG. 1 is a schematic block diagram of the process of converting video into character animation according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.
Example 1:
referring to fig. 1, a method for animation of video to character under Spring boot frame, first, the video is transmitted from the front end to the back end. The front end adopts a form submission mode, and the mp4 video file is packaged into the form and submitted to the background. The background receives the corresponding file passed to the background with the MultipartFile class. The multipartFile class is a type of a corresponding file provided by the spring boot framework, and is convenient for file transmission between the foreground and the background. The form is a basic component of the front-end page, and various files and data can be placed in the form so as to be submitted to the background.
And then converting the MultiFile into a File class, writing the File class into the byte stream, and after the writing is finished, storing the information of the File in the byte stream so as to facilitate the subsequent processing of the video File by the JAVA code. The File class is a class corresponding to files (such as mp3, mp4, excel) in a computer carried by JAVA itself, and the files can be indirectly operated by the File class. The byte stream is also a file operation medium in JAVA, and can be used for more detailed processing of files.
And segmenting the obtained byte stream, and rewriting the segmented byte stream into the File class.
After the picture stream is obtained again, the construction attribute is specified to be buffer image. The picture stream is a kind of corresponding picture file in JAVA, and the picture stream can be used to indirectly manipulate the picture, such as viewing picture information, etc. The buffer image, type, byte, gray attribute function is to create a picture stream of a corresponding picture file in a graying manner. Thus, a grayed picture can be obtained.
And then performing character filling on the grayed picture. And circularly traversing each pixel point of the picture, judging whether the point is close to black or white according to the rgb value of each pixel point, filling the point close to black with special characters, and filling the point close to white with blank spaces. RGB is an internationally common color standard. The picture stream contains information of pixel points of the picture, through which the rgb value of the pixel point can be obtained, and then the rgb value is further judged to be close to black or white.
After completion of the padding, the padded character string structure is returned to the front end in json by ResponseBody of spring boot. And after receiving json, the front end takes the character string array contained in the json, sets the playing time interval of each character string in the character string array, and locally refreshes and displays on the page, so that the character animation can be displayed. Wherein, ResponseBody is an annotation in the spring boot frame, and the function is to return the returned result in JSON format.
Although the present invention has been described herein with reference to the illustrated embodiments thereof, which are intended to be preferred embodiments of the present invention, it is to be understood that the invention is not limited thereto, and that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the spirit and scope of the principles of this disclosure.

Claims (6)

1. A method for converting video into character animation under a Spring boot frame is characterized by comprising the following steps:
step 1: acquiring a video File from a front-end page and transmitting the video File to a back end, reading video content after receiving the video File by the back end, converting the File received by the back end into a File type and then writing the File type into a byte stream;
step 2: segmenting the byte stream, writing the segmented byte stream into File objects, and then converting each File object into a corresponding picture stream;
and step 3: graying the picture stream, filling the picture stream with the character string, returning the filled character string to the front end for display, and setting a frame time interval at the front end to maintain the number of playing frames per second of the original video.
2. The method for animating video converted into characters under a Spring boot frame as claimed in claim 1, wherein the MultipartFile reception is adopted when the video file is received at the back end in step 1.
3. The method for animating video to be converted into characters under a Spring boot frame as claimed in claim 1, wherein the picture stream is grayed in step 3 by using buffer image.
4. The method for animating video to characters under a Spring boot frame as claimed in claim 1, wherein when filling the picture stream in step 3, the color of each pixel point is determined, and the space is filled to be close to black filled character and white filled.
5. The method for animating video to convert characters under a Spring boot frame as claimed in claim 1, wherein in step 3, when the front end is returned, the populated character string is returned in JSON format by using ResponseBody of the Spring boot frame.
6. The method for animating video converted into characters under a Spring boot frame as claimed in claim 1, wherein the picture stream is divided according to a fixed size in the step 2.
CN201910883313.9A 2019-09-18 2019-09-18 Method for converting video into character animation under Spring boot frame Active CN110609684B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910883313.9A CN110609684B (en) 2019-09-18 2019-09-18 Method for converting video into character animation under Spring boot frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910883313.9A CN110609684B (en) 2019-09-18 2019-09-18 Method for converting video into character animation under Spring boot frame

Publications (2)

Publication Number Publication Date
CN110609684A true CN110609684A (en) 2019-12-24
CN110609684B CN110609684B (en) 2022-08-19

Family

ID=68891317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910883313.9A Active CN110609684B (en) 2019-09-18 2019-09-18 Method for converting video into character animation under Spring boot frame

Country Status (1)

Country Link
CN (1) CN110609684B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020089504A1 (en) * 1998-02-26 2002-07-11 Richard Merrick System and method for automatic animation generation
US6549201B1 (en) * 1999-11-23 2003-04-15 Center For Advanced Science And Technology Incubation, Ltd. Method for constructing a 3D polygonal surface from a 2D silhouette by using computer, apparatus thereof and storage medium
CN1725787A (en) * 2005-06-25 2006-01-25 深圳市经纬科技有限公司 Device and method for displaying color cartoon number on mobile phone
CN103607571A (en) * 2013-11-22 2014-02-26 吉林大学 Method for remotely monitoring videos and controlling cloud platform through Android phone
CN105446722A (en) * 2014-08-29 2016-03-30 优视科技有限公司 Serialization method and device and deserialization method and device
CN106775909A (en) * 2016-11-22 2017-05-31 中国银行股份有限公司 The determination methods and device of the coded format of a kind of JAVA files and byte stream
CN108229360A (en) * 2017-12-26 2018-06-29 美的集团股份有限公司 A kind of method of image procossing, equipment and storage medium
CN109885730A (en) * 2018-12-27 2019-06-14 北京春鸿科技有限公司 The video searching method in wifi storage equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020089504A1 (en) * 1998-02-26 2002-07-11 Richard Merrick System and method for automatic animation generation
US6549201B1 (en) * 1999-11-23 2003-04-15 Center For Advanced Science And Technology Incubation, Ltd. Method for constructing a 3D polygonal surface from a 2D silhouette by using computer, apparatus thereof and storage medium
CN1725787A (en) * 2005-06-25 2006-01-25 深圳市经纬科技有限公司 Device and method for displaying color cartoon number on mobile phone
CN103607571A (en) * 2013-11-22 2014-02-26 吉林大学 Method for remotely monitoring videos and controlling cloud platform through Android phone
CN105446722A (en) * 2014-08-29 2016-03-30 优视科技有限公司 Serialization method and device and deserialization method and device
CN106775909A (en) * 2016-11-22 2017-05-31 中国银行股份有限公司 The determination methods and device of the coded format of a kind of JAVA files and byte stream
CN108229360A (en) * 2017-12-26 2018-06-29 美的集团股份有限公司 A kind of method of image procossing, equipment and storage medium
CN109885730A (en) * 2018-12-27 2019-06-14 北京春鸿科技有限公司 The video searching method in wifi storage equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ABDENNOUR EL RHALIBI等: "Highly Realistic MPEG-4 Compliant Facial Animation with Charisma", 《 2011 PROCEEDINGS OF 20TH INTERNATIONAL CONFERENCE ON COMPUTER COMMUNICATIONS AND NETWORKS (ICCCN)》 *
CHOUGU3269: "java抖音视频转字符画(图片转字符画)_chougu3269的博客-CSDN博客", 《HTTPS://BLOG.CSDN.NET/CHOUGU3269/ARTICLE/DETAILS/100656221》 *
雨田哥: "Qt Gif转字符动画", 《HTTPS://BLOG.CSDN.NET/LY305750665/ARTICLE/DETAILS/90046733》 *

Also Published As

Publication number Publication date
CN110609684B (en) 2022-08-19

Similar Documents

Publication Publication Date Title
US10129385B2 (en) Method and apparatus for generating and playing animated message
WO2017206761A1 (en) Method and apparatus for displaying picture content in application, and storage medium
US10418000B2 (en) Method and apparatus for screen capture on a display device
CN108235055B (en) Method and device for realizing transparent video in AR scene
US20220237754A1 (en) Image processing method and apparatus
CN114531598A (en) Image compression method and device, intelligent terminal and computer readable storage medium
CN111222611B (en) Color-based stacked three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium
CN115209145A (en) Video compression method, system, device and readable storage medium
US7580041B1 (en) Direct storage of compressed scan converted data
CN110609684B (en) Method for converting video into character animation under Spring boot frame
CN116405692A (en) Transmission method based on cloud matting and related equipment
CN115225615B (en) Illusion engine pixel streaming method and device
CN109803157A (en) A kind of sequence frame picture transmission method, system and electronic equipment based on video
US20230024148A1 (en) Data processing methods and systems, and electronic devices
CN111541901B (en) Picture decoding method and device
CN111881648A (en) Method for generating electronic book font file
US9317891B2 (en) Systems and methods for hardware-accelerated key color extraction
CN113573125A (en) Subtitle rendering method and system based on SVG (scalable vector graphics) font library
CN112073726B (en) Compression method and device, computer readable storage medium and electronic device
WO2024045026A1 (en) Display method, electronic device, display device, screen mirroring device and medium
CN100521753C (en) Screen display device with color circulation function and its display method
CN106951226B (en) Method and system for displaying characters in thumbnail
US7428561B2 (en) Apparatus and method for scaling digital data information
CN116886984A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN115330910A (en) Expression animation display method, device and equipment based on MCU and storage medium

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