Video vision enhancement method and system and computer equipment

By introducing an Alpha channel into video frames and using cloud platform and hardware accelerated rendering technology, the problems of animation implementation efficiency and quality in the existing technology are solved, and efficient and low-cost animation production and playback effects are achieved.

CN119052556APending Publication Date: 2024-11-29SHENZHEN RENDERBUS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411263396.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Existing animation implementation technologies are difficult to achieve fast and economical animation effects while ensuring the quality of animations. Especially in network transmission and storage, there are bottlenecks, and the implementation of complex animations requires high technical capabilities, which affects page performance.

Method used

By introducing an Alpha channel into the video frame, videos with transparent background effects are generated, and the cloud platform is used for storage and preloading, combined with hardware accelerated rendering technology, the animation playback performance is optimized, and local preloading and fast animation playback are achieved.

Benefits of technology

It realizes efficient and low-cost production of animation effects, ensures high-quality and transparent background effects of animations, improves development efficiency and playback fluency, and provides users with a rich visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052556A_ABST
    Figure CN119052556A_ABST
Patent Text Reader

Abstract

The invention provides a video vision enhancement method and system and computer equipment, and the method comprises the steps: introducing an Alpha channel into a picture corresponding to each video frame for a to-be-processed video, obtaining a target video with a transparent background effect, and storing the target video in a cloud platform; when a target video is acquired from the cloud platform at the webpage end, the tilt is utilized; carrying out a videogt; the src attribute of the tag is combined with a URL.create Object URL method, so that local preloading for the target video is realized; and when animation playing of the target video is executed, obtaining current video frame data, performing hardware acceleration rendering on the current video frame data, and displaying a rendering result on a webpage so as to optimize the playing performance of the target video. According to the method and the device, high-efficiency and low-cost production of the animation effect is realized, meanwhile, high quality and transparent background effect of the animation are ensured, the animation effect in a design draft can be perfectly restored, meanwhile, the development efficiency and the animation playing fluency are greatly improved, and richer and more vivid visual experience is provided for a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of animation production technology, and in particular to a video vision enhancement method and system, and computer equipment. Background Art

[0002] In today's digital age, users' expectations for visual experience are growing, especially on mobile devices and web platforms. Animation effects, as a key element to enhance the attractiveness and functionality of the user interface (UI), have become an indispensable part of product design. However, traditional animation implementation techniques often require complex codes and a lot of graphic design work, which not only limits the rapid realization of creativity, but also increases development costs and time. Existing animation implementation technologies mainly include the following:

[0003] Frame animation: Although it can provide high-quality animation effects, the file size is large and not convenient for network transmission and storage.

[0004] Lottie and GIF: These formats are easy to use, but have limited support for color and transparency, making them difficult to meet the needs of complex animations.

[0005] Video (such as MP4): provides rich visual effects, but does not support transparent backgrounds, which limits the application of animations in different backgrounds.

[0006] Canvas and CSS animation: Although highly flexible, implementing complex animations requires high technical skills and may affect page performance.

[0007] The limitations of these technologies indicate that there is a lack of a technical solution in the current market that can both guarantee the quality of animation and achieve animation effects quickly and economically. Therefore, a new technical solution is needed to overcome these limitations, meet users' demand for efficient and high-quality animation effects, and promote the development and innovation of animation technology. Summary of the invention

[0008] To this end, the present invention provides a video visual enhancement method and system, and a computer device, aiming to solve the technical problem that the prior art cannot meet the user's demand for efficient and high-quality animation effects.

[0009] To achieve the above objectives, the present invention adopts the following technical solutions:

[0010] According to a first aspect of the present invention, the present invention provides a video visual enhancement method, the method comprising:

[0011] For the video to be processed, an Alpha channel is introduced into the picture corresponding to each video frame to obtain a target video with a transparent background effect, and the target video is stored in the cloud platform;

[0012] When the web page obtains the target video from the cloud platform, use <video>The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video;

[0013] When executing the animation playback of the target video, the current video frame data is obtained, the current video frame data is hardware accelerated and rendered, and the rendering result is displayed on the web page to optimize the playback performance of the target video.

[0014] Optionally, the method further comprises:

[0015] After the dynamic effects of the target video are produced, the AE file is exported as a sequence of frames using the AFXCreater tool, and then the sequence of frames is synthesized into a transparent video file, and the dynamic effects of the transparent video file are played through the AFX SDK component.

[0016] Optionally, the method further comprises:

[0017] During the playback of the target video, real-time monitoring <video>The error event of the tag is used to determine the abnormality of the playback of the target video;

[0018] When the target video is abnormally played, the <video>Label, showing the preset playback screen;

[0019] The preset playback screen includes at least one of a static picture and a GIF animation.

[0020] Optionally, before introducing an Alpha channel into a picture corresponding to each video frame to obtain a plurality of video frame pictures with a transparent background effect for the video to be processed, the method further comprises:

[0021] The cloud platform receives a rendering task carrying rendering parameters submitted by a user through a web page and creates a rendering task queue;

[0022] The rendering engine sequentially obtains rendering tasks from the rendering task queue, and renders the video frames corresponding to the rendering tasks frame by frame to obtain a plurality of rendering frames included in the video to be processed;

[0023] The rendering parameters include at least one of a 3D model, a material, and an animation.

[0024] Optionally, for the video to be processed, an Alpha channel is introduced into a picture corresponding to a video frame to obtain a plurality of video frame pictures with a transparent background effect, including:

[0025] The rendering engine outputs each video frame contained in the video to be processed as a PNG picture containing an Alpha channel, obtains a rendering frame with a transparent background effect, and stores it in a frame buffer;

[0026] After the rendering engine outputs all the rendering frames, a video encoding tool is used to encode the PNG sequence in the frame buffer into an AFX transparent video supporting a transparent channel as the target video.

[0027] Optionally, the use <video>The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video, including:

[0028] The web page requests the cloud platform to obtain the URL of the target video according to the rendering task ID;

[0029] Creating HTML5 for playing videos <video>Label, the <video>The src attribute of the tag is set to the URL of the target video;

[0030] Create a local Blob URL using the URL.createObjectURL method, and preload the target data into the browser cache to speed up the loading of the target video;

[0031] and / or,

[0032] The <video>The preload attribute of the tag is set to auto to instruct the browser to start loading the target video as early as possible when the page is loaded;

[0033] The target video is cached locally using IndexDB technology to reduce repeated downloads and improve secondary loading speed.

[0034] Optionally, before obtaining the current video frame data and performing hardware accelerated rendering on the current video frame data, the method further includes:

[0035] The <video>The autoplay attribute of the tag is true, so that the target video is automatically played; and,

[0036] Use CSS to set the background color or image of the video playback area to achieve the integration of animation and different backgrounds.

[0037] Optionally, the obtaining of current video frame data, performing hardware accelerated rendering on the current video frame data, and displaying the rendering result on a web page to optimize the playback performance of the target video includes:

[0038] During the playback of the target video, the <video>The timeupdate event of the tag triggers the callback function when each video frame is played;

[0039] In the callback function, the drawImage API provided by the AFX SDK is used to obtain the current video frame data;

[0040] The current video frame data is passed to the OpenGL rendering pipeline, the GPU is used for hardware accelerated rendering, and the rendering result is displayed on the web page.

[0041] According to a second aspect of the present invention, the present invention provides a video visual enhancement system, the system comprising:

[0042] A background effect optimization module is used to introduce an Alpha channel into the picture corresponding to each video frame for the video to be processed, obtain a target video with a transparent background effect, and store the target video in a cloud platform;

[0043] The video loading optimization module is used to obtain the target video from the cloud platform on the web page using <video>The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video;

[0044] The playback performance optimization module is used to obtain the current video frame data when executing the animation playback of the target video, perform hardware accelerated rendering on the current video frame data, and display the rendering result on the web page to optimize the playback performance of the target video.

[0045] According to the third aspect of the present invention, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the video visual enhancement method as described in any one of the first aspect of the present invention when executing the computer program.

[0046] The present invention adopts the above technical solution and has at least the following beneficial effects:

[0047] Through the scheme of the present invention, for the video to be processed, an Alpha channel is introduced into the picture corresponding to each video frame to obtain a target video with a transparent background effect, and the target video is stored in a cloud platform; when the web page obtains the target video from the cloud platform, the target video is obtained by using <video>The src attribute of the tag, combined with the URL.createObjectURL method, realizes local preloading of the target video; when executing the animation playback of the target video, the current video frame data is obtained, the current video frame data is hardware accelerated for rendering, and the rendering result is displayed on the web page to optimize the playback performance of the target video. In this way, the animation effect can be produced efficiently and at low cost, while ensuring the high quality of the animation and the transparent background effect; through the introduction of transparent channels and innovative processing of video frames, the animation effects in the design draft can be perfectly restored, while greatly improving the development efficiency and the smoothness of animation playback, providing users with a richer and more vivid visual experience.

[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A schematic diagram showing a flow chart of a video visual enhancement method provided by an embodiment of the present invention;

[0051] Figure 2 A schematic diagram showing the structure of a video vision enhancement system provided by an embodiment of the present invention is shown;

[0052] Figure 3 A schematic diagram showing the structure of a video vision enhancement system provided by another embodiment of the present invention is shown;

[0053] Figure 4 A schematic diagram of the physical structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0054] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0056] The embodiment of the present invention provides a video visual enhancement method, such as Figure 1 As shown, at least the following steps S101 to S103 may be included:

[0057] Step S101, for the video to be processed, introduce an Alpha channel into the picture corresponding to each video frame to obtain a target video with a transparent background effect, and store the target video in a cloud platform.

[0058] Generally, after users submit 3D models and animation rendering tasks on the cloud platform, they can preview the animation effects in real time through the web page. To ensure the smoothness of the preview and the transparent background effect, the embodiment of the present invention uses AFX (Alpha Format Extension, which refers to a video format that supports transparent channels) transparent video technology for optimization to achieve the cloud rendering animation preview function.

[0059] Before processing the video frames, the cloud platform receives the rendering tasks with rendering parameters submitted by the user through the web page and creates a rendering task queue; the rendering engine obtains the rendering tasks from the rendering task queue in sequence, and renders the video frames corresponding to the rendering tasks frame by frame to obtain multiple rendering frames contained in the video to be processed. In actual operation, users can submit rendering parameters such as 3D models, materials, animations, etc. on the web page. The cloud platform receives the parameters, creates a rendering task, and adds it to the task queue. The rendering engine obtains the task from the queue and starts rendering frame by frame.

[0060] Furthermore, the rendering engine outputs each video frame contained in the video to be processed as a PNG image containing an Alpha channel, obtains a rendered frame with a transparent background effect, and stores it in the frame cache; when the rendering engine outputs all the rendered frames, the video encoding tool is used to encode the PNG sequence in the frame cache into an AFX transparent video that supports transparent channels as the target video. In actual applications, the rendering engine outputs each frame as a PNG image containing an Alpha channel to ensure that the background is transparent, and stores the rendered frame in the frame cache, and then determines whether all frames have been rendered. If not, continue to render the next frame; if so, proceed to the next step; FFmpeg can be used to encode the PNG sequence in the frame cache into a WebM (open video file format that supports VP8, VP9 video encoding and Vorbis, Opus audio encoding) or apng (animated PNG format that supports 24-bit images and 8-bit transparency) format video file that supports transparent channels, that is, AFX transparent video, and the generated AFX transparent video is stored in the cloud storage service for web access. The code example is as follows:

[0061] #Cloud Platform Rendering Server

[0062] def handle_render_task(task_params):

[0063] #...Get rendering parameters...

[0064] task=RenderTask(task_params)

[0065] task_queue.push(task)

[0066] def render_worker():

[0067] while True:

[0068] task = task_queue.pop()

[0069] renderer=Renderer(task.params)

[0070] frame_buffer = []

[0071] while not renderer.is_finished():

[0072] frame = renderer.render_frame() # Output PNG image, including Alpha channel

[0073] frame_buffer.append(frame)

[0074] video_data=encode_video(frame_buffer,format='webm')#or'apng'

[0075] save_video(video_data,task.id)

[0076] #Start the rendering worker thread

[0077] for i in range(NUM_WORKERS):

[0078] start_thread(render_worker)

[0079] Step S102, when the web page obtains the target video from the cloud platform, use <video>The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video.

[0080] The embodiment of the present invention also optimizes video preloading and caching. Specifically, the web page can request the cloud platform to obtain the URL of the target video according to the rendering task ID; create an HTML5 <video>Tags, <video>The src attribute of the tag is set to the URL of the target video; the URL.createObjectURL method is used to create a local Blob URL, and the target data is preloaded into the browser cache to speed up the loading of the target video. <video>The preload attribute of the tag is set to auto to instruct the browser to start loading the target video as early as possible when the page is loaded; use IndexDB technology to cache the target video locally to reduce repeated downloads and improve the secondary loading speed. This step stores the downloaded animation resources locally to achieve persistent caching of resources, reduce repeated downloads, and improve loading efficiency. The code example is as follows:

[0081] / / Web page

[0082] const videoUrl=getVideoUrl(taskId);

[0083] const videoElement=document.createElement('video');

[0084] videoElement.src=videoUrl;

[0085] / / Create Blob URL preload

[0086] const blobUrl=URL.createObjectURL(videoElement.src);

[0087] videoElement.src = blobUrl;

[0088] videoElement.preload='auto';

[0089] / / Cache to IndexDB

[0090] cacheVideo(taskId,videoUrl)

[0091] .then(()=>{console.log('Video cached successfully');})

[0092] .catch(error=>{console.error('Video cache failed:',error);});

[0093] async function cacheVideo(taskId,videoUrl){

[0094] const db=await openIndexedDB('video-cache');

[0095] const transaction=db.transaction(['videos'],'readwrite');

[0096] const store=transaction.objectStore('videos');

[0097] await store.put({taskId,url:videoUrl});

[0098] }

[0099] Step S103, when executing the animation playback of the target video, obtain the current video frame data, perform hardware accelerated rendering on the current video frame data, and display the rendering result on the web page to optimize the playback performance of the target video.

[0100] The embodiment of the present invention also optimizes animation playback and performance. Prior to this, the embodiment of the present invention can set the video playback, for example, <video>The autoplay attribute of the tag is true to enable the target video to play automatically; and the background color or image of the video playback area is set through CSS to achieve the integration of animation and different backgrounds. During the playback of the target video, the embodiment of the present invention can monitor the <video>The timeupdate event of the tag triggers the callback function when each video frame is played; in the callback function, the drawImage API provided by the AFX SDK is used to obtain the current video frame data; the current video frame data is passed to the OpenGL (Open Graphics Library, used to render 2D and 3D graphics) rendering pipeline, the GPU is used for hardware accelerated rendering, and the rendering results are displayed on the web page. It is understandable that using the GPU to load rendering can improve playback performance and fluency to a certain extent, and achieve a fast animation preview effect. The code example is as follows:

[0101] / / Web page

[0102] const videoElement=document.getElementById('preview-video');

[0103] const canvas=document.getElementById('preview-canvas');

[0104] const gl=canvas.getContext('webgl');

[0105] videoElement.play();

[0106] / / Set the playback area background

[0107] const container=document.getElementById('preview-container');

[0108] container.style.backgroundImage='url(background.jpg)';

[0109] videoElement.addEventListener('timeupdate',()=>{

[0110] const frameData = getFrameData(videoElement); / / Get frame data using AFX SDK

[0111] renderFrame(gl,frameData); / / Render frame using OpenGL

[0112] });

[0113] Furthermore, the embodiments of the present invention can also optimize the process of motion effect production. For example, after the visual designer has completed the dynamic effect of the target video, the AFXCreater tool is used to export the AE file as a sequence of frames and synthesize it into a transparent video file. R&D personnel can integrate these video files in the project and play the motion effects through the AFX SDK to achieve rapid development and high restoration of the motion effects.

[0114] Furthermore, the embodiment of the present invention also provides a CSS fallback strategy for dealing with abnormal playback situations. Specifically, during the playback of the target video, the <video>The error event of the tag is used to determine the abnormality of the target video playback; when the target video has abnormal playback, hide <video>Tag, display the preset playback screen; the preset playback screen can include static pictures, GIF animations, etc. This ensures that even if the AFX solution fails to play, the page can still run normally, ensuring the continuity and consistency of the user experience. The code example is as follows:

[0115] / / Web page

[0116] const videoElement=document.getElementById('preview-video');

[0117] const fallbackImage=document.getElementById('fallback-image');

[0118] videoElement.addEventListener('error',()=>{

[0119] console.error('afx video playback error');

[0120] videoElement.style.display='none';

[0121] fallbackImage.style.display='block';

[0122] });

[0123] The embodiment of the present invention provides a video visual enhancement method, which introduces an Alpha channel into the picture corresponding to each video frame of the video to be processed, obtains a target video with a transparent background effect, and stores the target video in a cloud platform; when a web page obtains the target video from the cloud platform, the target video is obtained by using <video>The src attribute of the tag is combined with the URL.createObjectURL method to realize local preloading of the target video; when executing the animation playback of the target video, the current video frame data is obtained, the current video frame data is hardware accelerated and rendered, and the rendering result is displayed on the web page to optimize the playback performance of the target video. The present invention has at least the following advantages:

[0124] 1. Reduce development costs: Through the use and optimization of automated tools, the animation implementation process is simplified, the reliance on professional animation design and programming skills is reduced, the labor cost is reduced, and the animation cycle from design to implementation is shortened. Compared with traditional animation technology, the solution based on afx transparent video greatly reduces development costs and time. For example, when implementing complex animation effects, the development time is shortened from 2 days to 0.5 days, which improves development efficiency by 75%.

[0125] 2. Improve animation quality: Use transparent video technology to achieve high-quality animation effects with transparent backgrounds and enhance the visual experience. Highly restore the designer's original motion effect video, provide a high-quality visual experience, while maintaining the smoothness and naturalness of the animation.

[0126] 3. Enhanced performance: By optimizing resource management and rendering technology, the page frame rate has been significantly improved and the CPU usage has been reduced, providing a smoother user experience and reducing the impact on device performance.

[0127] 4. Improve technical flexibility: Enable the solution to adapt to different application scenarios and needs, including but not limited to Web, mobile applications and games, proving its effectiveness and reliability in practical applications.

[0128] 5. The fallback strategy ensures that the page can still be displayed normally even in the case of abnormal playback, enhancing the robustness of the solution.

[0129] Further, as Figure 1 The specific implementation of the present invention provides a video visual enhancement system, such as Figure 2 As shown, the system may include: a background effect optimization module 210, a video loading optimization module 220, and a playback effect optimization module 230.

[0130] The background effect optimization module 210 can be used to introduce an Alpha channel into the picture corresponding to each video frame for the video to be processed, obtain a target video with a transparent background effect, and store the target video in the cloud platform;

[0131] The video loading optimization module 220 can be used to obtain the target video from the cloud platform on the web page. <video>The src attribute of the tag is combined with the URL.createObjectURL method to achieve local preloading of the target video;

[0132] The playback performance optimization module 230 can be used to obtain current video frame data when executing animation playback of the target video, perform hardware accelerated rendering on the current video frame data, and display the rendering results on the web page to optimize the playback performance of the target video.

[0133] Alternatively, if Figure 3 As shown, another embodiment of the present invention provides a video visual enhancement system, which also includes: a rendering task execution module 240, a dynamic effect playback module 250, a playback exception processing module 260 and a playback pre-processing module 270.

[0134] The rendering task execution module 240 may be used to introduce an Alpha channel into each video frame corresponding to the image to be processed to obtain multiple video frame images with a transparent background effect. The cloud platform receives a rendering task with rendering parameters submitted by the user through the web page to create a rendering task queue.

[0135] The rendering engine sequentially obtains rendering tasks from the rendering task queue, renders the video frames corresponding to the rendering tasks frame by frame, and obtains multiple rendering frames contained in the video to be processed;

[0136] The rendering parameters include at least one of a 3D model, a material, and an animation.

[0137] The dynamic effect playback module 250 can be used to export the AE file into a sequence frame using the AFXCreater tool after the dynamic effect of the target video is produced, and then the sequence frame is synthesized into a transparent video file, and the dynamic effect of the transparent video file is played through the AFX SDK component.

[0138] The playback exception handling module 260 can be used to monitor in real time during the playback of the target video. <video>The error event of the tag is used to determine the abnormality of the playback of the target video;

[0139] When the target video plays abnormally, hide <video>Label, showing the preset playback screen;

[0140] The preset playback screen includes at least one of a static picture and a GIF animation.

[0141] The playback pre-processing module 270 may be used to obtain the current video frame data and perform hardware accelerated rendering on the current video frame data before performing hardware accelerated rendering on the current video frame data. <video>The tag's autoplay attribute is true to make the target video play automatically; and,

[0142] Use CSS to set the background color or image of the video playback area to achieve the integration of animation and different backgrounds.

[0143] Optionally, the background effect optimization module 210 can also be used for the rendering engine to output each video frame contained in the video to be processed as a PNG picture containing an Alpha channel, obtain a rendering frame with a transparent background effect, and store it in a frame buffer;

[0144] After the rendering engine outputs all the rendered frames, the video encoding tool is used to encode the PNG sequence in the frame buffer into an AFX transparent video supporting a transparent channel as the target video.

[0145] Optionally, the video loading optimization module 220 can also be used for the web page to request the cloud platform to obtain the URL of the target video according to the rendering task ID;

[0146] Creating HTML5 for playing videos <video>Tags, <video>The src attribute of the tag is set to the URL of the target video;

[0147] Use the URL.createObjectURL method to create a local Blob URL and preload the target data into the browser cache to speed up the loading of the target video.

[0148] and / or,

[0149] Will <video>The preload attribute of the tag is set to auto to instruct the browser to start loading the target video as early as possible when the page loads;

[0150] Use IndexDB technology to cache the target video locally to reduce repeated downloads and improve secondary loading speed.

[0151] Optionally, the playback performance optimization module 230 can also be used to monitor in real time during the playback of the target video. <video>The timeupdate event of the tag triggers the callback function when each video frame is played;

[0152] In the callback function, use the drawImage API provided by the AFX SDK to obtain the current video frame data;

[0153] Pass the current video frame data to the OpenGL rendering pipeline, use the GPU for hardware accelerated rendering, and display the rendering results on the web page.

[0154] It should be noted that for other corresponding descriptions of the functional modules involved in the video visual enhancement system provided in the embodiment of the present invention, reference can be made to Figure 1 The corresponding description of the method shown will not be repeated here.

[0155] Based on the above Figure 1 The method shown and Figure 3 The embodiment of the system shown in the figure, the embodiment of the present invention also provides a physical structure diagram of a computer device, such as Figure 4 As shown, the computer device may include a communication bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit may communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the steps of the video visual enhancement method of the above embodiment.

[0156] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.

[0157] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into one processing unit. The above integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.

[0158] Those skilled in the art can understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions to enable a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.

[0159] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the methods described in the embodiments of the present invention.

[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate from the protection scope of the present invention.< / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video> < / video>

Claims

1. A video visual enhancement method, characterized in that: The method comprises: For the video to be processed, an Alpha channel is introduced into the picture corresponding to each video frame to obtain a target video with a transparent background effect, and the target video is stored in the cloud platform; When the web page obtains the target video from the cloud platform, use <video> The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video;< / video> When executing the animation playback of the target video, the current video frame data is obtained, the current video frame data is hardware accelerated and rendered, and the rendering result is displayed on the web page to optimize the playback performance of the target video.

2. The method according to claim 1, characterized in that The method further comprises: After the dynamic effects of the target video are produced, the AE file is exported as a sequence of frames using the AFXCreater tool, and then the sequence of frames is synthesized into a transparent video file, and the dynamic effects of the transparent video file are played through the AFX SDK component.

3. The method according to claim 1, characterized in that: The method further comprises: During the playback of the target video, real-time monitoring <video> The error event of the tag is used to determine the abnormality of the playback of the target video;< / video> When the target video is abnormally played, the <video> Label, showing the preset playback screen;< / video> The preset playback screen includes at least one of a static picture and a GIF animation.

4. The method according to claim 1, characterized in that: Before introducing an Alpha channel into a picture corresponding to each video frame for the video to be processed to obtain a plurality of video frame pictures with a transparent background effect, the method further includes: The cloud platform receives a rendering task carrying rendering parameters submitted by a user through a web page and creates a rendering task queue; The rendering engine sequentially obtains rendering tasks from the rendering task queue, and renders the video frames corresponding to the rendering tasks frame by frame to obtain a plurality of rendering frames included in the video to be processed; The rendering parameters include at least one of a 3D model, a material, and an animation.

5. The method according to claim 4, characterized in that For the video to be processed, an Alpha channel is introduced into the picture corresponding to the video frame to obtain multiple video frame pictures with a transparent background effect, including: The rendering engine outputs each video frame contained in the video to be processed as a PNG picture containing an Alpha channel, obtains a rendering frame with a transparent background effect, and stores it in a frame buffer; After the rendering engine outputs all the rendering frames, a video encoding tool is used to encode the PNG sequence in the frame buffer into an AFX transparent video supporting a transparent channel as the target video.

6. The method according to claim 1, characterized in that The utilization <video> The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video, including:< / video> The web page requests the cloud platform to obtain the URL of the target video according to the rendering task ID; Creating HTML5 for playing videos <video>Label, the <video> The src attribute of the tag is set to the URL of the target video;< / video> < / video> Create a local Blob URL using the URL.createObjectURL method, and preload the target data into the browser cache to speed up the loading of the target video; and / or, The <video> The preload attribute of the tag is set to auto to instruct the browser to start loading the target video as early as possible when the page is loaded;< / video> The target video is cached locally using IndexDB technology to reduce repeated downloads and improve secondary loading speed.

7. The method according to claim 1, characterized in that Before obtaining the current video frame data and performing hardware accelerated rendering on the current video frame data, the method further includes: The <video> The autoplay attribute of the tag is true, so that the target video is automatically played; and,< / video> Use CSS to set the background color or image of the video playback area to achieve the integration of animation and different backgrounds.

8. The method according to claim 1, characterized in that The obtaining of current video frame data, performing hardware accelerated rendering on the current video frame data, and displaying the rendering result on a web page to optimize the playback performance of the target video includes: During the playback of the target video, the <video> The timeupdate event of the tag triggers the callback function when each video frame is played;< / video> In the callback function, the drawImage API provided by the AFX SDK is used to obtain the current video frame data; The current video frame data is passed to the OpenGL rendering pipeline, the GPU is used for hardware accelerated rendering, and the rendering result is displayed on the web page.

9. A video visual enhancement system, characterized in that: The system comprises: A background effect optimization module is used to introduce an Alpha channel into the picture corresponding to each video frame for the video to be processed, obtain a target video with a transparent background effect, and store the target video in a cloud platform; The video loading optimization module is used to obtain the target video from the cloud platform on the web page using <video> The src attribute of the tag, combined with the URL.createObjectURL method, implements local preloading of the target video;< / video> The playback performance optimization module is used to obtain the current video frame data when executing the animation playback of the target video, perform hardware accelerated rendering on the current video frame data, and display the rendering result on the web page to optimize the playback performance of the target video.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the video visual enhancement method according to any one of claims 1 to 8 is implemented.