System and method for dynamically adding video watermark in non-hard coding mode
Through the non-hard-coding dynamic video watermark system, the performance impact and picture quality loss caused by hard coding in the existing technology are solved, and efficient and flexible video watermark management is realized, suitable for multi-platform and multi-scenarios.
Patent Information
- Application Number
- CN202411536134.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-25
AI Technical Summary
The existing video watermarking technology is implemented in hard-coded mode, resulting in performance impact, picture quality loss, synchronization problems, compatibility problems, low encoding efficiency, difficulty in balancing watermark visibility and removability, and cross-platform development challenges.
Adopt a non-hard coded dynamic video watermark system, including watermark management module, watermark real-time rendering module, archive storage module and video watermark hard code module, and realize the dynamic watermark through watermark template management, data storage, rendering cycle management and video binding. Add and manage.
It realizes low resource consumption and high-performance video watermark addition, avoids the performance impact and picture quality loss caused by hard coding, improves the visibility and removability of watermarks, and simplifies cross-platform development.
Smart Images

Figure CN119520929A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video security, in particular to a system and method for dynamically adding video watermarks without hard coding. Background Art
[0002] The application of video technology is becoming more and more extensive. From traditional security to the mobile phones that everyone has, the convenience brought by video technology can be seen everywhere. However, there are still unsatisfactory problems in the details of some accessories-related needs. Currently, video watermarks are mostly hard-coded to encode watermarks and videos as a whole. The problems they face are as follows:
[0003] 1. Performance impact: Real-time video processing consumes a lot of CPU and GPU resources, especially when adding watermarks on high-resolution or high-frame-rate videos, which may cause device overheating, faster battery consumption, or slower application response;
[0004] 2. Image quality loss: Improper watermarking process may cause the original video quality to deteriorate, especially during compression and decompression. Improper watermark transparency, size and position may cause visual interference or pixelation.
[0005] 3. Synchronization problem: In high-speed motion video scenes, the watermark may jitter or be misaligned due to inter-frame calculation or rendering delays, affecting the viewing experience;
[0006] 4. Compatibility issues: Different devices and platforms have different levels of support for video encoding formats. Hard-coded implementations may not work properly on some devices, or the resulting video files may not play correctly in some players.
[0007] 5. Coding efficiency: Hard coding to add watermarks usually needs to be done at the encoding stage, which means that the video frame must be decoded, the watermark is added, and then re-encoded. This process is more complicated than soft coding and may reduce coding efficiency;
[0008] 6. Memory management: When processing HD or UHD videos, a large number of video frames need to be processed in memory, which requires effective memory management and optimization strategies, otherwise it may cause memory overflow;
[0009] 7. Watermark visibility and removability: The design of watermarks needs to balance visibility and difficulty in removal. A watermark that is too obvious may affect the viewing experience, while a watermark that is too subtle may be easily tampered with or removed;
[0010] 8. Cross-platform development challenges: Different operating systems and hardware architectures have different support for video processing, and hard-coded implementations often need to be optimized and adapted for different platforms.
[0011] How to dynamically maintain the function of video watermark at a lower cost is a technical problem that needs to be solved. Summary of the invention
[0012] The technical task of the present invention is to address the above shortcomings and provide a system and method for dynamically adding video watermarks without hard coding, so as to solve the technical problem of how to dynamically maintain the function of video watermarks at a lower cost.
[0013] In a first aspect, the present invention provides a system for dynamically adding video watermarks without hard coding, including a watermark management module, a watermark real-time rendering module, an archiving storage module, and a video watermark hard coding module;
[0014] The watermark management module interacts with the outside world through the watermark management interface, and is used to provide watermark template management service, watermark management service, data storage service, watermark rendering cycle management service and video binding service. The watermark template management service is used to create different types of watermark templates. The watermark management service is used to create watermarks based on watermark templates or in a customized way to form watermark information, and manage the created watermarks. The data storage service is used to store different types of watermarks. The watermark rendering cycle management service is used to set and manage the watermark rendering cycle. The video binding service is used to associate the added watermark with one or more specified videos.
[0015] The watermark real-time rendering module is used to render the watermark based on the watermark rendering cycle, the video being played, and the video playback status. If the currently played video is associated with a watermark and the video playback time meets the preset watermark rendering cycle, the preset watermark is rendered;
[0016] For scenes that need to be archived, the archive storage module is used to store the watermark and the video. The stored content includes the association between the watermark and the video and the archived watermark information. The archived watermark information is a copy of the watermark information.
[0017] The video watermark hard coding module is used to hard code the archived watermark into the video file to obtain the final video file.
[0018] Preferably, the watermark types include text watermark, picture watermark, dynamic watermark and intelligent watermark;
[0019] Text watermark supports inputting text content, automatically adjusting the size and position according to the layout of the video content, and supports text style settings, including font, color, shadow effect, rotation, and coordinates;
[0020] Image watermarks include brand logos, icons, and graphic elements. They can be overlaid on video content in the form of semi-transparent image watermarks. Image style settings are also supported. Image styles include fonts, colors, shadows, layers, transparency, rotation, and coordinates.
[0021] Dynamic watermarks support embedding playback timestamps and geographic locations, and support dynamic generation of personalized watermarks based on user data or real-time events. Personalized watermarks include user names and ratings, and support dynamic style settings. Dynamic styles include fonts, colors, shadows, layers, animations, transparency, rotation, and coordinates.
[0022] Smart watermark is used to select the embedding location based on the video content. It supports adjusting the style or content of the watermark according to the mood and scene of the video content, and supports setting smart styles. Smart styles include display position, display size, and watermark transparency.
[0023] Preferably, for unstructured watermarks including image watermarks, the watermarks are stored in the form of object storage;
[0024] For structured watermarks including text watermarks, the watermark information is stored through MySql or MongoDB, and the watermark information includes watermark material and watermark setting parameters.
[0025] Preferably, for the web-side scenario, the watermark real-time rendering module is used to perform watermark rendering as follows:
[0026] Before the video starts playing, determine whether there is a watermark associated with the video. If there is an associated watermark and the current time is within the specified watermark rendering period, render the watermark.
[0027] When the video starts playing, the preset watermark is rendered using canvas in front of the video. If it is a dynamic watermark, the watermark is refreshed on the canvas in real time at a preset frequency to achieve a dynamic effect of the watermark.
[0028] When the video is paused, the watermark is no longer rendered in real time, the last frame of the watermark image is displayed on the canvas, and the current watermark status is saved;
[0029] When the video is switched from the paused state to the play state and starts playing the video, the saved watermark data is read, the watermark state is restored, and the watermark is continued to be rendered;
[0030] When the video stops playing, the watermark rendering stops and the canvas data for rendering the watermark is cleared.
[0031] Preferably, for the archived watermark, the video watermark hard-coding module is used to dynamically load the archived video and watermark in a batch task manner, hard-code the watermark into the video file, and form a final video file.
[0032] In a second aspect, the present invention provides a method for adding a video watermark dynamically without hard coding, for adding a video watermark through a system for adding a video watermark dynamically without hard coding as described in any one of the first aspects, the method comprising the following steps:
[0033] Watermark management: including watermark template management operations, watermark management operations, data storage operations, watermark rendering cycle management operations and video binding operations. Different types of watermark templates are created through watermark template management operations. Watermarks are created based on watermark templates or in a customized way to form watermark information, and the created watermarks are managed. Different types of watermarks are stored through data storage operations. Watermark rendering cycles are set and managed through watermark rendering cycle management operations. Added watermarks are associated with one or more specified videos through video binding operations.
[0034] Real-time watermark rendering: Watermark rendering is performed based on the watermark rendering cycle, the video being played, and the video's playback status. If the currently playing video is associated with a watermark and the video's playback time meets the preset watermark rendering cycle, the preset watermark is rendered;
[0035] Archival storage: For scenes that need to be archived, watermarks and videos are stored. The stored content includes the association between the watermark and the video and the archived watermark information. The archived watermark information is a copy of the watermark information.
[0036] Video watermark hard coding: hard code the archived watermark into the video file to obtain the final video file.
[0037] Preferably, the watermark types include text watermark, picture watermark, dynamic watermark and intelligent watermark;
[0038] Text watermark supports inputting text content, automatically adjusting the size and position according to the layout of the video content, and supports text style settings, including font, color, shadow effect, rotation, and coordinates;
[0039] Image watermarks include brand logos, icons, and graphic elements. They can be overlaid on video content in the form of semi-transparent image watermarks. Image style settings are also supported. Image styles include fonts, colors, shadows, layers, transparency, rotation, and coordinates.
[0040] Dynamic watermarks support embedding playback timestamps and geographic locations, and support dynamic generation of personalized watermarks based on user data or real-time events. Personalized watermarks include user names and ratings, and support dynamic style settings. Dynamic styles include fonts, colors, shadows, layers, animations, transparency, rotation, and coordinates.
[0041] Smart watermark is used to select the embedding location based on the video content. It supports adjusting the style or content of the watermark according to the mood and scene of the video content, and supports setting smart styles. Smart styles include display position, display size, and watermark transparency.
[0042] Preferably, for unstructured watermarks including image watermarks, the watermarks are stored in the form of object storage;
[0043] For structured watermarks including text watermarks, the watermark information is stored through MySql or MongoDB, and the watermark information includes watermark material and watermark setting parameters.
[0044] Preferably, for the web-side scenario, the real-time watermark rendering includes the following steps:
[0045] Before the video starts playing, determine whether there is a watermark associated with the video. If there is an associated watermark and the current time is within the specified watermark rendering period, render the watermark.
[0046] When the video starts playing, the preset watermark is rendered using canvas in front of the video. If it is a dynamic watermark, the watermark is refreshed on the canvas in real time at a preset frequency to achieve a dynamic effect of the watermark.
[0047] When the video is paused, the watermark is no longer rendered in real time, the last frame of the watermark image is displayed on the canvas, and the current watermark status is saved;
[0048] When the video is switched from the paused state to the play state and starts playing the video, the saved watermark data is read, the watermark state is restored, and the watermark is continued to be rendered;
[0049] When the video stops playing, the watermark rendering stops and the canvas data for rendering the watermark is cleared.
[0050] Preferably, for the archived watermark, when the video watermark is hard-coded, a batch task is used to dynamically load the archived video and watermark, and the watermark is hard-coded into the video file to form a final video file.
[0051] The system and method for adding video watermark dynamically without hard coding of the present invention have the following advantages:
[0052] 1. Low threshold implementation: Dynamic watermarking and display functions can be realized without high video encoding technology, without intrusion into video source data, and without high cross-platform technical threshold;
[0053] 2. Low resource consumption and high performance: The watermark is displayed in a non-hard-coded way during video playback, which has the characteristics of low resource consumption, does not involve real-time encoding operations, and has high performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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.
[0055] The present invention is further described below in conjunction with the accompanying drawings.
[0056] Figure 1 This is a flowchart of a method for dynamically adding video watermarks without hard coding in Example 1. DETAILED DESCRIPTION
[0057] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0058] The embodiments of the present invention provide a system and method for dynamically adding video watermarks without hard coding, so as to solve the technical problem of how to dynamically maintain the function of video watermarks at a relatively low cost.
[0059] Embodiment 1:
[0060] The present invention discloses a system for adding video watermark dynamically without hard coding, comprising a watermark management module, a watermark real-time rendering module, an archiving storage module and a video watermark hard coding module.
[0061] The watermark management module interacts with the outside world through the watermark management interface, and is used to provide watermark template management services, watermark management services, data storage services, watermark rendering cycle management services and video binding services. The watermark template management service is used to create different types of watermark templates. The watermark management service is used to create watermarks based on watermark templates or in a customized way to form watermark information and manage the created watermarks. The data storage service is used to store different types of watermarks. The watermark rendering cycle management service is used to set and manage the watermark rendering cycle. The video binding service is used to associate the added watermark with one or more specified videos.
[0062] The implementation scheme of watermark management in this embodiment includes watermark template management, watermark management, data storage, watermark rendering cycle management and video binding.
[0063] Watermark template management: A watermark template is a preset template data resource of one or more watermarks. It is used to apply watermark templates of different styles when adding watermarks to quickly set the watermark style.
[0064] Watermark management: used for the management and maintenance of watermarks. You can use the above watermark template to create watermarks, or you can create watermarks according to actual needs. Watermarks include various types. Table 1 shows a set of watermark types and their related descriptions.
[0065] Table 1. Watermark types
[0066]
[0067]
[0068] Data storage: Watermarks of different types have different storage methods. Unstructured watermark materials represented by pictures need to be implemented using object storage and other methods; structured watermark materials represented by text and watermark setting parameters can be stored in databases that support structured data, such as MySql or MongoDB.
[0069] Watermark rendering cycle: The watermark rendering cycle is the task of periodically rendering the watermark during real-time video playback, supporting real-time rendering, intermittent rendering, etc.
[0070] Video binding: Associate the added watermark with one or more specified videos to achieve real-time rendering of the watermark when the specified video streaming media is played.
[0071] The watermark real-time rendering module is used to render watermarks based on the watermark rendering cycle, the video being played, and the video's playback status. If the currently playing video is associated with a watermark and the video's playback time meets the preset watermark rendering cycle, the preset watermark is rendered.
[0072] In this embodiment, the real-time watermark rendering is associated with the watermark rendering cycle, the video being played, and the playback state. If the currently played video streaming media is associated with a watermark, and the current playback time also happens to match the preset rendering cycle, the preset watermark is rendered. The following takes the web-side scenario as an example to illustrate the implementation of the watermark real-time rendering technology.
[0073] Watermark rendering and video playback are divided into two rendering paths. Video can be played using the Video tag provided by standard HTML technology, or it can be rendered on Canvas using front-end hard decoding. Watermark is rendered on Canvas by default. The basic process is as follows:
[0074] (1) Before the video starts playing, the associated watermark is obtained from the server. If there is an associated watermark and the current time is within the specified watermark rendering cycle, the watermark is prepared to be rendered;
[0075] (2) When the video starts playing, a preset watermark is rendered in front of the video using canvas. If it is a dynamic watermark, such as a watermark that supports animation, the watermark is refreshed on the canvas in real time at a preset frequency to achieve a dynamic effect of the watermark.
[0076] (3) When the video is paused, the watermark is no longer rendered in real time, the last frame of the watermark image is displayed on the canvas, and the current watermark status is saved;
[0077] (4) When the video is switched from the paused state to the play state and starts playing the video, the saved watermark data is read, the watermark state is restored, and the watermark is continued to be rendered;
[0078] (5) When the video stops playing, the watermark rendering stops and the canvas data for rendering the watermark is cleared.
[0079] For scenarios that require archiving, the archiving storage module is used to store watermarks and videos. The stored content includes the association between the watermark and the video and the archived watermark information. The archived watermark information is a copy of the watermark information.
[0080] In this embodiment, the watermark and the video are rendered separately. If the scene involves the need to archive the video in the field of security, the watermark and the video file need to be stored. The Mysql database can be used to store the association information of the two after archiving and the watermark information after archiving. The watermark information after archiving is a copy of the watermark information in the watermark management, and the copy is only used to associate with the archived video. The reason for using the watermark copy method is, on the one hand, to facilitate the needs of hard coding in the later stage, and the watermark data associated with the video can be loaded at any time. On the other hand, it prevents the watermark information in the watermark management from changing and affecting the archived data.
[0081] The video watermark hard coding module is used to hard code the archived watermark into the video file to obtain the final video file.
[0082] In this embodiment, if the archiving scenario requires that the watermark be hard-coded into the video file for copyright protection or identification of the video file, then after archiving, the video watermark hard-coding module is used to dynamically load the archived video and watermark in a batch task manner, re-hard-code them, and generate the final video file.
[0083] The system of this embodiment has watermark management function, multi-type watermark implementation function, watermark visibility and removability, and watermark post-hard coding function.
[0084] Watermark management function: Dynamic watermarking is achieved by separating watermarks from videos, which means that watermark content, position, transparency and other properties can be adjusted and managed independently of the video itself when the video is playing, without having to re-encode the entire video. This method improves flexibility and efficiency, especially when watermarks need to be frequently changed or adjusted. The following are some key aspects of the watermark management function:
[0085] 1. Watermark template management:
[0086] a. Create and Edit: Provide an interface or API that allows users to upload watermark images or design custom text watermarks, set the style (such as font, color, size), transparency, and layout.
[0087] b. Template classification and retrieval: Organize watermark templates and support classification by type, purpose or activity to facilitate quick search and application.
[0088] 2. Dynamic configuration:
[0089] a. Real-time adjustment: During video playback, the position, size, rotation angle and transparency of the watermark can be dynamically adjusted through the console or API without interrupting playback.
[0090] b. Trigger rules: Set conditions to trigger watermark changes, such as automatically switching watermarks based on playback time, video content analysis results, or user interaction.
[0091] 3. Permissions and security:
[0092] a. Access control: Assign different permissions to different users or roles, such as read-only, edit or manage watermark templates.
[0093] b. Watermark copyright protection: Ensure the secure storage and transmission of watermark data to prevent unauthorized access or modification.
[0094] 4. Adaptability and compatibility:
[0095] a. Multi-format support: Supports multiple image formats as watermark sources to ensure good display on videos with different resolutions and encoding formats.
[0096] b. Cross-platform application: Ensure that the watermark function can work stably on various devices and operating systems, including web pages, mobile applications, and smart TVs.
[0097] Multi-type watermarking function: Based on the dynamic addition solution of watermark and video separation, different types of watermarks have their own unique technical advantages, which are mainly reflected in ease of use, flexibility, security and impact on user experience. The following are the innovations brought by different watermarks:
[0098] 1. Text watermark
[0099] a. Ease of use: Text watermarks can be directly input into text content without the need for additional design or image processing, which is suitable for rapid deployment and frequent changes.
[0100] b. Adaptability: The text watermark can automatically adjust its size and position according to the layout of the video content, maintaining good readability and not blocking key information.
[0101] c. Personalized customization: Supports rich text style settings, such as fonts, colors, shadow effects, etc., making it easy to achieve brand recognition and information communication.
[0102] 2. Image watermark
[0103] a. Visual impact: Image watermarks can be brand logos, icons or other graphic elements, which have stronger visual recognition and help strengthen the brand image.
[0104] b. Design freedom: Image watermarks can be of any complex design and are not limited to fonts and colors, providing more space for creative expression.
[0105] c. Anti-counterfeiting and copyright protection: By using a semi-transparent image watermark to cover the video content, it can effectively prevent illegal copying and theft and enhance the copyright protection of the content.
[0106] d. Consistency maintenance: Enterprises or organizations can uniformly use preset image watermarks to ensure the consistency and professionalism of all video outputs.
[0107] 3. Dynamic watermark
[0108] a. Timestamp / location information: Dynamic watermarks can embed playback timestamps, geographic location and other information to increase the timeliness and authenticity verification of the video.
[0109] b. Improved interactivity: Combine user data or real-time events to dynamically generate personalized watermarks, such as user names, ratings, etc., to enhance audience participation and content interactivity.
[0110] c. Anti-tampering: Dynamically changing watermarks make it more difficult to illegally edit and tamper with videos, further strengthening content protection.
[0111] 4. Watermark with adjustable transparency
[0112] a. User experience optimization: By adjusting the transparency of the watermark, you can minimize the impact on the viewing experience while protecting the content and find the best visual balance.
[0113] b. Adapt to different scenes: In video clips with different brightness or colors, flexible adjustment of transparency can ensure that the watermark is visible but not obtrusive.
[0114] 5. Smart Watermark
[0115] a. Automatic positioning: Using image recognition and machine learning technology, the smart watermark can automatically select the best position based on the video content to avoid blocking important information.
[0116] b. Situational adaptation: Intelligently adjust the style or content of the watermark according to the emotions and scene changes of the video content to improve the accuracy and effectiveness of information transmission.
[0117] Visibility and removability of watermarks: The watermark and video are separated. When playing videos in real time, watermarks can be added dynamically as needed to achieve watermark visibility, ensuring that the video playback will not be recorded by third-party recording devices (such as mobile phones). When the currently playing video is recorded, there is no watermark, which will cause security content leakage and video copyright cannot be effectively protected. Because the watermark is not hard-coded directly with the video, the video watermark can be switched and hidden in real time according to actual business needs and actual scenarios, and there will be no delay in watermark changes due to hardware resources and other reasons.
[0118] Watermark post-processing hard coding: For scenarios where watermarks and videos must be hard-coded or security video materials that need to be archived and stored for a long time, this can be achieved in the later stage. Compared with real-time watermarking, it has a series of unique technical advantages, especially in terms of efficiency, quality control, flexibility and security. For example, in the later batch processing, hard coding allows the same or customized watermarks to be added to multiple video files at one time. The hard coding of watermarks and videos can be performed during off-peak hours or offline to avoid occupying valuable online resources and affecting user experience.
[0119] Embodiment 2:
[0120] The present invention discloses a method for dynamically adding video watermarks without hard coding, which comprises four steps: watermark management, real-time watermark rendering, archiving storage and video watermark hard coding.
[0121] Step S100 watermark management: including watermark template management operation, watermark management operation, data storage operation, watermark rendering cycle management operation and video binding operation. Different types of watermark templates are created through watermark template management operation, watermarks are created based on watermark templates or in a customized way to form watermark information, and the created watermarks are managed. Different types of watermarks are stored through data storage operation, watermark rendering cycle is set and managed through watermark rendering cycle management operation, and added watermarks are associated with one or more specified videos through video binding operation.
[0122] The implementation scheme of watermark management in this embodiment includes watermark template management, watermark management, data storage, watermark rendering cycle management and video binding.
[0123] Watermark template management: A watermark template is a preset template data resource of one or more watermarks. It is used to apply watermark templates of different styles when adding watermarks to quickly set the watermark style.
[0124] Watermark management: used for the management and maintenance of watermarks. You can use the above watermark template to create watermarks, or you can create watermarks according to actual needs. Watermarks include various types. Table 1 shows a set of watermark types and their related descriptions.
[0125] Among them, watermark types include text watermark, image watermark, dynamic watermark and intelligent watermark.
[0126] Text watermark supports inputting text content, automatically adjusting the size and position according to the layout of the video content, and supports text style settings, including font, color, shadow effect, rotation, and coordinates;
[0127] Image watermarks include brand logos, icons, and graphic elements. They can be overlaid on video content in the form of semi-transparent image watermarks. Image style settings are also supported. Image styles include fonts, colors, shadows, layers, transparency, rotation, and coordinates.
[0128] Dynamic watermarks support embedding playback timestamps and geographic locations, and support dynamic generation of personalized watermarks based on user data or real-time events. Personalized watermarks include user names and ratings, and support dynamic style settings. Dynamic styles include fonts, colors, shadows, layers, animations, transparency, rotation, and coordinates.
[0129] Smart watermark is used to select the embedding location based on the video content. It supports adjusting the style or content of the watermark according to the mood and scene of the video content, and supports setting smart styles. Smart styles include display position, display size, and watermark transparency.
[0130] Data storage: Watermarks of different types have different storage methods. Unstructured watermark materials represented by pictures need to be implemented using object storage and other methods; structured watermark materials represented by text and watermark setting parameters can be stored in databases that support structured data, such as MySql or MongoDB.
[0131] Watermark rendering cycle: The watermark rendering cycle is the task of periodically rendering the watermark during real-time video playback, supporting real-time rendering, intermittent rendering, etc.
[0132] Video binding: Associate the added watermark with one or more specified videos to achieve real-time rendering of the watermark when the specified video streaming media is played.
[0133] Step S200: Real-time watermark rendering: watermark rendering is performed based on the watermark rendering cycle, the video being played, and the playback status of the video. If the currently played video is associated with a watermark and the playback time of the video meets the preset watermark rendering cycle, the preset watermark is rendered.
[0134] In this embodiment, the real-time watermark rendering is associated with the watermark rendering cycle, the video being played, and the playback state. If the currently played video streaming media is associated with a watermark, and the current playback time also happens to match the preset rendering cycle, the preset watermark is rendered. The following takes the web-side scenario as an example to illustrate the implementation of the watermark real-time rendering technology.
[0135] Watermark rendering and video playback are divided into two rendering paths. Video can be played using the Video tag provided by standard HTML technology, or it can be rendered on Canvas using front-end hard decoding. Watermark is rendered on Canvas by default. The basic process is as follows:
[0136] (1) Before the video starts playing, the associated watermark is obtained from the server. If there is an associated watermark and the current time is within the specified watermark rendering cycle, the watermark is prepared to be rendered;
[0137] (2) When the video starts playing, a preset watermark is rendered in front of the video using canvas. If it is a dynamic watermark, such as a watermark that supports animation, the watermark is refreshed on the canvas in real time at a preset frequency to achieve a dynamic effect of the watermark.
[0138] (3) When the video is paused, the watermark is no longer rendered in real time, the last frame of the watermark image is displayed on the canvas, and the current watermark status is saved;
[0139] (4) When the video is switched from the paused state to the play state and starts playing the video, the saved watermark data is read, the watermark state is restored, and the watermark is continued to be rendered;
[0140] (5) When the video stops playing, the watermark rendering stops and the canvas data for rendering the watermark is cleared.
[0141] Step S300: Archiving and storing: For scenes that need to be archived, the watermark and the video are stored. The stored content includes the association between the watermark and the video and the archived watermark information. The archived watermark information is a copy of the watermark information.
[0142] In this embodiment, the watermark and the video are rendered separately. If the scene involves the need to archive the video in the field of security, the watermark and the video file need to be stored. The Mysql database can be used to store the association information of the two after archiving and the watermark information after archiving. The watermark information after archiving is a copy of the watermark information in the watermark management, and the copy is only used to associate with the archived video. The reason for using the watermark copy method is, on the one hand, to facilitate the needs of hard coding in the later stage, and the watermark data associated with the video can be loaded at any time. On the other hand, it prevents the watermark information in the watermark management from changing and affecting the archived data.
[0143] Step S400: Video watermark hard coding: hard coding the archived watermark into the video file to obtain the final video file.
[0144] In this embodiment, if the archiving scenario requires that the watermark be hard-coded into the video file for copyright protection or identification of the video file, then after archiving, the video watermark hard-coding module is used to dynamically load the archived video and watermark in a batch task manner, re-hard-code them, and generate the final video file.
[0145] The method of this embodiment can dynamically add video watermarks based on the system disclosed in Embodiment 1.
[0146] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the means in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A system for adding video watermarks dynamically without hard coding, characterized in that: It includes watermark management module, watermark real-time rendering module, archiving storage module and video watermark hard coding module; The watermark management module interacts with the outside world through the watermark management interface, and is used to provide watermark template management service, watermark management service, data storage service, watermark rendering cycle management service and video binding service. The watermark template management service is used to create different types of watermark templates. The watermark management service is used to create watermarks based on watermark templates or in a customized way to form watermark information, and manage the created watermarks. The data storage service is used to store different types of watermarks. The watermark rendering cycle management service is used to set and manage the watermark rendering cycle. The video binding service is used to associate the added watermark with one or more specified videos. The watermark real-time rendering module is used to render the watermark based on the watermark rendering cycle, the video being played, and the video playback status. If the currently played video is associated with a watermark and the video playback time meets the preset watermark rendering cycle, the preset watermark is rendered; For scenes that need to be archived, the archive storage module is used to store the watermark and the video. The stored content includes the association between the watermark and the video and the archived watermark information. The archived watermark information is a copy of the watermark information. The video watermark hard coding module is used to hard code the archived watermark into the video file to obtain the final video file.
2. The system for adding video watermarks dynamically without hard coding according to claim 1, characterized in that: Watermark types include text watermark, image watermark, dynamic watermark and smart watermark; Text watermark supports inputting text content, automatically adjusting the size and position according to the layout of the video content, and supports text style settings, including font, color, shadow effect, rotation, and coordinates; Image watermarks include brand logos, icons, and graphic elements. They can be overlaid on video content in the form of semi-transparent image watermarks. Image style settings are also supported. Image styles include fonts, colors, shadows, layers, transparency, rotation, and coordinates. Dynamic watermarks support embedding playback timestamps and geographic locations, and support dynamic generation of personalized watermarks based on user data or real-time events. Personalized watermarks include user names and ratings, and support dynamic style settings. Dynamic styles include fonts, colors, shadows, layers, animations, transparency, rotation, and coordinates. Smart watermark is used to select the embedding location based on the video content. It supports adjusting the style or content of the watermark according to the mood and scene of the video content, and supports setting smart styles. Smart styles include display position, display size, and watermark transparency.
3. The system for adding video watermarks dynamically without hard coding according to claim 1, characterized in that: For unstructured watermarks including image watermarks, the watermarks are stored in the form of object storage; For structured watermarks including text watermarks, the watermark information is stored through MySql or MongoDB, and the watermark information includes watermark material and watermark setting parameters.
4. The system for adding video watermarks dynamically without hard coding according to claim 1, characterized in that: For the web scenario, the watermark real-time rendering module is used to perform watermark rendering as follows: Before the video starts playing, determine whether there is a watermark associated with the video. If there is an associated watermark and the current time is within the specified watermark rendering period, render the watermark. When the video starts playing, the preset watermark is rendered using canvas in front of the video. If it is a dynamic watermark, the watermark is refreshed on the canvas in real time at a preset frequency to achieve a dynamic effect of the watermark. When the video is paused, the watermark is no longer rendered in real time, the last frame of the watermark image is displayed on the canvas, and the current watermark status is saved; When the video is switched from the paused state to the play state and starts playing the video, the saved watermark data is read, the watermark state is restored, and the watermark is continued to be rendered; When the video stops playing, the watermark rendering stops and the canvas data for rendering the watermark is cleared.
5. The system for adding video watermarks dynamically without hard coding according to claim 1, characterized in that: For the archived watermarks, the video watermark hard-coding module is used to dynamically load the archived videos and watermarks in a batch task manner, and hard-code the watermarks into the video files to form the final video files.
6. A method for adding video watermark dynamically without hard coding, characterized in that: The method for adding a video watermark by a system for adding a video watermark dynamically without hard coding as claimed in any one of claims 1 to 5 comprises the following steps: Watermark management: including watermark template management operations, watermark management operations, data storage operations, watermark rendering cycle management operations and video binding operations. Different types of watermark templates are created through watermark template management operations. Watermarks are created based on watermark templates or in a customized way to form watermark information, and the created watermarks are managed. Different types of watermarks are stored through data storage operations. Watermark rendering cycles are set and managed through watermark rendering cycle management operations. Added watermarks are associated with one or more specified videos through video binding operations. Real-time watermark rendering: Watermark rendering is performed based on the watermark rendering cycle, the video being played, and the video's playback status. If the currently playing video is associated with a watermark and the video's playback time meets the preset watermark rendering cycle, the preset watermark is rendered; Archival storage: For scenes that need to be archived, watermarks and videos are stored. The stored content includes the association between the watermark and the video and the archived watermark information. The archived watermark information is a copy of the watermark information. Video watermark hard coding: hard code the archived watermark into the video file to obtain the final video file.
7. The method for adding video watermark dynamically without hard coding according to claim 6, characterized in that: Watermark types include text watermark, image watermark, dynamic watermark and smart watermark; Text watermark supports inputting text content, automatically adjusting the size and position according to the layout of the video content, and supports text style settings, including font, color, shadow effect, rotation, and coordinates; Image watermarks include brand logos, icons, and graphic elements. They can be overlaid on video content in the form of semi-transparent image watermarks. Image style settings are also supported. Image styles include fonts, colors, shadows, layers, transparency, rotation, and coordinates. Dynamic watermarks support embedding playback timestamps and geographic locations, and support dynamic generation of personalized watermarks based on user data or real-time events. Personalized watermarks include user names and ratings, and support dynamic style settings. Dynamic styles include fonts, colors, shadows, layers, animations, transparency, rotation, and coordinates. Smart watermark is used to select the embedding location based on the video content. It supports adjusting the style or content of the watermark according to the mood and scene of the video content, and supports setting smart styles. Smart styles include display position, display size, and watermark transparency.
8. The method for adding video watermark dynamically without hard coding according to claim 6, characterized in that: For unstructured watermarks including image watermarks, the watermarks are stored in the form of object storage; For structured watermarks including text watermarks, the watermark information is stored through MySql or MongoDB, and the watermark information includes watermark material and watermark setting parameters.
9. The method for adding video watermark dynamically without hard coding according to claim 6, characterized in that: For web scenarios, real-time watermark rendering includes the following steps: Before the video starts playing, determine whether there is a watermark associated with the video. If there is an associated watermark and the current time is within the specified watermark rendering period, render the watermark. When the video starts playing, the preset watermark is rendered using canvas in front of the video. If it is a dynamic watermark, the watermark is refreshed on the canvas in real time at a preset frequency to achieve a dynamic effect of the watermark. When the video is paused, the watermark is no longer rendered in real time, the last frame of the watermark image is displayed on the canvas, and the current watermark status is saved; When the video is switched from the paused state to the play state and starts playing the video, the saved watermark data is read, the watermark state is restored, and the watermark is continued to be rendered; When the video stops playing, the watermark rendering stops and the canvas data for rendering the watermark is cleared.
10. The method for adding video watermark dynamically without hard coding according to claim 6, characterized in that: For the archived watermark, when the video watermark is hard-coded, a batch task is used to dynamically load the archived video and watermark, and the watermark is hard-coded into the video file to form the final video file.
Citation Information
Patent Citations
Video watermark adding and extracting method and device, video playing end and storage medium
CN110896484A
Method for adding watermarks into video
CN112333557A
Video file watermark processing method
CN112333558A
Video watermark adding method, system and device based on Web front end and medium
CN118590724A