An AI video-based slimming system and method, and a storage medium
By employing multi-threaded processing and automatic optimization technologies, the problems of slow processing speed and low quality in AI video slimming systems have been solved, achieving efficient and automated video slimming and optimization, thereby improving video quality and processing speed.
Patent Information
- Application Number
- CN202411080458.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Existing AI video slimming systems suffer from slow processing speed, low video quality, and the need for manual adjustments, especially when processing large amounts of video data.
The video slimming process is handled using a multi-threaded approach, combining automatic optimization and active enhancement technologies. Through video frame extraction, target detection and recognition, image processing, video generation and optimization modules, computer vision and image processing technologies are used to achieve video slimming, and abnormal parameters are automatically optimized by adjustment modules.
It improves video processing speed, reduces the complexity of manual operation, ensures video quality, provides a clear and smooth visual experience, and has the ability to self-improve to adapt to different video types.
Smart Images

Figure CN119071567B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video slimming technology, and more specifically, to an AI-based video slimming system, method, and storage medium. Background Technology
[0002] AI video slimming is a technology that uses AI to optimize and compress videos. It primarily works by identifying scenes and objects within the video, performing intelligent analysis and processing to achieve video reduction and optimization. This technology can remove irrelevant people, props, and overly drawn-out plots, making the entire video more concise and improving viewing quality.
[0003] Currently, existing AI video slimming systems generally use a single-threaded approach when processing video content. The process involves frame image extraction, frame image detection and recognition, target region marking, and image processing and editing, followed by synthesis to obtain the slimmed-down video. While this method can achieve video slimming, it still has certain shortcomings. For example, due to the cumbersome processing steps, the parameters of the original video can be easily altered, resulting in a final video of lower quality than the original, requiring subsequent manual optimization and adjustment. In addition, when the video data to be processed is large, the single-threaded processing method means that the processor performs only one task unit at a time, resulting in slow system processing speed and long processing time. Summary of the Invention
[0004] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a slimming system, method and storage medium based on AI video.
[0005] To achieve the above objectives, the present invention provides the following technical solution, including:
[0006] The video import module is used to import the video to be processed into the system and perform preprocessing.
[0007] The video frame extraction module is used to extract representative frame images from imported videos.
[0008] The frame image processing module is used to perform target detection and recognition on the extracted frame images, and to mark, process and edit the target areas that need to be deleted or modified based on the results of target detection and recognition.
[0009] The video generation module is used to combine the processed and edited video frames together to generate the final video output;
[0010] The video optimization module is used to inspect and optimize the generated video to improve its quality. The optimization process includes automatic optimization and active enhancement.
[0011] The adjustment module is used to obtain the generated video quality assessment results and optimize and adjust the functional modules corresponding to abnormal parameters.
[0012] Preferably, automatic optimization is performed as follows: Import the generated video data, obtain the resolution, color reproduction, clarity, and smoothness parameter values of the video, mark these parameter values as the original parameters Bk, and compare them with the original video parameters Gm to perform quality assessment. If all parameter values in Bk are the same as those in Gm, the video is considered a lossless Level 1 video and is directly output. If one parameter value in Bk is lower than the parameter in Gm, the video is considered a low-loss Level 2 video, and a repair operation is performed or the video is directly output according to the manually input instructions. If two or more parameter values in Bk are lower than those in Gm, the video is considered a high-loss Level 3 video, these multiple parameter values are marked as abnormal parameters, and the abnormal parameters are repaired. After the repair is completed, the video is output.
[0013] Active enhancement involves adjusting and optimizing video parameters, including contrast, brightness, and hue, based on manual input after the video has been assessed as Level 1 in quality. This further improves the video's quality and visual appeal before outputting the final video.
[0014] Preferably, the adjustment module works as follows: it obtains the generated video quality assessment result, and based on the quality assessment result, the adjustment module counts the number of abnormal parameters. It sets the system's standard number of occurrences according to actual needs. When the count of abnormal parameters exceeds the preset standard number of occurrences, the adjustment module triggers the optimization adjustment function. Based on the functional module corresponding to the abnormal parameter, the adjustment module optimizes the module. After optimization, the adjustment module feeds back the result to the system.
[0015] Preferably, the specific processing procedure of the frame image processing module is as follows:
[0016] Target detection and recognition: Using computer vision technology, the extracted features are classified and located; based on the target detection results, the identified targets are classified and recognized; the target detection and recognition results are post-processed to remove redundant detection results and merge adjacent target regions, thereby improving the accuracy and reliability of target detection and recognition.
[0017] Target region marking: Based on the results of target detection and recognition, the target regions that need to be deleted or modified are marked;
[0018] Image processing and editing: Using image processing techniques and editing tools to process and edit the marked target area, including deletion, replacement, and blurring operations, to achieve a slimming effect.
[0019] Preferably, the frame image processing module adopts a multi-threaded approach to implement video slimming processing. The specific process is as follows: the video slimming process is decomposed into three sub-tasks: target detection and recognition, image processing and editing. A thread is created for each sub-task. Data to be processed is allocated to each thread according to the thread type, including a set of video frames and intermediate results in the processing. A synchronization mechanism using condition variables is used to ensure coordination and data consistency between threads. All threads are started and allowed to execute their respective tasks in parallel. After all threads have completed their respective tasks, all results are merged.
[0020] Preferably, the specific process of the video generation module generating video is as follows: selecting the frame images to be synthesized from the processed and edited frame images, and selecting the frame images according to the changes in the video content; then sorting the frame images according to the selection order or time order, and using video editing software or specialized synthesis software to synthesize the sorted frame images together to generate the final video output.
[0021] Preferably, the video frame extraction module includes two methods for extracting frame images: based on time intervals and based on changes in video content. The time interval method extracts frame images based on a uniform distribution over time, mainly extracting one frame per second to ensure representative frame images throughout the entire length of the video.
[0022] Preferably, the extraction method for video content is to determine whether the content has changed by analyzing the differences or similarities between each frame of the video. When a change in content is detected, that frame is extracted.
[0023] A weight loss method based on AI video includes the following steps:
[0024] S1. Import the video to be processed and perform preprocessing on the imported video;
[0025] S2. Extract representative frame images from the video;
[0026] S3. Perform target detection and recognition on the extracted frame images;
[0027] S3. Based on the results of target detection and recognition, mark the target areas that need to be deleted or modified;
[0028] S4. Perform image processing and editing on the marked target area;
[0029] S5. Combine the processed and edited video frames to generate the final video output.
[0030] A computer-readable storage medium, wherein when the program is executed by a processor, the steps of the AI-based video slimming method are implemented.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] The AI-based video slimming system provided by this invention can automatically import videos, extract frame images, perform target detection and recognition, process and edit images, synthesize videos, optimize videos, and automatically adjust modules when abnormal parameters are detected, greatly reducing the complexity of manual operation;
[0033] The system incorporates a video frame extraction module and a frame image processing module, utilizing AI algorithms to accurately extract frame images, detect and identify targets within video frames. This allows for precise marking and editing of areas requiring slimming or modification, effectively slimming down the video and optimizing its quality. Furthermore, the frame image processing module employs a multi-threaded approach, dividing the video slimming process into multiple subtasks that run simultaneously. Each subtask can be processed independently, fully utilizing the computer's multiple processor cores and accelerating the processing speed.
[0034] By setting up a video optimization module, which includes automatic optimization and active enhancement, the quality of the generated video can be evaluated. Based on the quality evaluation results, optimization processing can be performed automatically or actively to improve video quality and provide a clearer and smoother visual experience.
[0035] By setting an adjustment module, the system can automatically adjust and optimize abnormal functional modules based on the generated video quality assessment results, giving the system the ability to self-improve and adapt to the processing needs of different video types. Attached Figure Description
[0036] Figure 1 A structural block diagram of an AI video-based weight loss system provided by the present invention;
[0037] Figure 2 The flowchart illustrates a weight loss method based on AI video provided by this invention. Detailed Implementation
[0038] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0039] Reference Figure 1 The following is a further description of an embodiment of the AI video-based weight loss system, method, and storage medium of the present invention.
[0040] A video slimming system based on AI includes: a video import module, a video frame extraction module, a frame image processing module, a video generation module, a video optimization module, and an adjustment module.
[0041] The video import module is used to import the video to be processed into the system and perform preprocessing.
[0042] A video frame extraction module is used to extract representative frame images from imported videos. This module includes two methods for extracting frame images: based on time intervals and based on changes in video content. The time interval method extracts frame images based on a uniform distribution over time, primarily extracting one frame per second to ensure representative frame images throughout the entire video length. This method is simple and easy to use, suitable for processing long videos, and ensures a uniform distribution of frame images. However, this method may miss some important moments or rapidly changing content because it does not consider changes in video content. Therefore, this invention also employs another implementation method: extraction based on video content.
[0043] Extracting video content based on changes involves analyzing the differences or similarities between each frame to determine if the content has changed. When a change is detected, that frame is extracted. The advantage of this method is its ability to capture important moments and changes in the video. For example, in Python, the VideoCapture class from the OpenCV library can be used to read video files, and the read() method can be used to read the video frame by frame. By setting a timer or counter, a frame is extracted at regular intervals. The following is an implementation method for extracting frames based on changes in video content:
[0044] (1) Use the VideoCapture class to read video files and read the video frame by frame;
[0045] (2) For each frame of the image, a feature extraction algorithm (such as SIFT, SURF, etc.) is used to extract the feature vector of the image;
[0046] (3) Use a feature matching algorithm (e.g., Brute-Force matcher) to compare the feature vectors of the current frame image and the previous frame image to detect the similarity or difference between them;
[0047] (4) When the detected feature matching degree is lower than a certain threshold, it is considered that the content has changed, and the current frame image is extracted;
[0048] (5) Repeat steps 2-4 until the entire video has been processed.
[0049] The frame image processing module is used to perform target detection and recognition on the extracted frame images, and based on the results of target detection and recognition, to mark, process, and edit the target areas that need to be deleted or modified; the specific processing procedure of the frame image processing module is as follows:
[0050] Target detection and recognition: Using computer vision technology, the extracted features are classified and located; based on the target detection results, the identified targets are classified and recognized; the target detection and recognition results are post-processed to remove redundant detection results and merge adjacent target regions, thereby improving the accuracy and reliability of target detection and recognition.
[0051] Target region marking: Based on the results of target detection and recognition, the target regions that need to be deleted or modified are marked;
[0052] Image processing and editing: Using image processing techniques and editing tools to process and edit the marked target area, including deletion, replacement, and blurring operations, to achieve a slimming effect.
[0053] Furthermore, in this invention, the frame image processing module employs a multi-threaded approach to achieve video slimming. Specifically, the video slimming process is decomposed into three sub-tasks: target detection and recognition, image processing, and editing. A thread is created for each sub-task, and data to be processed is allocated to each thread based on its type, including a set of video frames and intermediate results during processing. A synchronization mechanism using condition variables ensures coordination and data consistency between threads. All threads are started and executed in parallel. After all threads complete their tasks, all results are merged. However, error handling is essential in a multi-threaded environment. Therefore, the frame image processing module in this invention also has the function of capturing and processing possible exceptions and errors in the threads, taking appropriate measures for recovery or retrying, and optimizing multi-threaded processing according to actual conditions. By adopting the above method, the multiple core processors of the computer can be fully utilized, accelerating the processing speed.
[0054] The video generation module is used to combine processed and edited video frames together to generate the final video output. The specific process of the video generation module to generate video is as follows: select the frame images to be combined from the processed and edited frame images, and select the frame images according to the changes in the video content; then sort the frame images according to the selection order or time order, and use video editing software or dedicated compositing software to combine the sorted frame images together to generate the final video output.
[0055] Additionally, it's important to note that during the compositing and output process, it's crucial to select the appropriate output format and quality to ensure the output video meets the user's needs. Common output formats include MP4, AVI, and WMV, which can be selected based on actual requirements. Furthermore, it's necessary to adjust the video quality, such as resolution and bitrate, according to specific needs.
[0056] The video optimization module is used to inspect and optimize the generated video to improve its quality. The optimization process includes automatic optimization and active enhancement. Automatic optimization involves: importing the generated video data, obtaining the resolution, color reproduction, sharpness, and smoothness parameters, marking these parameters as the original parameters Bk, and comparing them with the original video parameters Gm for quality assessment. If all parameter values in Bk are the same as those in Gm, the video is considered a lossless Level 1 video and is directly output. If one parameter value in Bk is lower than that in Gm, the video is considered a low-damage Level 2 video, and repair operations are performed based on manually input instructions, or the video is directly output. If two or more parameter values in Bk are lower than those in Gm, the video is considered a high-damage Level 3 video, these multiple parameter values are marked as abnormal parameters, and the abnormal parameters are repaired. After repair, the video is output.
[0057] Active enhancement involves adjusting and optimizing video parameters, including contrast, brightness, and hue, based on manual input after the video has been assessed as Level 1 in quality. This further improves the video's quality and visual appeal before outputting the final video.
[0058] The adjustment module is used to obtain the generated video quality assessment results and count the number of times abnormal parameters occur. After the system has run for a set period of time, it optimizes and adjusts the functional modules corresponding to abnormal parameters whose occurrences exceed a preset standard number. Its specific working process is as follows: It obtains the generated video quality assessment results, which can be achieved by calling the video optimization module or other related modules' interfaces; based on the quality assessment results, the adjustment module counts the number of times abnormal parameters occur. These abnormal parameters may include issues with resolution, color reproduction, clarity, and smoothness; according to actual needs, the system can set a standard number of occurrences to determine whether the number of abnormal parameters exceeds a preset standard range, for example, 3 times. When the number of abnormal parameters exceeds 3, adjustment is required. When the statistical results show that the number of abnormal parameters exceeds the preset standard number, the adjustment module triggers the optimization and adjustment function.
[0059] Based on the functional module corresponding to the abnormal parameter, the adjustment module will optimize and adjust that module, including adjusting parameter settings, improving algorithms, and updating models, in order to resolve the problem of the abnormal parameter. After optimization and adjustment, the adjustment module will feed back the results to the system so that subsequent processing or users can understand the optimization status.
[0060] Second Embodiment
[0061] Please refer to the following: Figure 2 A weight loss method based on AI video, applied to the aforementioned AI video-based weight loss system, includes the following steps:
[0062] S1. Import the video to be processed and perform preprocessing on the imported video;
[0063] S2. Extract representative frame images from the video;
[0064] S3. Perform target detection and recognition on the extracted frame images;
[0065] S3. Based on the results of target detection and recognition, mark the target areas that need to be deleted or modified;
[0066] S4. Perform image processing and editing on the marked target area;
[0067] S5. Combine the processed and edited video frames to generate the final video output.
[0068] This is a preferred embodiment of the present invention, a computer-readable storage medium storing thereon
[0069] A computer program. When executed by a processor, the program implements the steps of an AI-based video weight reduction method. This AI-based video weight reduction method can be applied in software form, such as a program designed to run independently on a computer-readable storage medium, which could be a USB flash drive.
[0070] In the description of this invention, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0071] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0072] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A weight loss system based on AI video, characterized in that, include: The video import module is used to import the video to be processed into the system and perform preprocessing. The video frame extraction module is used to extract representative frame images from imported videos. The frame image processing module is used to perform target detection and recognition on the extracted frame images, and to mark, process and edit the target areas that need to be deleted or modified based on the results of target detection and recognition. The video generation module is used to combine the processed and edited video frames together to generate the final video output; The video optimization module is used to inspect and optimize the generated video to improve its quality. The optimization process includes automatic optimization and active enhancement. Automatic optimization involves: importing the generated video data, obtaining the resolution, color reproduction, sharpness, and smoothness parameters of the video, marking these parameters as the original parameters Bk, and comparing them with the original video parameters Gm for quality assessment. If all parameter values in Bk are the same as those in Gm, the video is considered a lossless Level 1 video and is directly output. If one parameter value in Bk is lower than that in Gm, the video is considered a low-loss Level 2 video, and repair operations are performed based on manually input instructions, or the video is directly output. If two or more parameter values in Bk are lower than those in Gm, the video is considered a high-loss Level 3 video, these multiple parameter values are marked as abnormal parameters, and the abnormal parameters are repaired. After repair, the video is output. Active enhancement means that after a video is assessed as having a quality level of 1, further optimization instructions are given based on manual input. The parameters of the video, including contrast, brightness, and hue, are adjusted and optimized to further improve the quality and viewing experience of the video before outputting the video. The adjustment module is used to obtain the generated video quality assessment results and optimize and adjust the functional modules corresponding to abnormal parameters; The adjustment module works as follows: it obtains the generated video quality assessment results, and based on the quality assessment results, it counts the number of times abnormal parameters occur. It sets the system's standard number of occurrences according to actual needs. When the count results show that the number of abnormal parameters exceeds the preset standard number of occurrences, the adjustment module triggers the optimization adjustment function. Based on the functional module corresponding to the abnormal parameter, the adjustment module optimizes and adjusts that module. After optimization and adjustment, the adjustment module feeds back the results to the system.
2. The AI video-based weight loss system according to claim 1, characterized in that, The specific processing procedure of the frame image processing module is as follows: Target detection and recognition: Using computer vision technology, the extracted features are classified and located; based on the results of target detection, the identified targets are classified and recognized. Post-processing is performed on the target detection and recognition results to remove redundant detection results and merge adjacent target regions, thereby improving the accuracy and reliability of target detection and recognition. Target region marking: Based on the results of target detection and recognition, the target regions that need to be deleted or modified are marked; Image processing and editing: Using image processing techniques and editing tools to process and edit the marked target area, including deletion, replacement, and blurring operations, to achieve a slimming effect.
3. The AI video-based weight loss system according to claim 1, characterized in that, The frame image processing module employs a multi-threaded approach to achieve video slimming. Specifically, the video slimming process is broken down into three sub-tasks: target detection and recognition, image processing, and editing. A thread is created for each sub-task, and data to be processed, including a set of video frames and intermediate results, is allocated to each thread based on its type. A synchronization mechanism using condition variables ensures coordination and data consistency between threads. All threads are started and allowed to execute their respective tasks in parallel. Once all threads have completed their tasks, all results are merged.
4. The AI video-based weight loss system according to claim 1, characterized in that, The specific process of the video generation module generating video is as follows: select the frame images to be synthesized from the processed and edited frame images, and select the frame images according to the changes in the video content; then sort the frame images according to the selection order or time order, and use video editing software or special synthesis software to synthesize the sorted frame images together to generate the final video output.
5. The AI video-based weight loss system according to claim 1, characterized in that, The video frame extraction module includes two methods for extracting frame images: based on time intervals and based on changes in video content. The time interval method extracts frame images based on a uniform distribution over time, mainly extracting one frame per second to ensure representative frame images throughout the entire length of the video.
6. The AI video-based weight loss system according to claim 5, characterized in that, The method of extracting video content is to analyze the differences or similarities between each frame of the video to determine whether the content has changed. When a change in content is detected, that frame is extracted.
7. A weight loss method based on AI video, applied to the weight loss system based on AI video as described in any one of claims 1-6, characterized in that, The following steps are included: S1. Import the video to be processed and perform preprocessing on the imported video; S2. Extract representative frame images from the video; S3. Perform target detection and recognition on the extracted frame images; S3. Based on the results of target detection and recognition, mark the target areas that need to be deleted or modified; S4. Perform image processing and editing on the marked target area; S5. Combine the processed and edited video frames to generate the final video output.
8. A computer-readable storage medium, characterized in that, When the program is executed by the processor, it implements the steps of the AI-based video slimming method as described in claim 7.
Citation Information
Patent Citations
Foreground target key frame processing-based video abstract generation method
CN107943837A
Dynamic target recognition tracking image data optimization transmission method and system
CN108765354A