Video processing method and related device

By employing FFmpeg and Adobe After Effects in an automated system for frame splitting, background removal, and alignment, the method addresses low efficiency in traditional virtual filmmaking, enhancing processing speed and quality.

CN120321452APending Publication Date: 2025-07-15HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510526014.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

The traditional virtual film and television production process relies on manual processing, resulting in inefficient video processing.

Method used

By calling the first video processor for image framing, using the second video processor for background removal, determining the keyframe sequence, aligning and rendering, and finally calling the first video processor for video synthesis, realizing automated video generation.

Benefits of technology

It improves the degree of automation and efficiency of video processing and solves the problem of inefficient manual processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120321452A_ABST
    Figure CN120321452A_ABST
Patent Text Reader

Abstract

The invention discloses a video processing method and a related device, and relates to the field of computers, and the method comprises the steps: obtaining a target video, calling a first video processing program to carry out image framing processing on the target video, and obtaining a target sequence frame; calling a second video processing program to carry out background removal processing on each image of the target sequence frame to obtain a processed sequence frame; determining a key frame sequence corresponding to the processed sequence frame, and performing alignment operation on the processed sequence frame and the key frame sequence to obtain an aligned sequence frame; performing rendering operation on the aligned sequence frames to obtain rendered sequence frames; and calling a first video processing program to perform video synthesis operation on the rendered sequence frame to obtain a synthesized video. The video processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a video processing method and related devices. Background Art

[0002] In film and television production, the green screen technology is a commonly used virtual shooting method. By replacing the background with a virtual scene, complex visual effects can be achieved. However, most of the traditional virtual film and television production processes are carried out manually, resulting in low video processing efficiency. Summary of the Invention

[0003] In view of the above problems, this application provides a video processing method and related devices to achieve the purpose of improving video processing efficiency. The specific solutions are as follows:

[0004] The first aspect of this application provides a video processing method, including:

[0005] Obtain a target video, and call a first video processing program to perform image frame division processing on the target video to obtain a target sequence of frames;

[0006] Call a second video processing program to perform background removal processing on each image of the target sequence of frames to obtain a processed sequence of frames; wherein, the second video processing program is different from the first video processing program;

[0007] Determine a key frame sequence corresponding to the processed sequence of frames, and perform an alignment operation on the processed sequence of frames and the key frame sequence to obtain an aligned sequence of frames;

[0008] Perform a rendering operation on the aligned sequence of frames to obtain a rendered sequence of frames;

[0009] Call the first video processing program to perform video synthesis processing on the rendered sequence of frames to obtain a synthesized video.

[0010] In a possible implementation, the step of calling a first video processing program to perform image frame division processing on the target video to obtain a target sequence of frames includes:

[0011] Obtain video frame rate information;

[0012] Based on the video frame rate information, determine the parameters of the first video processing program;

[0013] Call the first video processing program, and based on the parameters of the first video processing program, perform image frame division processing on the target video to obtain the target sequence of frames.

[0014] In a possible implementation, the calling of the second video processing program to perform background removal processing on each image of the target sequence of frames to obtain the processed sequence of frames includes:

[0015] Call the second video processing program to perform color space analysis on each image of the target sequence of frames to obtain a target color background area, and perform target color background area removal processing on each image of the target sequence of frames to obtain the processed sequence of frames; wherein, each image in the processed sequence of frames is an image with an alpha channel.

[0016] In a possible implementation, the determining of the key frame sequence corresponding to the processed sequence of frames includes:

[0017] Obtain a set of key frame sequences; the set of key frame sequences includes multiple key frame sequences;

[0018] Based on the names of the key frame sequences in the set of key frame sequences, search for the processed sequence of frames with the corresponding name in the storage path of the target folder to obtain the key frame sequence corresponding to the processed sequence of frames; wherein, the target folder is used to store the processed sequence of frames.

[0019] In a possible implementation, after the aligning operation of the processed sequence of frames with the key frame sequence to obtain the aligned sequence of frames, it further includes:

[0020] Based on one or more parameters among the resolution, frame rate, encoding format, and color space of the video, adjust the aligned sequence of frames to obtain the adjusted sequence of frames.

[0021] In a possible implementation, the rendering operation on the aligned sequence of frames to obtain the rendered sequence of frames includes:

[0022] Perform a rendering operation on the aligned sequence of frames based on rendering parameters to obtain the rendered sequence of frames;

[0023] The calling of the first video processing program to perform video composition operation on the rendered sequence of frames to obtain the synthesized video includes:

[0024] Call the first video processing program to perform video composition operation on the rendered sequence of frames based on video generation parameters to obtain the synthesized video.

[0025] The second aspect of the present application provides a video processing system, including:

[0026] A frame splitting module, configured to obtain a target video, call a first video processing program to perform image frame splitting processing on the target video to obtain a target sequence of frames;

[0027] A background removal module, which is used to call a second video processing program to perform background removal processing on each image of the target sequence of frames, so as to obtain a processed sequence of frames; wherein, the second video processing program is different from the first video processing program;

[0028] An alignment module, which is used to determine a key frame sequence corresponding to the processed sequence of frames, and perform an alignment operation on the processed sequence of frames and the key frame sequence to obtain an aligned sequence of frames;

[0029] A rendering module, which is used to perform a rendering operation on the aligned sequence of frames to obtain a rendered sequence of frames;

[0030] A video processing module, which is used to call the first video processing program to perform video synthesis operation on the rendered sequence of frames to obtain a synthesized video.

[0031] A third aspect of the present application provides a computer program product, including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement the video processing method according to the first aspect or any implementation manner of the first aspect.

[0032] A fourth aspect of the present application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0033] The memory is used to store a computer program;

[0034] The processor is used to execute the computer program, so that the electronic device can implement the video processing method according to the first aspect or any implementation manner of the first aspect.

[0035] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the video processing method according to the first aspect or any implementation manner of the first aspect.

[0036] By means of the above technical solutions, the video processing method and related devices provided by the present application obtain a target sequence of frames by calling a first video processing program to perform image frame division on a target video; call a second video processing program to perform background removal processing on each image of the target sequence of frames to obtain a processed sequence of frames; determine a key frame sequence corresponding to the processed sequence of frames, and perform an alignment operation on the processed sequence of frames and the key frame sequence to obtain an aligned sequence of frames; perform a rendering operation on the aligned sequence of frames to obtain a rendered sequence of frames; call the first video processing program to perform video synthesis operation on the rendered sequence of frames to obtain a synthesized video, which can realize the automatic generation of virtual videos and improve the video processing efficiency. Brief Description of the Drawings

[0037] In conjunction with the accompanying drawings and with reference to the following detailed embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and that the original and the elements are not necessarily drawn to scale.

[0038] Figure 1 It is a flowchart of a video processing method provided by the present application;

[0039] Figure 2 It is a schematic diagram of a menu bar of an Unreal Engine provided by the present application;

[0040] Figure 3 It is a structural diagram of a video processing system provided by the present application;

[0041] Figure 4 It is a schematic diagram of the structure of an electronic device provided by the present application. Detailed Embodiments

[0042] The following describes the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.

[0043] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Those skilled in the art will know that with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0044] The terms "first", "second", etc. in the specification, claims, and the above drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing objects with the same attributes when describing the embodiments of the present application. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product, or device comprising a series of units does not have to be limited to those units, but may include other units that are not clearly listed or are inherent to these processes, methods, products, or devices.

[0045] Refer to Figure 1 , Figure 1 It is a flowchart illustration of a video processing method provided by an embodiment of the present application. As Figure 1 shown, a video processing method provided by an embodiment of the present application can be implemented through the Unreal Engine (UE). Figure 2It is a schematic diagram of the Unreal Engine menu bar. Figure 2 In Figure 2 , the virtual shooting frame includes video decompression with chroma keying, video offline rendering, and parameter configuration. The video processing method may include steps 101 to 105, which will be described in detail below.

[0046] Step 101: Obtain a target video, and call a first video processing program to perform image frame segmentation on the target video to obtain a target sequence of frames.

[0047] The target video may be a green screen video, that is, a video obtained by shooting with a green background during photography or videography. The first video processing program may be ffmpeg, which is an open-source computer program that can be used to record, convert digital audio and video, and convert them into streams. Image frame segmentation is the process of decomposing a video into individual static frame images.

[0048] After shooting the green screen video, save it to a specified folder, and then update the folder path to a parameter configuration file, which can be stored in JSON format. The parameter configuration file includes the video storage path, etc. By reading the video storage path in the parameter configuration file, the green screen video to be processed can be located. Under this video storage path, all eligible green screen video files can be traversed. During the traversal, according to the file extension (such as video formats like.mp4 and.avi) and possible file naming rules, the green screen video files to be processed can be identified.

[0049] In a possible implementation, calling the first video processing program to perform image frame segmentation on the target video to obtain a target sequence of frames includes:

[0050] Obtain video frame rate information;

[0051] Based on the video frame rate information, determine the parameters of the first video processing program;

[0052] Call the first video processing program, and based on the parameters of the first video processing program, perform image frame segmentation on the target video to obtain a target sequence of frames.

[0053] For the target video, an FFmpeg disassembly command for this video can be constructed. By calling the FFmpeg tool, the target video is disassembled into a sequence of image frames at a certain frame rate, that is, a target sequence of frames is obtained. During the disassembly process, according to the video frame rate information, the parameters of the first video processing program, that is, the parameters of FFmpeg, can be set to ensure that the generated sequence of frames can completely and accurately restore each frame of the video, while ensuring the temporal continuity between adjacent frames.

[0054] The disassembled target sequence frames can be saved in the same directory as the target video file or in a folder named after the target video. When creating the folder, you can first check if the folder already exists. If not, it will be automatically created. When saving each picture of the target sequence frames, you can name the sequence frame pictures according to a certain naming rule (such as naming them in ascending order of digital serial numbers) to ensure the sequentiality and recognizability of the pictures, which is convenient for further processing and analysis of these sequence frame pictures in the future.

[0055] Step 102: Call the second video processing program to perform background removal processing on each image of the target sequence frames to obtain the processed sequence frames; among them, the second video processing program is different from the first video processing program.

[0056] The second video processing program can be Adobe After Effects (AE). AE is used to create dynamic graphics, visual effects, animations, etc. Through various special effects, animation presets and compositing functions, high-quality visual works can be produced. This background removal processing can be green screen keying, that is, removing the green background part in the image and retaining the remaining image content. Using AE for green screen keying can avoid problems such as green spill and incomplete matte extraction in complex scenes compared to the built-in green screen keying module in Unreal Engine.

[0057] After the AE program is started, through the script interface of AE, the AE green screen keying script file address in the parameter configuration file can be used to locate and load the script file. This script file includes instructions and logic for green screen keying processing of sequence frame pictures, including a series of operation processes from obtaining pictures, setting keying parameters to outputting processing results. During the script loading process, AE can perform syntax checking and preliminary parsing on the script to ensure the correctness and executability of the script. After the script is loaded, each folder storing videos that need to be processed can be accessed in turn according to the file path rule. In each folder, all files can be traversed and filtered to accurately identify all sequence frame picture files. These picture files have different naming rules and file formats, and specifically, according to the pre-set recognition algorithm, it can be ensured that all sequence frame pictures that need to be processed can be correctly obtained.

[0058] In a possible implementation, calling the second video processing program to perform background removal processing on each image of the target sequence frames to obtain the processed sequence frames includes:

[0059] Call the second video processing program to perform color space analysis on each image of the target sequence frames to obtain the target color background area, and perform target color background area removal processing on each image of the target sequence frames to obtain the processed sequence frames; among them, each image in the processed sequence frames is an image with an alpha channel.

[0060] For each image of the target sequence frame, you can call AE's keying function for processing according to the green subtraction algorithm and green subtraction parameters set in the script. In the green subtraction process, you can first analyze the color space of the image to obtain the green background area. Then, use AE's image processing algorithm to remove the green background part from the image and generate image data with a transparent channel.

[0061] Optionally, during the background removal process, the keying parameters can be monitored and adjusted to ensure the accuracy and consistency of the green removal effect and avoid problems such as edge residue and loss of details.

[0062] In actual applications, the video splitting sequence frame and green subtraction process may include: obtaining the video file storage path and the address of the effect preset file in the parameter configuration file, the effect preset file may store the green subtraction algorithm and green subtraction parameters, obtaining the video file based on the video file storage path, calling ffmpeg to split the video into image sequence frames, obtaining all image sequence frames of a target video, extracting a frame of image, determining the green subtraction algorithm and green subtraction parameters according to the background in AE, saving it as a green subtraction template after confirming that the green subtraction effect is normal, and then updating its path to the parameter configuration file. Subsequent images can be processed according to the green subtraction template, that is, based on the green subtraction algorithm and green subtraction parameters, each image of the image sequence frame can be green subtracted to obtain the processed image, and the processed image can be saved until the processing of each image of all videos is completed.

[0063] For different film and television shooting, video processing may have different requirements. The parameter configuration file is used to configure the parameters, files or directories in the automation process, which is convenient for flexible configuration of all parameters in the automation process. Under the video file storage path, multiple videos can be processed at the same time, and each green screen video is traversed in turn, split into sequence frame images, and saved in the same directory, in a folder named after the video name. After the video is split, the sequence frame images in each folder are traversed in turn, and the images are processed one by one. The processed transparent images in PNG format can be saved in the subfolders of the corresponding folder.

[0064] Step 103: determining a key frame sequence corresponding to the processed sequence frames, and aligning the processed sequence frames with the key frame sequence to obtain an aligned sequence frame.

[0065] A key frame sequence is a series of key frames arranged in a specific order on the timeline. Determining the key frame sequence corresponding to the processed sequence frames can ensure the continuity and accuracy of the video image on the timeline.

[0066] In a possible implementation, determining a key frame sequence corresponding to the processed sequence frames includes:

[0067] Obtain a set of key frame sequences; the set of key frame sequences includes multiple key frame sequences;

[0068] Based on the names of the key frame sequences in the set of key frame sequences, search for the corresponding processed sequence frames by name in the storage path of the target folder to obtain the key frame sequences corresponding to the processed sequence frames; wherein, the target folder is used to store the processed sequence frames.

[0069] The Unreal Engine loads resources, scene settings, script files, etc. related to the virtual scene. After the loading is completed, in the Figure 2 In the main interface of the Unreal Engine shown, the video offline rendering process can be started through the "Video Offline Rendering" option in the menu bar. With the start of the video offline rendering process, the program will automatically traverse all the key frame sequences sequence in the set of key frame sequences, and sequentially read the information of each key frame sequence sequence, including but not limited to the name, duration, key frame distribution, existing media resource references, etc. of the key frame sequence. For each traversed key frame sequence, it can be searched and matched in the storage path of the target folder according to the key frame sequence name. The storage path of the target folder is used to store the location of the folder of the keyed-out pictures. Through the name matching algorithm, it is ensured that the folder of the keyed-out pictures corresponding to the current key frame sequence can be found, so as to obtain the key frame sequence corresponding to the processed sequence frames.

[0070] After determining the key frame sequences corresponding to the processed sequence frames, the processed sequence frames can be aligned with the key frame sequences to obtain the aligned sequence frames.

[0071] Match the folder of the keyed-out pictures, and take all the keyed-out picture files in the folder of the keyed-out pictures, that is, the processed sequence frames, as the image media source and add them to the segments of the corresponding key frame sequence sequence. During the adding process, the pictures can be arranged in the naming order or timestamp order to ensure that the arrangement order of the pictures in the key frame sequence sequence meets the expectations, so as to ensure the coherence of the video content.

[0072] In a possible implementation, after aligning the processed sequence frames with the key frame sequences to obtain the aligned sequence frames, the method further includes:

[0073] Based on one or more parameters such as the resolution, frame rate, encoding format, and color space of the video, adjust the aligned sequence frames to obtain the adjusted sequence frames.

[0074] After the key frame sequence alignment is completed, key parameters of the key frame sequence sequence can be adjusted and configured according to preset rules or user-defined parameters. The key parameters include but are not limited to the resolution, frame rate, encoding format, color space, etc. of the video. After the settings are completed, all changes to the key frame sequence sequence are saved to ensure that the updated key frame sequence sequence can generate high-quality video content according to the new settings during the subsequent video offline rendering process.

[0075] Step 104: Perform a rendering operation on the aligned sequence of frames to obtain the rendered sequence of frames.

[0076] In a possible implementation, performing a rendering operation on the aligned sequence of frames to obtain the rendered sequence of frames includes:

[0077] Perform a rendering operation on the aligned sequence of frames based on the rendering parameters to obtain the rendered sequence of frames.

[0078] The rendering parameters may include the rendering resolution, image quality, anti-aliasing level, light and shadow effect settings, etc. The API (Application Programming Interface) of the Unreal Engine can be called to automatically load the sequence of frames after green screen removal as the media source, and use the rendering parameters to achieve automatic rendering, outputting a single-frame sequence image for synthesizing the video, that is, the rendered sequence of frames.

[0079] When creating a rendering task, the rendering task can be named and set, such as setting the rendering quality, sequence frame range, etc. of the task. After the rendering task is created, a rendering preset file suitable for this rendering task can be selected in the storage path of the rendering preset file in the parameter configuration file. The rendering preset file includes rendering parameters such as the rendering resolution, image quality, anti-aliasing level, light and shadow effect settings, etc. By importing the rendering preset file, these predefined parameters can be quickly applied, avoiding the cumbersome manual parameter setting process, and at the same time ensuring that the rendering result meets specific quality and style requirements. After the rendering preset import is completed, a rendering operation is performed on the aligned sequence of frames. After rendering, each frame image generated by the rendering can be saved as a sequence of frame pictures according to the preset save path and naming rules. The save path can be obtained from the parameter configuration file. The naming of the sequence of frame pictures can adopt the method of continuous digital numbering to ensure that they can be accurately arranged in order during subsequent processing.

[0080] Step 105: Call the first video processing program to perform a video synthesis operation on the rendered sequence of frames to obtain the synthesized video.

[0081] In a possible implementation, a first video processing program is called to perform a video synthesis operation on the rendered sequence of frames to obtain a synthesized video, including:

[0082] Call the first video processing program to perform a video synthesis operation on the rendered sequence of frames based on video generation parameters to obtain a synthesized video.

[0083] The first video processing program can be Ffmpeg, and the video generation parameters can include the format, frame rate, encoding, etc. of the video.

[0084] After obtaining the rendered sequence of frame pictures, call the FFmpeg tool again for video synthesis. Set the output parameters of FFmpeg according to the video generation parameters in the parameter configuration file, such as the format, frame rate, encoding, etc. of the video. Finally, execute the FFmpeg command, and FFmpeg will synthesize the rendered sequence of frame pictures into the final video frame by frame in order and save the synthesized video.

[0085] In practical applications, when importing the processed sequence of frames into the Unreal Engine, the level sequence of the Unreal Engine can be obtained, a media track and a media source can be added to the level sequence, the processed sequence of frames can be added as a media source to the segments of the key frame sequence sequence, and the level sequence frames can be aligned. Set the key parameters of the key frame sequence sequence and save the sequence of frames. After adding a media track and a media source to the level sequence, new media tracks and media segments can be created. Before adding a media source to a segment, a media player and a media texture can be created. Then, in the case of clearing the original rendering queue, a rendering task can be created, and the rendering preset can be imported according to the address of the Unreal Engine rendering preset file in the parameter configuration file, and rendering can be performed. The rendering result can be saved as a sequence of frame pictures, and then these sequence of frame pictures can be synthesized into the final video through ffmpeg.

[0086] The video processing method of this application, based on the automatic green screen keying plugin of AE, can automatically identify the portrait and the background, achieve high-quality offline keying, and solve the problem of poor green screen keying effect. The keyed transparent pictures are automatically imported into UE as a sequence of frames to achieve seamless integration with the virtual scene. Using the API development ability of UE and developing a plugin with Python, one-key automatic shooting and parameter configuration can be achieved, simplifying the operation process. By automatically setting the UE rendering parameters, key frame alignment processing, etc. through the plugin, human errors can be avoided and the video processing efficiency can be improved.

[0087] The above introduced a video processing method provided by the embodiments of this application. Next, a system for executing the above video processing method will be introduced.

[0088] Please refer to Figure 3 , Figure 3Schematic diagram of a video processing system provided by an embodiment of the present application. As Figure 3 shown, the video processing system includes:

[0089] A frame division module 301, configured to obtain a target video, call a first video processing program to perform image frame division processing on the target video, and obtain a target sequence of frames.

[0090] A background removal module 302, configured to call a second video processing program to perform background removal processing on each image of the target sequence of frames, and obtain a processed sequence of frames; wherein, the second video processing program is different from the first video processing program.

[0091] An alignment module 303, configured to determine a key frame sequence corresponding to the processed sequence of frames, and perform an alignment operation on the processed sequence of frames and the key frame sequence to obtain an aligned sequence of frames.

[0092] A rendering module 304, configured to perform a rendering operation on the aligned sequence of frames to obtain a rendered sequence of frames.

[0093] A video processing module 305, configured to call a first video processing program to perform video synthesis operation on the rendered sequence of frames to obtain a synthesized video.

[0094] In a possible implementation, the frame division module 301 is specifically configured to:

[0095] Obtain video frame rate information;

[0096] Based on the video frame rate information, determine the parameters of the first video processing program;

[0097] Call the first video processing program, and perform image frame division processing on the target video based on the parameters of the first video processing program to obtain a target sequence of frames.

[0098] In a possible implementation, the background removal module 302 is specifically configured to:

[0099] Call the second video processing program, perform color space analysis on each image of the target sequence of frames to obtain a target color background region, and perform target color background region removal processing on each image of the target sequence of frames to obtain a processed sequence of frames; wherein, each image in the processed sequence of frames is an image with an alpha channel.

[0100] In a possible implementation, the alignment module 303 is specifically configured to:

[0101] Obtain a set of key frame sequences; the set of key frame sequences includes multiple key frame sequences;

[0102] Based on the name of the key-frame sequence in the set of key-frame sequences, look for the corresponding processed sequence frames in the storage path of the target folder to obtain the key-frame sequence corresponding to the processed sequence frames; wherein, the target folder is used to store the processed sequence frames.

[0103] In a possible implementation, the system further includes:

[0104] An adjustment module, configured to, after aligning the processed sequence frames with the key-frame sequence to obtain the aligned sequence frames, adjust the aligned sequence frames based on one or more parameters among the resolution, frame rate, encoding format, and color space of the video to obtain the adjusted sequence frames.

[0105] In a possible implementation, the rendering module 304 is specifically configured to:

[0106] Perform a rendering operation on the aligned sequence frames based on the rendering parameters to obtain the rendered sequence frames.

[0107] In a possible implementation, the video processing module 305 is specifically configured to:

[0108] Call the first video processing program to perform a video synthesis operation on the rendered sequence frames based on the video generation parameters to obtain the synthesized video.

[0109] An electronic device is also provided in an embodiment of the present application. Refer to Figure 4 As shown, it shows a schematic structural diagram of an electronic device suitable for implementing the electronic device in an embodiment of the present application. The electronic device in an embodiment of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptop computers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), desktop computers, and the like. Figure 4 The electronic device shown is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present application.

[0110] As Figure 4 shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 401, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage device 408 into the random access memory (RAM) 403. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through the bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.

[0111] Typically, the following devices can be connected to the I / O interface 405: input devices 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 408 including, for example, a memory card, a hard disk, etc.; and a communication device 409. The communication device 409 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 4 an electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.

[0112] The electronic device is capable of implementing the above video processing method.

[0113] An embodiment of the present application also provides a computer program product including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement any of the video processing methods provided by the embodiments of the present application.

[0114] An embodiment of the present application also provides a computer-readable storage medium carrying one or more computer programs, which, when executed by an electronic device, can enable the electronic device to implement any of the video processing methods provided by the embodiments of the present application.

[0115] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationships between the modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.

[0116] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions accomplished by computer programs can easily be implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits. However, for the present application, in more cases, software program implementation is a better embodiment. Based on such understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disc of a computer, and includes several instructions for causing a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0117] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.

[0118] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, training device, or data center to another website, computer, training device, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a training device or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

Claims

1. A video processing method, characterized in that, including: Obtain a target video, call a first video processing program to perform image frame splitting on the target video to obtain a target sequence of frames; Call a second video processing program to perform background removal processing on each image of the target sequence of frames to obtain a processed sequence of frames; wherein, the second video processing program is different from the first video processing program; Determine a key frame sequence corresponding to the processed sequence of frames, and perform an alignment operation on the processed sequence of frames and the key frame sequence to obtain an aligned sequence of frames; Perform a rendering operation on the aligned sequence of frames to obtain a rendered sequence of frames; Call the first video processing program to perform video synthesis on the rendered sequence of frames to obtain a synthesized video.

2. The video processing method according to claim 1, wherein The step of calling the first video processing program to perform image frame splitting on the target video to obtain a target sequence of frames includes: Obtain video frame rate information; Based on the video frame rate information, determine the parameters of the first video processing program; Call the first video processing program to perform image frame splitting on the target video based on the parameters of the first video processing program to obtain the target sequence of frames.

3. The video processing method according to claim 1, characterized in that The step of calling the second video processing program to perform background removal processing on each image of the target sequence of frames to obtain a processed sequence of frames includes: Call the second video processing program to perform color space analysis on each image of the target sequence of frames to obtain a target color background area, and perform target color background area removal processing on each image of the target sequence of frames to obtain a processed sequence of frames; wherein, each image in the processed sequence of frames is an image with an alpha channel.

4. The video processing method according to claim 1, wherein The step of determining the key frame sequence corresponding to the processed sequence of frames includes: Obtain a set of key frame sequences; the set of key frame sequences includes multiple key frame sequences; Based on the names of the key frame sequences in the set of key frame sequences, search for the processed sequence of frames with the corresponding name in the storage path of the target folder to obtain the key frame sequence corresponding to the processed sequence of frames; wherein, the target folder is used to store the processed sequence of frames.

5. The video processing method according to any one of claims 1 to 4, characterized in that, After performing the alignment operation on the processed sequence of frames and the key frame sequence to obtain an aligned sequence of frames, it further includes: Adjust the aligned sequence of frames based on one or more parameters such as the resolution, frame rate, encoding format, and color space of the video to obtain an adjusted sequence of frames.

6. The video processing method according to any one of claims 1 to 4, characterized in that The step of performing a rendering operation on the aligned sequence of frames to obtain a rendered sequence of frames includes: Perform a rendering operation on the aligned sequence of frames based on rendering parameters to obtain a rendered sequence of frames; The step of calling the first video processing program to perform video synthesis on the rendered sequence of frames to obtain a synthesized video includes: Call the first video processing program to perform video synthesis on the rendered sequence of frames based on video generation parameters to obtain the synthesized video.

7. A video processing system, characterized in that, including: A frame splitting module, configured to obtain a target video, call a first video processing program to perform image frame splitting on the target video to obtain a target sequence of frames; A background removal module, which is used to call a second video processing program to perform background removal processing on each image of the target sequence of frames, and obtain a processed sequence of frames; wherein, the second video processing program is different from the first video processing program; An alignment module, which is used to determine a key frame sequence corresponding to the processed sequence of frames, perform an alignment operation on the processed sequence of frames and the key frame sequence, and obtain an aligned sequence of frames; A rendering module, which is used to perform a rendering operation on the aligned sequence of frames and obtain a rendered sequence of frames; A video processing module, which is used to call the first video processing program to perform video synthesis on the rendered sequence of frames and obtain a synthesized video.

8. A computer program product, characterized in that, It includes computer-readable instructions, and when the computer-readable instructions run on an electronic device, the electronic device is enabled to implement the video processing method according to any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store a computer program; The processor is used to execute the computer program so that the electronic device can implement the video processing method according to any one of claims 1 to 6.

10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can be enabled to implement the video processing method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Video clip positioning method and device and electronic equipment

    CN121053589A