Multi-channel watermark editable method and device based on one-channel video acquisition

By creating a shared cache and multiple GPU environment contexts on the terminal device, differentiated watermark customization for multiple platforms/TV stations is achieved, solving the problem of inconvenient watermark editing in existing technologies and improving the smoothness of live broadcasts and editing efficiency.

CN121815034APending Publication Date: 2026-04-07BEIJING TRICOLOR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, when multiple platforms or TV stations share the same live camera feed, each platform/TV station needs to pull the stream to its own server to add a watermark, which makes watermark editing inconvenient and makes it impossible to achieve watermark differentiation and customization.

Method used

The terminal device creates a first GPU environment context and builds a shared cache. The acquisition device stores the video stream into the shared cache, creates multiple second GPU environment contexts to read and add watermarks respectively, realizes differentiated customization of watermarks, and pushes the stream to the display end after encoding.

Benefits of technology

It enables customized watermark styles, reduces deployment and maintenance costs, avoids bandwidth waste, and ensures smooth live streaming and efficient editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121815034A_ABST
    Figure CN121815034A_ABST
Patent Text Reader

Abstract

The invention provides a multi-channel watermark editable method and device based on one-channel video collection, and the method comprises the steps: creating a first GPU environment context and a shared cache through terminal equipment, and collecting one-channel original video stream collected by the same camera to the shared cache; and creating a plurality of second GPU environment contexts, respectively binding each use main body, configuring exclusive watermark information by each main body through the corresponding environment context, adding the exclusive watermark information to a video stream frame image, and finally coding and pushing the stream to a corresponding display end. The method can solve the problems that in the prior art, each main body needs to independently pull streams and add watermarks, editing is inconvenient, and differential customization cannot be achieved, the deployment cost is reduced, and the method is suitable for the scene that multiple television stations / multiple platforms share the same camera for live broadcast / monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video processing, in particular to a multi-path watermark editable method and device based on one-path video collection. BACKGROUND

[0002] In the scenario of multiple platforms or multiple TV stations pulling the same camera live picture and adding their own platform / TV station watermark text information, the existing technical solution is that each platform and TV station pulls the camera picture to its own streaming server, and after completing watermark addition in the respective server, pushes the video to the corresponding playing device for playing. The existing method has obvious disadvantages: the watermark editing is not convenient and fast, and the difference of the watermark style of each platform / TV station cannot be realized, which is difficult to meet the customized needs of different platforms / TV stations for exclusive watermarks.

[0003] To solve the defects of the existing technology, a technical solution is needed to meet the needs of adding exclusive watermarks (including watermark text, platform / TV station information) of each platform / TV station as needed when a single-path camera collected picture is monitored by multiple platforms or broadcasted by multiple TV stations, so as to realize the difference and customization of the watermark. SUMMARY

[0004] Therefore, the embodiments of the present application provide a multi-path watermark editable method and device based on one-path video collection, which can solve the technical problems in the prior art that when multiple platforms / TV stations share the same camera live picture, each subject needs to pull the stream to its own server for watermarking, resulting in inconvenient watermark editing and inability to realize the difference and customization of the watermark.

[0005] The technical solution of the embodiments of the present application is as follows: In a first aspect, the embodiments of the present application provide a multi-path watermark editable method based on one-path video collection, comprising the following steps: creating a first GPU environment context through a terminal device, and creating a shared cache in the first GPU environment context; collecting an original video stream to the shared cache through a collection device; creating a plurality of second GPU environment contexts, wherein any second GPU environment context in the plurality of second GPU environment contexts can read the shared cache; in response to a watermark adding request, reading the original video stream frame image in the shared cache through the plurality of second GPU environment contexts respectively, and adding corresponding watermarks to the video frame image based on watermark configuration information; in response to a streaming request, pushing the video stream after adding the watermark and encoding to the corresponding display end through the corresponding second GPU environment context after encoding.

[0006] In a second aspect, the embodiments of the present application further provide a multi-path watermark editable device based on one-path video collection, the device comprising: a first creating module configured to create a first GPU environment context through a terminal device, and create a shared cache in the first GPU environment context; a collecting module configured to collect one-path original video stream into the shared cache through a collecting device; a second creating module configured to create a plurality of second GPU environment contexts, wherein any second GPU environment context in the plurality of second GPU environment contexts is capable of reading the shared cache; an adding module configured to read original video stream frame images in the shared cache through the plurality of second GPU environment contexts respectively in response to a watermark adding request, and add corresponding watermarks to the video frame images based on watermark configuration information; a pushing module configured to push the video stream added with the watermarks and encoded to a corresponding display end through the corresponding second GPU environment context after encoding in response to a pushing request.

[0007] In a third aspect, the embodiments of the present application further provide an electronic device comprising a processor, a storage medium and a bus, the storage medium storing machine readable instructions executable by the processor, the processor and the storage medium communicating through the bus when the electronic device is running, and the processor executing the machine readable instructions to execute the multi-path watermark editable method based on one-path video collection according to any one of the first aspect.

[0008] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by a processor to execute the multi-path watermark editable method based on one-path video collection according to any one of the first aspect.

[0009] The embodiments of the present application have the following beneficial effects: By collecting original video stream through a terminal device and constructing a shared cache and a plurality of independent second GPU environment contexts, each platform / television station does not need to separately deploy a stream server, and can directly and conveniently configure exclusive watermark information through a corresponding environment context, thereby realizing differentiated customization of watermark styles, greatly reducing the deployment and operation and maintenance costs of each subject, avoiding bandwidth waste caused by repeated stream pulling of multiple subjects, and ensuring the smoothness of live pictures. BRIEF DESCRIPTION OF DRAWINGS

[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart illustrating steps S101-S105 provided in the embodiments of this application; Figure 2 This is a flowchart illustrating steps S201-S202 provided in the embodiments of this application; Figure 3 This is a flowchart illustrating steps S301-S302 provided in the embodiments of this application; Figure 4 This is a flowchart illustrating steps S401-S402 provided in the embodiments of this application; Figure 5 This is a flowchart illustrating steps S501-S502 provided in the embodiments of this application; Figure 6 This is a diagram of the architecture for one-channel video capture, multi-channel watermarking, and targeted streaming provided in this application embodiment; Figure 7 This is a flowchart illustrating the implementation steps of the editable method for capturing one video stream and watermarking multiple streams, as provided in this application embodiment. Figure 8 This is a schematic diagram of the structure of the multi-channel watermark editable device based on one-channel video acquisition provided in the embodiments of this application; Figure 9 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0013] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0014] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0015] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0016] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application and is not intended to limit this application.

[0018] See Figure 1 , Figure 1 This is a flowchart illustrating steps S101-S105 of the multi-channel watermark editable method based on one-channel video capture provided in this application embodiment. Figure 1 Steps S101-S105 are explained below.

[0019] In step S101, a first GPU environment context is created through the terminal device, and a shared cache is created in the first GPU environment context; In step S102, a raw video stream is acquired by the acquisition device and stored in the shared buffer; In step S103, multiple second GPU environment contexts are created, wherein any one of the multiple second GPU environment contexts can read the shared cache; In step S104, in response to the watermark addition request, the original video stream frame images in the shared cache are read through the multiple second GPU environment contexts respectively, and the corresponding watermarks are added to the video frame images based on the watermark configuration information; In step S105, in response to the streaming request, the watermarked and encoded video stream is encoded and then streamed to the corresponding display end through the corresponding second GPU environment context.

[0020] The first GPU environment context is essentially a software abstraction layer of GPU hardware resources. After the terminal device creates this context using the driver toolkit provided by the GPU manufacturer (such as NVIDIA's CUDA Toolkit), it can allocate resources such as computing cores and video memory through API functions (such as cudaSetDevice and cudaMalloc), achieving centralized resource scheduling and avoiding resource fragmentation caused by each platform independently creating GPU environments, ensuring that limited GPU resources are used efficiently. The shared cache adopts a "unified memory" architecture (implemented through cudaMallocManaged). Its core value is to achieve high-speed data sharing between the CPU and GPU, and multiple GPU environments. After the raw video stream is stored in it, each secondary GPU environment can directly read it without copying the data, completely solving the bandwidth waste and latency problems caused by "repeated streaming and multiple data copies on multiple platforms" in traditional solutions. At the same time, the multi-level partition design of the shared cache (raw video area, preprocessing area, temporary cache area) realizes the classified storage and isolated access of data, avoiding mutual interference between different types of data (such as raw stream, intermediate processing data, and preview files), and improving data read and write efficiency.

[0021] Acquisition devices (such as high-definition cameras) transmit the raw video stream to terminal devices via standardized protocols (such as RTSP) and store it directly in a shared cache. This eliminates the need for separate servers on each platform, simplifying the data transmission link and ensuring that the quality of the raw video streams acquired by all users is consistent, thus avoiding image quality loss due to multiple transmissions.

[0022] Multiple second GPU environment contexts share hardware resources with the first GPU environment context, but operate independently. Each environment can be bound to a single user entity (such as a TV station or a live streaming platform). Each second GPU environment can independently read the raw video stream from the shared cache without interfering with each other, providing independent processing space for different entities to customize watermarks.

[0023] Each secondary GPU environment responds to the watermarking request of its corresponding subject, processes the video stream based on its unique configuration information, and then transmits it to the corresponding display end through encoding (such as H.264) and streaming (such as RTMP protocol). This forms a closed loop of "centralized acquisition - independent processing - distributed delivery", which not only ensures the differentiation of watermarks for each subject, but also significantly reduces the deployment and maintenance costs of each subject.

[0024] In some embodiments, see Figure 2 , Figure 2 This is a flowchart illustrating steps S201-S202 provided in the embodiments of this application. The watermark is added through steps S201-S202, and will be explained in conjunction with each step.

[0025] In step S201, the watermark logo is solidified into a basic template, and editing permissions for size scaling, image position, transparency, and temporary additional elements are granted; wherein, the size scaling is preset with multiple adaptation ratios according to the display resolution to avoid logo distortion; temporary additional elements include holiday corner marks and event logos, and the style and position of the additional elements are constrained by preset rules; In step S202, the terminal device generates a preview image of the editing effect in real time, and embeds the video stream after confirming that the preview image of the editing effect is correct.

[0026] The basic template is fixed for the core identification elements of the station logo, such as the graphic logo and standard color scheme. As the core identifier of the brand, the consistency of its core elements directly affects the audience's recognition. The fixed process can avoid problems such as logo deformation and color deviation caused by editing operations.

[0027] Editable parameter adaptation focuses on scene adaptation needs, granting editing permissions for size scaling, image position, transparency, and temporary added elements. Each parameter's access is accompanied by strict technical constraints to balance flexibility and consistency. Specifically, the preset adaptation ratio based on display resolution addresses the issue of logo distortion caused by differences in resolution across different devices (TVs, mobile phones, web pages). This is achieved through a preset "resolution-scaling ratio" mapping table combined with bilinear interpolation algorithms to achieve lossless scaling, avoiding stretching or compression caused by manual adjustments. For example, a 1920×1080 resolution TV terminal is adapted to an 80×80 pixel logo. This ratio is determined based on human visual comfort tests (the logo occupies 4.17% of the screen width for highest recognition without obstructing the image). The editing permissions for temporary additional elements (holiday corner marks, event logos) are opened, and the standard is achieved through "hardware-level constraints + software-level verification": the hardware level limits the storage size of additional elements through GPU memory partitioning, and the software level ensures that additional elements do not obscure the core area of ​​the logo through color difference algorithms and position offset detection. For example, the size of the holiday corner mark does not exceed 1 / 3 of the core area of ​​the logo. This threshold is determined based on brand recognition test (when the core area is obscured by more than 1 / 3, the audience recognition accuracy drops by more than 50%).

[0028] Before embedding the watermark, the terminal device generates a preview image of the editing effect in real time. Editors can intuitively check whether the size, position, and additional elements of the logo meet expectations. Only after confirming that everything is correct can the watermark be officially embedded into the video stream, avoiding live broadcast accidents caused by editing errors and greatly improving editing efficiency.

[0029] In some embodiments, see Figure 3 , Figure 3 This is a flowchart illustrating steps S301-S302 provided in the embodiments of this application. Before adding the corresponding watermark based on the watermark configuration information, the method further includes steps S301-S302, which will be explained in conjunction with each step.

[0030] In step S301, the scene type of the original video stream is identified by a video scene classification model. The scene types include static scenes, dynamic scenes, and scenes with alternating light and dark. In step S302, a differentiated watermark rendering strategy is configured for different scene types. For static scenes, a semi-transparent watermark is used, while for dynamic scenes, the watermark edge sharpening is enhanced to resist blurring. For scenes with alternating light and dark, the watermark brightness is automatically synchronized with the screen brightness.

[0031] This application's implementation first identifies the scene and then adapts the strategy. The first step, "scene recognition," uses a CNN model with a ResNet-18 architecture, covering common scenes on TV / live streaming platforms (news, sports, outdoor, studio, etc.). To ensure real-time performance, the model is optimized using model quantization (INT8 quantization) and pruning (30% pruning rate), achieving an inference speed of 300fps and a single-frame recognition time of <3ms, meeting the real-time processing requirements of 60fps video streams. Simultaneously, a frame difference method is introduced to assist in judgment. By calculating the pixel difference value (frame difference) between adjacent frames, static and dynamic scenes are quickly distinguished. When the frame difference is <15, it is judged as static; when the frame difference is >50, it is judged as dynamic, effectively improving the recognition efficiency of dynamic scenes. The recognition accuracy in the test set (including 10,000 samples not used in training) reaches 98.2%, with a recognition accuracy of 97.5% for scenes with alternating light and dark areas, providing a precise basis for subsequent rendering strategy adaptation.

[0032] The second step involves using a semi-transparent watermark design for static scenes (such as news broadcast backgrounds). This is because static scenes offer stability, and the semi-transparent effect reduces the watermark's obstruction of the main subject, improving the viewing experience. For dynamic scenes (such as sports events), the watermark edge sharpening process is enhanced. The core of this process is to address the issue of watermarks becoming blurry in dynamic scenes. In dynamic scenes, the frame rate changes rapidly, and ordinary watermarks tend to blend into the background. Sharpening improves the contrast of the watermark edges, ensuring clear recognition for the audience. For scenes with alternating light and dark (such as outdoor sunrises and sunsets), the watermark brightness is automatically synchronized with the image brightness. This is to avoid the watermark being covered when the image is too bright or too abrupt when the image is too dark. The watermark is naturally integrated with the image through adaptive brightness.

[0033] In some embodiments, see Figure 4 , Figure 4 This is a flowchart illustrating steps S401-S402 provided in the embodiments of this application. After the original video stream is acquired to the shared buffer, the method further includes steps S401-S402, which will be explained in conjunction with each step.

[0034] In step S401, the original video stream is marked with frame-level timestamps, the video stream is divided into multiple sub-stream segments according to preset time slices and stored in a multi-level partition of the shared buffer, and a sub-stream index table is established at the same time. In step S402, when each second GPU environment context reads the video stream, it pre-reads the sub-stream segments of the next N time slices based on the index table to reduce reading latency; when the shared cache storage space is insufficient, the sub-stream segments that have completed watermarking are automatically deleted.

[0035] Here, a millisecond-level timestamp is added to each frame of the original video stream, and the stream is sliced ​​into sub-stream segments according to a preset time (e.g., 10 seconds). These segments are then stored in a multi-level partition of the shared cache (e.g., the original storage area and the preprocessing area). The sub-stream index table (containing the slice time range and storage address) allows each secondary GPU environment to quickly locate the required data without traversing the entire cache. The multi-level partitioning can isolate the original data from the temporary data, avoiding storage chaos.

[0036] When each secondary GPU environment reads the video stream, it pre-reads the sub-stream segments of the next N time slices based on the index table. By taking advantage of the temporal continuity of the video stream, it preloads subsequent data to avoid stuttering caused by real-time reading. This is especially suitable for processing high frame rate videos (such as 60fps) and ensures the real-time addition of watermarks.

[0037] Terminal devices monitor the storage space utilization of the shared cache in real time. When it exceeds a preset threshold (such as 80%), they automatically delete sub-stream segments that have been watermarked and successfully pushed, while maximizing the utilization of cache space.

[0038] It should be noted that the video stream slice storage, indexing, and pre-reading optimization schemes provided in this embodiment are optional implementations and not essential processes for implementing video stream watermarking. Even if the user terminal does not enable this scheme, the original video stream can still directly enter the watermarking process after being captured to the shared cache. The core business logic of video stream acquisition, watermark addition, and result push is unaffected and can meet the basic functional requirements.

[0039] In actual deployment, the performance requirements and resource constraints of the business scenario can be combined to flexibly choose whether to enable this solution: For low frame rate (such as 30fps and below) and small-volume video stream processing scenarios, the performance overhead of index building (such as memory usage and CPU computing overhead) may offset the latency optimization benefits brought by pre-reading. In this case, this optional solution can be turned off to simplify the process and reduce system complexity; while for high frame rate and large traffic video stream processing scenarios of 60fps and above, the real-time improvement benefits brought by pre-reading and intelligent cache cleaning far outweigh the performance overhead of indexing. In this case, this solution can be enabled to ensure the smoothness of watermark processing.

[0040] In some embodiments, see Figure 5 , Figure 5 This is a flowchart illustrating steps S501-S502 provided in the embodiments of this application. After creating multiple second GPU environment contexts, it also includes collaborative control and fault tolerance processing steps S501-S502, which will be explained in conjunction with each step.

[0041] In step S501, a unique identifier is assigned to each second GPU environment context, and a distributed lock mechanism is used to control the concurrent read permissions of each environment to the shared cache in order to avoid data conflicts. In step S502, a timed synchronization verification mechanism is set up. Each second GPU environment context periodically reports the watermark processing progress. If the processing delay of a certain environment exceeds a preset threshold, the terminal device automatically starts a backup processing thread to take over its task. After the original environment is restored, the processing progress is connected through an incremental synchronization mechanism to ensure the continuity of multi-channel watermark processing.

[0042] The distributed lock mechanism uses Redis, leveraging Redis's single-threaded nature to ensure the atomicity of the lock. Before each secondary GPU environment reads the shared cache, it needs to call the Redis SETNX command ("SET if Not Exists") to acquire the lock. If the command executes successfully, the lock is acquired; otherwise, it must wait until the lock is released. To avoid deadlocks caused by lock-holding environment failures, a 500ms timeout can be set for the lock (specified via the EX parameter). Even if the environment fails, the lock will be automatically released after the timeout. At the same time, each environment calls the EXPIRE command every 200ms to refresh the lock timeout during the lock-holding period, ensuring that the lock is not released prematurely during normal processing.

[0043] A timed synchronization verification mechanism (e.g., 1 second / cycle) requires each secondary GPU environment to periodically report its processing progress, and the terminal device monitors the operating status of each environment in real time. When a processing delay in a certain environment exceeds a preset threshold (e.g., 500 milliseconds) or a failure is detected, a backup processing thread can be immediately started to take over its task. The backup thread incrementally processes subsequent video streams based on the reported progress data, without needing to reprocess all data. After the original environment recovers, the progress is connected through the incremental synchronization mechanism to ensure that the watermark processing of this video stream is uninterrupted and imperceptible to the viewer.

[0044] In some embodiments, the encoding process employs inter-frame differential encoding, which encodes only frames that differ from the original video stream after the watermark is added; during streaming, the streaming bitrate is dynamically adjusted based on the network bandwidth of each display terminal, and when the bandwidth is below a threshold, priority is given to ensuring the clarity of the watermark and the smoothness of the core video content.

[0045] This application addresses the problem of high resource consumption in traditional full-frame encoding by encoding only the differences. The video stream with added watermark differs from the original video stream only in the watermark area. Therefore, the system only encodes these difference frames instead of the full frames, which can significantly reduce GPU computation and data volume, improve encoding efficiency, and is especially suitable for processing high-resolution, high-frame-rate videos.

[0046] Terminal devices acquire bandwidth data of each display terminal in real time through network monitoring modules. When a display terminal's bandwidth is detected to be lower than a preset threshold (such as 2Mbps), the streaming bitrate can be automatically reduced. At the same time, priority is given to ensuring the clarity of the watermark and the smoothness of the core video content. As a brand identifier, the clarity of the watermark directly affects the dissemination effect, while the smoothness of the core video content (such as people and the main subject of the image) is the foundation of the viewing experience. Therefore, when bandwidth is limited, these two parts are prioritized, rather than sacrificing the core experience to maintain a high bitrate.

[0047] In some embodiments, a real-time watermark update step is also included: In response to a watermark editing request, the corresponding watermark configuration information is updated. The watermark area in the video stream is incrementally processed only through the corresponding second GPU environment context. After processing, the watermark is immediately pushed to the corresponding display end to achieve seamless watermark updates without re-encoding the entire video stream.

[0048] Here, when the terminal device responds to a watermark editing request from the display (such as modifying the watermark text or adding additional elements), it does not reprocess the entire video stream, but only performs incremental processing on the "watermark area" within the video stream. Specifically, the system records the original watermark's position and size, and after editing, only the pixels in that area are re-rendered to generate incremental data, which is then spliced ​​with the original video stream without needing to re-encode the complete frame.

[0049] The incremental processing involves extremely small amounts of data and boasts a fast processing speed (milliseconds). Once processed, the data is instantly pushed to the corresponding display, ensuring viewers experience no interruption to the live stream / playback. Simultaneously, the integrity of the original video stream remains unaffected, avoiding image quality loss and time delays caused by full re-encoding. This feature significantly enhances the flexibility of watermark editing, making it particularly suitable for scenarios such as holidays and sporting events where temporary watermark adjustments are necessary.

[0050] The embodiments of this application will now be described in detail with reference to practical applications.

[0051] Please see Figure 6 and Figure 7 , Figure 6 This is a diagram of a single-channel video capture, multi-channel watermarking, and targeted streaming architecture provided in an embodiment of this application. Figure 7 This is a flowchart illustrating the implementation steps of the editable method for capturing one video stream and watermarking multiple streams, as provided in this application embodiment. Figure 6 , Figure 7As shown, this embodiment is applied to the scenario of comprehensive urban traffic law enforcement. In response to the need to simultaneously broadcast law enforcement footage to multiple platforms and add exclusive differentiated watermarks during traffic law enforcement, based on the method in this embodiment, the customized watermark push and real-time management of single-channel video collected by the law enforcement recorder to multiple terminals such as the municipal traffic monitoring platform, the provincial traffic supervision platform, and the local news media live broadcast platform are realized, ensuring that the law enforcement process is traceable and the information display on each platform is accurate.

[0052] The traffic enforcement recorder has a built-in high-definition camera (1920×1080 resolution, 30fps) that supports real-time acquisition of video footage from enforcement scenes, including dynamic images of traffic violation investigations, accident scene investigations, and delivery of enforcement documents.

[0053] The city traffic monitoring platform server is deployed in the city traffic command center and supports RTMP protocol streaming for internal law enforcement supervision and dispatching. The provincial traffic supervision platform server is deployed in the provincial traffic data center and supports HLS protocol streaming for cross-regional law enforcement supervision. The local news media live streaming platform server is deployed in the media data center and supports HTTP-FLV protocol streaming for live streaming key law enforcement actions to the public.

[0054] Before setting off on a mission, law enforcement officers pre-configure basic watermark information (which can be modified) for each platform via the touchscreen of their body camera mobile terminal: City traffic monitoring platform: Watermark content "City Traffic Management Bureau - Enforcement Number 123456 - Enforcement Officer Zhang San", location: upper left of the screen; Provincial-level traffic supervision platform: Watermark content "Provincial Traffic Law Enforcement Supervision - Law Enforcement Detachment - December 13, 2025", location: lower right corner of the screen; Local news media live streaming platform: Watermarked content "XX News - Traffic Enforcement Live - Real-time Footage", located in the lower left corner of the screen.

[0055] Law enforcement officers activated the body camera and started the "multi-platform live streaming mode". The terminal automatically created a basic GPU environment context (named Environment 1) and initialized a shared texture cache A to store the original video data, ensuring that it can be shared and read by multiple platforms.

[0056] When the built-in camera of the law enforcement recorder is activated, it captures real-time video footage of the law enforcement scene. The terminal uses the GPU rendering pipeline to directly write each frame of the image into a shared texture A, avoiding repeated copying of the original video data and improving transmission efficiency. At this time, texture A stores the original law enforcement footage without watermarks and with high fidelity.

[0057] Based on the basic GPU environment 1, the terminal creates three platform-specific GPU environments with the same architecture as environment 1 (named B1, B2, and B3, corresponding to the city, province, and media platforms, respectively). Each GPU environment runs independently and, through the terminal's memory sharing mechanism, has the permission to read the shared texture A, enabling multiple parallel processing of a single original video.

[0058] Platform B1 (Municipal Transportation Management Bureau): Reads the original image from shared texture A, and overlays a white semi-transparent watermark (font: bold, font size: 24, transparency 60%) on the upper left of the image according to the preset configuration. After overlay, it is encoded in real time through an H.265 encoder to generate a video stream that conforms to the RTMP protocol. Platform B2 (Provincial Law Enforcement Supervision): Reads the original image from shared texture A, overlays a blue semi-transparent watermark (font: SimSun, font size: 22, transparency 50%) in the lower right corner of the image, and encodes it as an HLS protocol video stream; Platform B3 (News Media): Reads the original image from shared texture A, overlays a red semi-transparent watermark (font: Microsoft YaHei, font size: 26, transparency 70%) in the lower left corner of the image, and encodes it as an HTTP-FLV protocol video stream.

[0059] The terminal pushes the encoded watermarked video stream to the corresponding platform's streaming server according to the preset streaming address of each platform: Push RTMP streams to the municipal traffic management bureau server, HLS streams to the provincial law enforcement supervision server, and HTTP-FLV streams to the news media server.

[0060] During law enforcement, if it is necessary to modify watermark information (such as updating the enforcement number or adding the name of the enforcement officer), the enforcement officer can do so through the terminal touch screen: Click the "Watermark Edit" button and select the target platform (such as a provincial platform); The watermark content has been modified to "Provincial Transportation Law Enforcement Supervision - Law Enforcement Detachment - December 13, 2025 - New Law Enforcement Personnel Li Si", and its position has been adjusted to the lower center of the image; Clicking "Confirm Synchronization" immediately updates the GPU environment watermark configuration of Platform B2, re-encodes and pushes the new video stream. The provincial law enforcement supervision platform display completes the watermark update within 1 second, without any screen stuttering or interruption.

[0061] The city traffic command center's monitoring screen displays real-time enforcement footage with a watermark in the upper left corner, supports multi-screen viewing, and automatically saves video files. Provincial enforcement supervisors can log in to the platform via their office computers to retrieve video streams with a watermark in the lower right corner, and can annotate and take screenshots as evidence in real time. The public can watch live enforcement broadcasts with a watermark in the lower left corner through news media apps or web pages.

[0062] In the above embodiments, the three platforms each display exclusive watermark content and location without confusion or overlap. The watermark style, transparency, and font size all meet the customization requirements of each platform. The modification of watermark content and location is completed entirely on the law enforcement recorder terminal without logging into the backend of each platform. It supports multiple streaming protocols such as RTMP, HLS, and HTTP-FLV, and is compatible with different display terminals such as large screens, computers, and mobile phones, meeting the needs of multiple scenarios such as law enforcement supervision and public live streaming.

[0063] In summary, the embodiments of this application have the following beneficial effects: By centrally acquiring raw video streams through terminal devices and constructing a shared cache and multiple independent second GPU environment contexts, each platform / TV station does not need to deploy a separate streaming server. They can directly and conveniently configure exclusive watermark information through the corresponding environment context, achieving differentiated customization of watermark styles. This significantly reduces the deployment and maintenance costs for each entity, while avoiding bandwidth waste caused by multiple entities repeatedly pulling streams, ensuring smooth live broadcasts. Furthermore, this application's embodiment adopts a design of basic template fixing + editable parameter adaptation, balancing the flexibility of station logo watermark editing with brand consistency, adapting to different scenario customization needs while ensuring brand recognition. Utilizing a video scene adaptive rendering strategy, it effectively solves... To address the issues of blurry watermarks and poor blending in different scenarios and improve the visual experience; to optimize cache management efficiency and reduce latency and overflow risks from multi-channel concurrent reads through a shared cache slice storage, pre-reading, and dynamic cleanup mechanism; to enhance collaborative stability and ensure uninterrupted multi-channel watermark processing by relying on distributed locks and fault tolerance mechanisms in multi-GPU environments, adapting to the high standards required for live streaming; to improve encoding and streaming efficiency and reduce resource consumption by applying inter-frame differential coding and dynamic bitrate adjustment technology, adapting to different bandwidth environments to avoid stuttering and blurry watermarks; and to achieve real-time, seamless watermark updates without re-encoding the entire video stream through incremental watermark region processing technology, further ensuring the continuity of live streaming or playback.

[0064] Based on the same inventive concept, this application also provides a multi-channel watermark editing device based on one-channel video acquisition, which corresponds to the multi-channel watermark editing method based on one-channel video acquisition in the first embodiment. Since the principle of the device in this application is similar to the multi-channel watermark editing method based on one-channel video acquisition, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0065] like Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of a multi-channel watermarking editable device 800 based on one-channel video acquisition, provided in an embodiment of this application. The multi-channel watermarking editable device 800 based on one-channel video acquisition includes: The first creation module is used to create a first GPU environment context through a terminal device and create a shared cache in the first GPU environment context; The acquisition module is used to acquire one raw video stream into the shared buffer via an acquisition device; The second creation module is used to create multiple second GPU environment contexts, wherein any of the multiple second GPU environment contexts can read the shared cache; The addition module is used to respond to a watermark addition request by reading the original video stream frame images in the shared cache through the multiple second GPU environment contexts, and adding the corresponding watermark to the video frame images based on the watermark configuration information. The streaming module is used to respond to streaming requests by streaming the watermarked and encoded video stream through the corresponding second GPU environment context and then streaming it to the corresponding display end.

[0066] Those skilled in the art should understand that Figure 8 The functions of each unit in the multi-channel watermarking editable device 800 based on one-channel video acquisition can be understood by referring to the relevant description of the multi-channel watermarking editable method based on one-channel video acquisition. Figure 8 The functions of each unit in the multi-channel watermark editable device 800 based on one-channel video acquisition shown can be implemented by a program running on a processor or by specific logic circuits.

[0067] In one possible implementation, the watermark is added in the following manner: The watermark logo is fixed as a base template, and editing permissions for size scaling, image position, transparency, and temporary additional elements are granted. Among them, the size scaling is preset with multiple adaptation ratios according to the display resolution to avoid logo distortion. Temporary additional elements include holiday corner marks and event logos, and the style and position of the additional elements are constrained by preset rules. The terminal device generates a preview image of the editing effect in real time, and embeds the video stream after confirming that the preview image of the editing effect is correct.

[0068] In one possible implementation, before adding the corresponding watermark based on the watermark configuration information, the method further includes: The scene type of the original video stream is identified by a video scene classification model. The scene types include static scenes, dynamic scenes, and scenes with alternating light and dark. Differentiated watermark rendering strategies are configured for different scene types. For static scenes, a semi-transparent watermark is used, while for dynamic scenes, the watermark edge sharpening is enhanced to resist blurring. For scenes with alternating light and dark, the watermark brightness is automatically synchronized with the screen brightness.

[0069] In one possible implementation, after the original video stream is captured to a shared buffer, the method further includes: The original video stream is marked with frame-level timestamps, and the video stream is divided into multiple sub-stream segments according to preset time slices and stored in a multi-level partition of a shared buffer. At the same time, a sub-stream index table is established. When each second GPU environment context reads the video stream, it pre-reads the sub-stream segments of the next N time slices based on the index table to reduce reading latency; when the shared cache storage space is insufficient, it automatically deletes the sub-stream segments that have been watermarked.

[0070] In one possible implementation, after creating multiple second GPU environment contexts, collaborative control and fault tolerance steps are also included: Each second GPU environment context is assigned a unique identifier, and a distributed lock mechanism is used to control the concurrent read permissions of each environment to the shared cache in order to avoid data conflicts; A timed synchronization verification mechanism is set up so that each second GPU environment context periodically reports the watermark processing progress. If the processing delay of a certain environment exceeds a preset threshold, the terminal device automatically starts a backup processing thread to take over its task. After the original environment is restored, the processing progress is connected through an incremental synchronization mechanism to ensure the continuity of multi-channel watermark processing.

[0071] In one possible implementation, the encoding process employs inter-frame differential coding, encoding only frames that differ from the original video stream after the watermark is added; during streaming, the streaming bitrate is dynamically adjusted based on the network bandwidth of each display terminal, and when the bandwidth is below a threshold, priority is given to ensuring the clarity of the watermark and the smoothness of the core video content.

[0072] In one possible implementation, a real-time watermark update step is also included: In response to a watermark editing request, the corresponding watermark configuration information is updated. The watermark area in the video stream is incrementally processed only through the corresponding second GPU environment context. After processing, the watermark is immediately pushed to the corresponding display end to achieve seamless watermark updates without re-encoding the entire video stream.

[0073] The aforementioned multi-channel watermarking editable device based on single-channel video capture centrally acquires the original video stream through terminal devices and constructs a shared cache and multiple independent second GPU environment contexts. Each platform / TV station does not need to deploy a separate stream server; it can directly and conveniently configure exclusive watermark information through the corresponding environment context, achieving differentiated customization of watermark styles. This significantly reduces the deployment and maintenance costs for each entity, while avoiding bandwidth waste caused by multiple entities repeatedly pulling streams, ensuring the smoothness of live broadcasts. Furthermore, this application embodiment also adopts a design of basic template fixing + editable parameter adaptation, balancing the flexibility of logo watermark editing with brand consistency, adapting to different scenario customization needs while ensuring brand recognition; leveraging video scene self-... Adapting to rendering strategies, it effectively solves the problems of watermark blurring and poor blending in different scenarios, improving the visual experience; through the slice storage, pre-fetching and dynamic cleanup mechanism of shared cache, it optimizes cache management efficiency and reduces the latency and overflow risk of multi-channel concurrent reads; relying on the distributed lock and fault tolerance mechanism of multi-GPU environment, it strengthens collaborative stability, ensures continuous and uninterrupted multi-channel watermark processing, and adapts to the high-standard requirements of live streaming; applying inter-frame differential coding and dynamic bitrate adjustment technology improves encoding and streaming efficiency, reduces resource consumption, and adapts to different bandwidth environments to avoid stuttering and watermark blurring; through watermark region incremental processing technology, it achieves real-time and imperceptible watermark updates without re-encoding the entire video stream, further ensuring the continuity of live streaming or playback.

[0074] like Figure 9 As shown, Figure 9 This is a schematic diagram of the composition structure of the electronic device 900 provided in the embodiments of this application. The electronic device 900 includes: The device 900 includes a processor 901, a storage medium 902, and a bus 903. The storage medium 902 stores machine-readable instructions executable by the processor 901. When the electronic device 900 is running, the processor 901 communicates with the storage medium 902 via the bus 903. The processor 901 executes the machine-readable instructions to perform the steps of the multi-channel watermark editable method based on one-channel video acquisition described in this application embodiment.

[0075] In practical applications, the various components in the electronic device 900 are coupled together via a bus 903. It is understood that the bus 903 is used to achieve communication between these components. In addition to a data bus, the bus 903 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 9 The general designated all buses as Bus 903.

[0076] The aforementioned electronic devices centrally collect raw video streams through terminal devices and construct shared caches and multiple independent second GPU environment contexts. Each platform / TV station does not need to deploy a separate streaming server; they can directly and conveniently configure exclusive watermark information through the corresponding environment context, achieving differentiated customization of watermark styles. This significantly reduces the deployment and maintenance costs for each entity, while avoiding bandwidth waste caused by multiple entities repeatedly pulling streams, ensuring smooth live broadcasts. Furthermore, this embodiment adopts a design of fixed basic templates + editable parameter adaptation, balancing the flexibility of logo watermark editing with brand consistency, adapting to different scenario customization needs while ensuring brand recognition. It also utilizes a video scene adaptive rendering strategy… It effectively solves the problems of watermark blurring and poor blending in different scenarios, improving the visual experience; through the shared cache slice storage, pre-reading and dynamic cleanup mechanism, it optimizes cache management efficiency and reduces the latency and overflow risk of multi-channel concurrent reading; relying on the distributed lock and fault tolerance mechanism of multi-GPU environment, it strengthens collaborative stability and ensures continuous and uninterrupted multi-channel watermark processing, adapting to the high standard requirements of live streaming; it applies inter-frame differential coding and dynamic bitrate adjustment technology to improve encoding and streaming efficiency, reduce resource consumption, and adapt to different bandwidth environments to avoid stuttering and watermark blurring; through watermark region incremental processing technology, it achieves real-time and imperceptible watermark updates without re-encoding the entire video stream, further ensuring the continuity of live streaming or playback.

[0077] This application also provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by at least one processor 901, the multi-channel watermark editable method based on one-channel video acquisition described in this application is implemented.

[0078] In some embodiments, the storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), or a programmable read-only memory (PROM). Erasable Programmable Read-Only Memory (EPROM) Electrically Erasable Programmable Read-Only Memory (EEPROM) Read-only memory, flash memory, magnetic surface storage, optical disc, or CD-ROM ROM, Compact Disc Read It can be a memory such as a memory only; or it can be a device that includes one or any combination of the above-mentioned memories.

[0079] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0080] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0081] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0082] The aforementioned computer-readable storage medium centrally acquires raw video streams through terminal devices and constructs a shared cache and multiple independent second GPU environment contexts. Each platform / TV station does not need to deploy a separate streaming server; they can directly and conveniently configure exclusive watermark information through the corresponding environment context, achieving differentiated customization of watermark styles. This significantly reduces the deployment and maintenance costs for each entity, while avoiding bandwidth waste caused by multiple entities repeatedly pulling streams, ensuring smooth live broadcasts. Furthermore, this application embodiment adopts a design of basic template fixing + editable parameter adaptation, balancing the flexibility of editing station logo watermarks with brand consistency, adapting to different scenario customization needs while ensuring brand recognition; and leveraging video scene adaptive rendering strategies… This system effectively solves the problems of blurry watermarks and poor blending in different scenarios, improving the visual experience. Through a shared cache-based slice storage, pre-reading, and dynamic cleanup mechanism, it optimizes cache management efficiency and reduces latency and overflow risks associated with multi-channel concurrent reads. Relying on distributed locks and fault-tolerance mechanisms in a multi-GPU environment, it strengthens collaborative stability, ensuring continuous and uninterrupted multi-channel watermark processing to meet the high standards of live streaming. The application of inter-frame differential coding and dynamic bitrate adjustment technology improves encoding and streaming efficiency, reduces resource consumption, and adapts to different bandwidth environments to avoid stuttering and blurry watermarks. Through incremental watermark region processing technology, it achieves real-time, seamless watermark updates without re-encoding the entire video stream, further ensuring the continuity of live streaming or playback.

[0083] In the several embodiments provided in this application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0084] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0085] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0086] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a platform server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0087] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A multi-channel watermarking editable method based on one-channel video acquisition, characterized in that, Includes the following steps: A first GPU environment context is created through the terminal device, and a shared cache is created within the first GPU environment context; The acquisition device captures one original video stream into the shared buffer. Multiple second GPU environment contexts are created, wherein any one of the multiple second GPU environment contexts can read the shared cache; In response to a watermark addition request, the original video stream frame images in the shared cache are read through the multiple second GPU environment contexts respectively, and the corresponding watermarks are added to the video frame images based on the watermark configuration information; In response to a streaming request, the watermarked and encoded video stream is encoded and then streamed to the corresponding display device through the corresponding second GPU environment context.

2. The method according to claim 1, characterized in that, The watermark is added in the following way: The watermark logo is fixed as a base template, and editing permissions for size scaling, image position, transparency, and temporary additional elements are granted. Among them, the size scaling is preset with multiple adaptation ratios according to the display resolution to avoid logo distortion. Temporary additional elements include holiday corner marks and event logos, and the style and position of the additional elements are constrained by preset rules. The terminal device generates a preview image of the editing effect in real time, and embeds the video stream after confirming that the preview image of the editing effect is correct.

3. The method according to claim 1, characterized in that, Before adding the corresponding watermark based on the watermark configuration information, the method further includes: The scene type of the original video stream is identified by a video scene classification model. The scene types include static scenes, dynamic scenes, and scenes with alternating light and dark. Differentiated watermark rendering strategies are configured for different scene types. For static scenes, a semi-transparent watermark is used, while for dynamic scenes, the watermark edge sharpening is enhanced to resist blurring. For scenes with alternating light and dark, the watermark brightness is automatically synchronized with the screen brightness.

4. The method according to claim 1, characterized in that, After the raw video stream is captured to a shared buffer, the method further includes: The original video stream is marked with frame-level timestamps, and the video stream is divided into multiple sub-stream segments according to preset time slices and stored in a multi-level partition of a shared buffer. At the same time, a sub-stream index table is established. When each second GPU environment context reads the video stream, it pre-reads the sub-stream segments of the next N time slices based on the index table to reduce reading latency; when the shared cache storage space is insufficient, it automatically deletes the sub-stream segments that have been watermarked.

5. The method according to claim 1, characterized in that, After creating multiple second GPU environment contexts, the process also includes collaborative control and fault tolerance steps: Each second GPU environment context is assigned a unique identifier, and a distributed lock mechanism is used to control the concurrent read permissions of each environment to the shared cache in order to avoid data conflicts; A timed synchronization verification mechanism is set up so that each second GPU environment context periodically reports the watermark processing progress. If the processing delay of a certain environment exceeds a preset threshold, the terminal device automatically starts a backup processing thread to take over its task. After the original environment is restored, the processing progress is connected through an incremental synchronization mechanism to ensure the continuity of multi-channel watermark processing.

6. The method according to claim 1, characterized in that, The encoding process uses inter-frame differential coding, which encodes only frames that differ from the original video stream after the watermark is added. During streaming, the streaming bitrate is dynamically adjusted based on the network bandwidth of each display terminal. When the bandwidth is below the threshold, priority is given to ensuring the clarity of the watermark and the smoothness of the core video content.

7. The method according to claim 1, characterized in that, It also includes the real-time watermark update process: In response to a watermark editing request, the corresponding watermark configuration information is updated. The watermark area in the video stream is incrementally processed only through the corresponding second GPU environment context. After processing, the watermark is immediately pushed to the corresponding display end to achieve seamless watermark updates without re-encoding the entire video stream.

8. A multi-channel watermarking editable device based on one-channel video acquisition, characterized in that, The device includes: The first creation module is used to create a first GPU environment context through a terminal device and create a shared cache in the first GPU environment context; The acquisition module is used to acquire one raw video stream into the shared buffer via an acquisition device; The second creation module is used to create multiple second GPU environment contexts, wherein any of the multiple second GPU environment contexts can read the shared cache; The addition module is used to respond to a watermark addition request by reading the original video stream frame images in the shared cache through the multiple second GPU environment contexts, and adding the corresponding watermark to the video frame images based on the watermark configuration information. The streaming module is used to respond to streaming requests by streaming the watermarked and encoded video stream through the corresponding second GPU environment context and then streaming it to the corresponding display end.

9. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the multi-channel watermark editable method based on one-channel video capture as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the multi-channel watermarking editable method based on one-channel video acquisition as described in any one of claims 1 to 7.