The invention relates to the technical field of
watermark generation, and discloses a
watermark adding method and
system, and the method comprises the steps: obtaining an original video
stream, and carrying out the preprocessing and decoding of the original video
stream, and obtaining an
uncompressed video frame; generating a to-be-embedded
watermark content according to a specific scene and a demand; distributing the generated watermark content to be embedded and the obtained
uncompressed video frame to a plurality of CPU threads for
parallel processing; judging whether the
system is in a high-load state or not according to the utilization rates of the CPU and the GPU, if the
system is in the high-load state, embedding the watermark content into the
uncompressed video frame by using an LSB-based
watermark algorithm to obtain a to-be-compressed video frame, and if the system is not in the high-load state, embedding the watermark content into the uncompressed video frame by using a DCT-based
watermark algorithm to obtain a to-be-compressed video frame; obtaining a to-be-compressed video frame; and compressing and outputting the to-be-compressed video frame. The watermark
processing efficiency can be effectively improved, and meanwhile the
video quality is guaranteed.