CN110198492B - Video watermark adding method, device, equipment and storage medium - Google Patents

Video watermark adding method, device, equipment and storage medium Download PDF

Info

Publication number
CN110198492B
CN110198492B CN201910348979.4A CN201910348979A CN110198492B CN 110198492 B CN110198492 B CN 110198492B CN 201910348979 A CN201910348979 A CN 201910348979A CN 110198492 B CN110198492 B CN 110198492B
Authority
CN
China
Prior art keywords
attribute
video
pixel data
format
watermark information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910348979.4A
Other languages
Chinese (zh)
Other versions
CN110198492A (en
Inventor
范志兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910348979.4A priority Critical patent/CN110198492B/en
Priority to CN202211440534.7A priority patent/CN115866356A/en
Publication of CN110198492A publication Critical patent/CN110198492A/en
Application granted granted Critical
Publication of CN110198492B publication Critical patent/CN110198492B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/835Generation of protective data, e.g. certificates
    • H04N21/8358Generation of protective data, e.g. certificates involving watermark

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for adding a watermark to a video, wherein the method comprises the following steps: acquiring an attribute description file of watermark information; setting a target attribute in the attribute description file based on target attribute data of the target video; converting the set attribute description file into pixel data in a first format; adding the pixel data of the first format of the watermark information in the pixel data of the first format of the target video to obtain watermark added pixel data; and processing the watermark adding pixel data to obtain the video data added with the watermark information. By utilizing the technical scheme provided by the application, the target attribute of the watermark information can be adjusted in a self-adaptive manner, and the resolution and the fluency of the video picture added with the watermark are improved.

Description

Video watermark adding method, device, equipment and storage medium
Technical Field
The present application relates to the field of video information processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for adding a watermark to a video.
Background
With the development of video technology, the requirement of adding watermark information into a video is more and more strong, for example, adding watermark information into a video for copyright maintenance, or adding a watermark related to an advertisement into a video for advertisement promotion and the like.
At present, when watermark information is added to a video, the video is usually decoded first to obtain decoded video information; then, directly adding watermark information to the decoded video information; and finally, coding the decoded video information added with the watermark information to complete the addition of the watermark information in the video. However, in the above conventional video watermark adding method, since attributes such as resolutions of a video and watermark information to be added with a watermark are fixed, the attributes such as the resolutions of the video and watermark information are often different, and in the process of adding the watermark information, adjustment such as scaling of the watermark information needs to be performed based on the video resolution, which causes problems such as distortion of the added watermark, and poor resolution and smoothness of a video image after adding the watermark. Therefore, there is a need to provide a more reliable or efficient solution.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for adding a watermark to a video, which can realize the self-adaptive adjustment of the target attribute of watermark information and improve the resolution and the fluency of a video picture added with the watermark.
In one aspect, the present application provides a method for adding a watermark to a video, where the method includes:
acquiring an attribute description file of watermark information;
setting target attributes in the attribute description file based on target attribute data of a target video;
converting the set attribute description file into pixel data in a first format;
adding the pixel data of the first format of the watermark information into the pixel data of the first format of the target video to obtain watermark added pixel data;
and processing the watermark adding pixel data to obtain the video data added with the watermark information.
Another aspect provides a watermarking apparatus for video, the apparatus including:
the attribute description file acquisition module is used for acquiring an attribute description file of the watermark information;
the target attribute setting module is used for setting target attributes in the attribute description file based on target attribute data of a target video;
the pixel data conversion module is used for converting the set attribute description file into pixel data in a first format;
the watermark adding module is used for adding the pixel data of the first format of the watermark information in the pixel data of the first format of the target video to obtain watermark added pixel data;
and the pixel data processing module is used for processing the watermark adding pixel data to obtain the video data added with the watermark information.
In some embodiments, the watermarking module comprises:
the decoding processing unit may be configured to perform decoding processing on the target video to obtain pixel data of a first format of the target video;
the watermark adding unit may be configured to add the pixel data of the first format of the watermark information to a preset adding position of the pixel data of the first format of the target video, so as to obtain the watermark added pixel data.
Another aspect provides a watermarking apparatus for video, the apparatus including a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the watermarking method for video as described above.
Another aspect provides a computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement a method of watermarking a video as described above.
The method, the device, the equipment and the storage medium for adding the watermark to the video have the following technical effects:
by acquiring the attribute description file of the watermark information instead of directly acquiring the watermark information with fixed attribute, the method can set the target attribute in the attribute description file based on the target attribute data of the target video, and realize the self-adaptive adjustment of the target attribute of the watermark information; then, converting the set attribute description file into pixel data with a format consistent with that of the pixel data of the target video, directly adding the pixel data into the pixel data of the target video to obtain watermark-added pixel data, and finally, coding the watermark-added pixel data to obtain video data with smooth pictures and watermarks; in the encoding process of the pixel data added with the watermark, the rendering generation of the watermark information is realized, and the problems of watermark deformation, low resolution, poor fluency and the like of a video picture added with the watermark, which are caused by the attribute adjustment in the adding process of the existing watermark information with fixed attribute, can be avoided.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
fig. 2 is a schematic diagram of a video watermark editing interface provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a video watermark presentation interface provided in an embodiment of the present application;
fig. 4 is a flowchart illustrating a method for watermarking a video according to an embodiment of the present application;
fig. 5 is a schematic diagram of watermark information provided in an embodiment of the present application;
fig. 6 is a schematic flowchart of setting a target attribute in the attribute description file based on target attribute data of a target video according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another process for setting a target attribute in the attribute description file based on target attribute data of a target video according to an embodiment of the present application;
fig. 8 is a schematic flowchart illustrating a process of converting the configured attribute description file into pixel data in a first format according to an embodiment of the present application;
fig. 9 is a schematic diagram illustrating a frame rate comparison between a target video and watermark information according to an embodiment of the present application;
fig. 10 is a schematic diagram of pictures corresponding to different video frames of video watermark information added to a target video according to an embodiment of the present application;
fig. 11 is a schematic view of a video picture of a certain frame of a target video according to an embodiment of the present application;
fig. 12 is a schematic diagram of a frame of video picture of watermarked video data according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a video watermarking apparatus according to an embodiment of the present application;
FIG. 14 is a block diagram of a target attribute setup module provided by an embodiment of the present application;
FIG. 15 is a block diagram of a pixel data conversion module according to an embodiment of the present disclosure;
fig. 16 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a schematic diagram of an application environment according to an embodiment of the present disclosure, and as shown in fig. 1, the application environment may include a client 01 and a server 02.
Specifically, the client 01 may include software running in a physical device, such as an application provided by some service providers, and may also include a physical device of a smart phone, a desktop computer, a tablet computer, a notebook computer, a digital assistant, a smart wearable device, and the like, in which the application is installed. The operating system running on the client 01 in this embodiment may include, but is not limited to, an android system, an IOS system, linux, windows, and the like. Specifically, the client 01 may provide an editing interface for adding watermark information to a video, such as input of a video to which a watermark needs to be added and input of watermark information, for a user.
Specifically, the server 02 may include a server operating independently, or a distributed server, or a server cluster composed of a plurality of servers. The server 02 may serve as a background of the client 01, and is configured to perform video watermarking.
In practical applications, the client 01 may send the video and the watermark information to the server 02, so that the server 02 may perform the watermarking process of the video. In a specific embodiment, as shown in fig. 2, fig. 2 is a schematic diagram of a video watermark editing interface provided in an embodiment of the present application, and as can be seen from the video watermark editing interface in fig. 2 (a), a user may add video and watermark information in the video watermark editing interface provided by the client 01. After the video and the watermark information are added, as shown in a video watermark editing interface corresponding to (b) in fig. 2, a user can click a button for generating the watermark video, so that the client 01 sends the video and the watermark information to the server 02, and the server 02 performs the video watermark adding process.
In this embodiment, the watermark information sent by the client 01 to the server 02 may be an attribute description file of the watermark information. In particular, the attribute description file may include a data exchange format file that describes an attribute of the watermark information. (where the files in the data exchange format may include different programs of the computer, or description data files recognizable by different programming languages, and generally describe data in a specific form such as text.) as shown in fig. 2, the files in the data exchange format describing the attributes of the watermark information may include JSON (JSON object Notation) files describing the attributes of the watermark information; in addition, the VIDEO format may be FLV (FLASH VIDEO, streaming media format).
In addition, it should be noted that fig. 2 is only a schematic diagram of an example of a video watermarking editing interface, and in practical applications, the video watermarking editing interface may further include other information, and the supported video format is not limited to the FLV format, and may also include other video formats, for example, a RMVB (real media Variable bit rate) video format; the supported attribute description file is not limited to the JSON file, and in practical applications, the supported attribute description file may also include files in other data exchange formats.
In practical application, the server 02 may further send the video added with the watermark information to the client 01, so as to play and display the video at the client 01. In a specific embodiment, as shown in fig. 3, fig. 3 is a schematic diagram of a video watermark presentation interface provided in an embodiment of the present application, and as can be seen from fig. 3, by clicking to play, a user can view a video to which a watermark is added.
In addition, it should be noted that fig. 3 is only a schematic diagram of an example of a video watermark presentation interface, and in an actual application, the video watermark presentation interface may further include other information, for example, watermark information added to a video.
A specific embodiment of a video watermarking method according to the present application is described below, and fig. 4 is a schematic flowchart of a video watermarking method according to an embodiment of the present application, where the present specification provides the method operation steps as described in the embodiment or the flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of sequences, and does not represent a unique order of performance. In practice, the system or server product may be implemented in a sequential or parallel manner (e.g., parallel processor or multi-threaded environment) according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 4, the method may include:
s401: and acquiring an attribute description file of the watermark information.
In this embodiment of the present disclosure, the watermark information may include watermark information in a picture format (referred to as picture watermark information for short), or may also include watermark information in a video format (referred to as video watermark information for short). Specifically, the attribute described in the attribute description file of the watermark information may include characteristic attribute information of an object constituting the watermark information and attribute information corresponding to the format of the watermark.
In a specific embodiment, as shown in fig. 5, assuming that the watermark information is static picture watermark information as shown in fig. 5, correspondingly, the attribute described by the attribute description file may include: characteristic attribute information such as the shape, size, and color of each object (earth, tree, various buildings) constituting the watermark information, and attribute information such as the resolution corresponding to the still picture format. In addition, for dynamic picture formats such as the GIF, attribute information such as the total playing time length can be corresponded.
In addition, it should be noted that fig. 5 is only an example of one kind of watermark information, and in practical applications, the watermark information may be adjusted based on values of different attributes in the attribute description file, and the color of the corresponding watermark information may be green in fig. 5, for example.
In another specific embodiment, it is assumed that the watermark information is video watermark information, and in particular, the picture watermark information corresponding to fig. 5 is taken at a certain speed in a preset direction (for example, clockwise) to form a video. Accordingly, the attributes described by the attribute description file may include: the watermark information comprises characteristic attribute information such as the shape, the size, the color movement direction, the movement speed and the like of each moving object (earth, trees and various buildings) forming the watermark information, and attribute information such as the resolution, the frame rate, the total playing time and the like corresponding to the video format.
In this embodiment, when it is necessary to add watermark information to a certain video, an attribute description file of the watermark information may be acquired from a client side of a foreground, or may be acquired from a database in which the attribute description file of the watermark information is stored. In a specific embodiment, the obtaining the attribute description file of the watermark information may include: and acquiring a file in a json data exchange format for describing the attribute of the watermark information.
In the embodiment of the present specification, when performing watermark adding processing on a video, an attribute description file of watermark information is obtained, instead of directly obtaining watermark information with fixed attributes, so that relevant attributes of the watermark information can be adaptively adjusted in combination with the video to be watermarked, the difficulty in designing the watermark information is reduced, and a watermark adding effect on videos with different attributes is ensured.
S403: and setting the target attribute in the attribute description file based on the target attribute data of the target video.
In this embodiment, the target video may include video data to be watermarked. The target attribute may include an attribute that affects the quality of the watermark information.
In a specific embodiment, when the watermark information is video watermark information, the target attribute may include a resolution attribute and a frame rate attribute, and the target attribute data of the target video may include a resolution and a frame rate; accordingly, as shown in fig. 6, the setting of the target attribute in the attribute description file based on the target attribute data of the target video may include:
s4031: and analyzing the attribute description file to obtain the resolution attribute and the frame rate attribute of the watermark information.
In practical applications, the attribute description file is often encoded according to a certain data structure during encoding, for example, the data structure of a json file is a key-value pair of an object (attribute of watermark information): { "t":25} (the value of object t is 25). Correspondingly, during analysis processing, the data structure during encoding of the attribute description file can be analyzed, and further the attribute of the watermark information described in the attribute description file can be obtained.
Specifically, the attribute description file includes attributes of a large amount of watermark information, and when the watermark information is video watermark information, the attributes affecting the image quality of the video watermark information include a resolution attribute and a frame rate attribute, and the resolution attribute and the frame rate attribute can be extracted from the analyzed information.
S4033: and acquiring the resolution and the frame rate of the target video.
S4035: and setting the resolution attribute and the frame rate attribute in the attribute description file as the resolution and the frame rate of the target video respectively.
In practical applications, the resolution may be a parameter for measuring the amount of data in an image, and in general, may be expressed by a width and a height, for example, it may be assumed that the resolution of a target video is 1920 × 1080 (a unit is generally a pixel). Accordingly, the width and height values corresponding to the resolution attribute in the attribute description file may be set to 1920 and 1080, respectively.
In practical applications, the frame rate can be used as a measure of the number of display frames, in units of: FPS (Frames per Second, display Frames). For example, it can be assumed that the frame rate of the target video is 60fps. Accordingly, the value of the frame rate attribute in the attribute description file may be set to 60.
In another specific embodiment, when the watermark information is picture watermark information, the target attribute may include a resolution attribute, and the target attribute data of the target video may include a resolution; accordingly, as shown in fig. 7, the setting of the target attribute in the attribute description file based on the target attribute data of the target video may include:
s4037: and analyzing the attribute description file to obtain the resolution attribute of the watermark information.
S4039: and acquiring the resolution of the target video.
S40311: and setting the resolution attribute in the attribute description file as the resolution of the target video.
Specifically, when the watermark information is picture watermark information, the relevant steps of analyzing the attribute description file and setting the resolution may refer to the relevant steps in which the watermark information is video watermark information, and are not described herein again.
In the embodiment of the specification, the target attribute influencing the image quality of the watermark information in the attribute description file directly corresponding to the watermark information can be set according to the target attribute data of the video, so that when the subsequent watermark information is added to the video, the subsequent watermark information is directly added without performing attribute matching adjustment of the watermark information and the video; meanwhile, the problems of watermark information deformation and the like caused by the fact that the existing watermark information with fixed attributes is directly subjected to attribute adjustment can be solved.
S405: and converting the set attribute description file into pixel data in a first format.
In practical applications, adding a watermark to a video often requires adding watermark information to a decoded video (pixel data), and accordingly, the watermark information may also be converted into pixel data having a format consistent with that of the decoded video data.
Specifically, the first format is a format of pixel data after decoding the target video. Generally the first format may be YUV, where "Y" denotes brightness, "U" denotes chroma and "V" denotes concentration.
In a specific embodiment, as shown in fig. 8, when the watermark information is video watermark information, the converting the set attribute description file into pixel data in the first format may include:
s4051: and determining the time axis data of the video watermark information based on the frame rate attribute set in the attribute description file.
In this embodiment, the frame rate attribute set in the attribute description file may include a numerical value of the frame rate attribute.
In practical applications, the video watermark information usually corresponds to a time axis, for example, 30 seconds of video watermark information corresponds to a 30 second time axis. In the embodiments of the present specification, the time axis data of the video watermark information may include the number of frames at each time point in the time axis of the video watermark information.
In a specific embodiment, assuming that the frame rate attribute after setting in the attribute description file is 60fps, accordingly, the frame number of each time point in the time axis of the video watermark information can be determined to be 60.
S4053: and converting the set attribute description file into pixel data in a second format according to the time axis data and the set resolution parameter.
In particular, the second format may comprise an initial format in which the attribute description file is converted to pixel data, such as RGBA, where R may represent Red (Red), G may represent Green (Green), B may represent Blue (Blue) and Alpha (typically used as opacity parameter) that a may represent.
S4055: and converting the pixel data in the second format into pixel data in the first format.
In this embodiment, in order to ensure that the format of pixel data is consistent when pixel data of watermark information is added to pixel data of a target video, pixel data of a second format may be converted into pixel data of a first format.
In other embodiments, when the watermark information is picture watermark information, the converting the set attribute description file into pixel data in the first format may include: and converting the set attribute description file into pixel data in a second format according to the set resolution attribute. And converting the pixel data in the second format into the pixel data in the first format.
In the embodiment of the present specification, after the target attribute in the attribute description file of the watermark information is set based on the target attribute data of the target video, the attribute description file of the watermark information is converted into the pixel data in the format consistent with the pixel data decoded from the target video, so that the problems of deformation and the like caused by attribute adjustment in the adding process of the existing watermark information with fixed attribute are avoided.
S407: and adding the pixel data of the first format of the watermark information in the pixel data of the first format of the target video to obtain the pixel data added with the watermark.
In this embodiment of the present specification, after obtaining pixel data in the first format of watermark information based on the set attribute description file, pixel data in the first format of the watermark information may be added to pixel data in the first format of the target video, so as to obtain watermarked pixel data. Specifically, the watermarked pixel data may include target video pixel data (pixel data of a target video) to which watermark pixel data (pixel data of watermark information) is added.
Specifically, the target video may be decoded to obtain pixel data of a first format of the target video; and adding the pixel data of the first format of the watermark information at a preset adding position of the pixel data of the first format of the target video to obtain the pixel data of the added watermark.
Specifically, the decoding process of the target video may be combined with an encoding algorithm in video encoding for decoding, which may be specifically referred to in the following related steps related to encoding and decoding.
In this embodiment of the present specification, the preset adding position may be position information in which watermark information is added to a video, which is set in advance, for example, 20 th to 30 th seconds of a target video. As shown in fig. 9, since the frame rate corresponding to the video watermark information is consistent with the frame rate of the target video, it can be seen from fig. 9 that the video frames of the video watermark information correspond to the video frames corresponding to the preset adding position of the target video one by one, and the pixel data of the watermark information can be directly added to the pixel data of the target video, so as to avoid the operations of frame interpolation or frame dropping caused by different frame rates in the prior art, and improve the processing efficiency in the watermark adding process.
S409: and processing the watermark adding pixel data to obtain the video data added with the watermark information.
In this embodiment, the processing the watermarked pixel data to obtain the video data with the watermarking information may include, but is not limited to, encoding the pixel data by using an H264 encoding algorithm to obtain the video data. Specifically, H264 is a highly compressed digital Video codec standard proposed by the Joint Video Team (JVT, joint Video Team) jointly composed of ITU-T Video Coding Experts Group (VCEG) and ISO/IEC Moving Picture Experts Group (MPEG).
In the embodiment of the present specification, in the encoding process, pixel data corresponding to each frame is sequentially encoded in units of frames, specifically, a mode (i.e., a size of each frame, for example, 16 × 16) may be determined based on pixel data (watermarked pixel data), and whether a reference frame exists in a frame corresponding to pixel data that needs to be currently encoded (the reference frame may be a frame that has already been encoded and has a high similarity between the pixel data and the pixel data that needs to be currently encoded).
In some embodiments, if there is a reference frame, inter-frame prediction processing may be performed based on the pixel data of the current pixel data to be encoded and the pixel data of the reference frame, that is, a motion vector and a residual restored image of the pixel data of the current pixel data to be encoded are determined based on the pixel data of the reference frame;
in other embodiments, if there is no reference frame, intra prediction processing may be performed based on the pixel data that needs to be currently encoded, that is, the motion vector and the residual restored image of the pixel data that needs to be currently encoded are determined based on different pixel points in the pixel data that needs to be currently encoded.
Further, performing time-frequency transformation on the pixel data after the inter-frame prediction processing or the intra-frame prediction processing (the low-frequency (outline) and high-frequency (detail) parts of the image can be separated through the time-frequency transformation), so as to obtain frequency domain data; then, the frequency domain data is quantized (i.e. lossy compression is performed, for example, the frequency domain data after time-frequency transformation is 22, 30, 45, quantization step size 20, quantization result 1 (22/20), 1 (30/20), 2 (45/20), that is, rounding processing is performed based on the step size); then, entropy coding is carried out on the quantized data to obtain a video frame of the current pixel data. Video data added with watermark information can be obtained based on the video frame corresponding to each pixel data.
In addition, after the quantization, inverse time-frequency transformation, image restoration through motion vectors and residuals, and image addition to the reference frame sequence may also be performed to provide a reference frame for the subsequent encoding process.
Specifically, the specific process of decoding the video data obtained based on the above-mentioned encoding process may be as follows:
analyzing each frame of video frame to obtain entropy-encoded minimum coding units (macro blocks, namely entropy-encoded data), and then performing entropy decoding on each minimum coding unit; then, inverse quantization (i.e. multiplying by the step size when quantizing) is performed on the entropy-decoded data; then, inverse time-frequency transformation (i.e. converting the data from the frequency domain to the time domain) is carried out to obtain the data of the time domain (i.e. the motion vector and the motion residual error recovery data); then, pixel data corresponding to each frame of video data is obtained based on the motion vector and the motion residual recovery data.
Specifically, in the embodiment of the present specification, in the process of encoding the watermarking pixel data, the video data with the watermarking information added thereto is obtained based on the watermarking pixel data corresponding to each frame, and meanwhile, the rendering generation of the target video and the picture of each frame of the watermarking information is realized.
As can be seen from the technical solutions provided by the embodiments of the present specification, in the embodiments of the present specification, by acquiring an attribute description file of watermark information instead of directly acquiring watermark information with a fixed attribute, a target attribute in the attribute description file may be set based on target attribute data of a target video, so as to implement adaptive adjustment of the target attribute of the watermark information, then, the set attribute description file is converted into pixel data with a format consistent with pixel data after video decoding, and the pixel data is directly added to the pixel data after target video decoding, so as to obtain watermark-added pixel data, and finally, the watermark-added pixel data is encoded, so as to obtain video data with a smooth picture and a watermark added. By using the technical scheme provided by the embodiment of the specification, the target attribute of the watermark information can be adaptively adjusted based on the target attribute data of the target video, the rendering generation of the watermark information is realized in the encoding process of the watermark adding pixel data added with the watermark information, the resolution and the fluency of the video picture added with the watermark are improved, and the problems of watermark deformation, low resolution and poor fluency of the video picture added with the watermark, and the like caused by attribute adjustment in the adding process of the existing watermark information with fixed attribute can be avoided.
In a specific embodiment, taking the video formed by shooting the picture corresponding to fig. 5 clockwise at a certain speed as the video watermark information as an example, as shown in fig. 10, fig. 10 is a schematic diagram of pictures corresponding to different video frames of the video watermark information added to the target video according to an embodiment of the present disclosure. As can be seen from fig. 10, in the process of adding the watermark information, the attribute description file of the watermark information is adaptively adjusted according to the target attribute data of the target video; adding the pixel data of the watermark information after the self-adaptive adjustment to obtain the pixel data of the added watermark; finally, in the process of coding the pixel data added with the watermark, the rendering generation of the watermark information is realized, and the problem of watermark deformation caused by attribute adjustment in the adding process of the existing watermark information with fixed attributes is solved.
In another specific embodiment, as shown in fig. 11, fig. 11 is a schematic diagram of a video picture of a frame of a target video provided in an embodiment of the present application. It is assumed that the watermark information to be added to the target video corresponding to fig. 11 is dynamic video watermark information for launching a bomb by an airplane. Correspondingly, by using the technical scheme provided by the embodiment of the application, the attribute description file of the video watermark information can be obtained, and the attribute description file can include the size, shape, color, flight direction and flight speed of the airplane and the bomb, the object characteristic attribute information such as the size, shape, color, thrown-in motion direction and motion speed of the bomb, and the attribute information such as the resolution, frame rate and total playing duration corresponding to the video format. Correspondingly, after the attribute description file is obtained, the resolution attribute and the frame rate attribute which influence the image quality of the video watermark information in the attribute description file can be adaptively adjusted based on the target attribute data of the target video, the attribute description file after adaptive adjustment is converted into pixel data with a format consistent with the pixel data after the target video is decoded, and the pixel data is directly added into the pixel data after the target video is decoded to obtain watermark added pixel data; finally, as shown in fig. 12, fig. 12 is a schematic diagram of a frame of video picture of the video data after the watermark is added according to the embodiment of the present application. In the encoding process of the watermark adding pixel data added with the watermark information, the rendering generation of the watermark information is realized, and the video watermark data with smooth pictures and high resolution is obtained.
An embodiment of the present application further provides a video watermarking apparatus, as shown in fig. 13, the apparatus includes:
an attribute description file obtaining module 1310, configured to obtain an attribute description file of watermark information;
a target attribute setting module 1320, which may be configured to set a target attribute in the attribute description file based on target attribute data of a target video;
a pixel data converting module 1330, configured to convert the set attribute description file into pixel data in a first format;
the watermark adding module 1340 may be configured to add the pixel data in the first format of the watermark information to the pixel data in the first format of the target video to obtain watermarked pixel data;
the pixel data processing module 1350 may be configured to process the watermark-added pixel data to obtain video data with watermark information added.
In some embodiments, the attribute description file obtaining module 1310 may be specifically configured to obtain a json data exchange format file that describes the attribute of the watermark information.
In some embodiments, as shown in fig. 14, when the watermark information is video watermark information, the target attribute includes a resolution attribute and a frame rate attribute; the target property setting module 1320 includes:
a first parsing unit 1321, configured to parse the attribute description file to obtain a resolution attribute and a frame rate attribute of the watermark information;
a first attribute data acquiring unit 1323 operable to acquire a resolution and a frame rate of the target video;
the first target attribute setting unit 1325 may be configured to set a resolution attribute and a frame rate attribute in the attribute description file to a resolution and a frame rate of the target video, respectively.
In some embodiments, as shown in fig. 15, when the watermark information is video watermark information, the pixel data conversion module 1330 may include:
a time axis data determining unit 1331, configured to determine, based on the frame rate attribute set in the attribute description file, time axis data corresponding to the video watermark information;
a first pixel data conversion unit 1333, configured to convert the set attribute description file into pixel data in a second format according to the time axis data and the set resolution attribute;
a second pixel data conversion unit 1335 may be configured to convert the pixel data of the second format into pixel data of the first format.
In some embodiments, when the watermark information is picture watermark information, the target attribute comprises a resolution attribute; the target property setting module 1320 may include:
the second analysis processing unit may be configured to perform analysis processing on the attribute description file to obtain a resolution attribute of the watermark information;
a second attribute data acquisition unit operable to acquire a resolution of the target video;
the second target attribute setting unit may be configured to set the resolution attribute in the attribute description file to the resolution of the target video.
In some embodiments, when the watermark information is picture watermark information, the pixel data conversion module 1330 may include:
the third pixel data conversion unit may be configured to convert the set attribute description file into pixel data in a second format according to the set resolution attribute;
a fourth pixel data conversion unit may be configured to convert the pixel data of the second format into pixel data of the first format.
In some embodiments, the watermarking module 1340 may include:
the decoding processing unit may be configured to perform decoding processing on the target video to obtain pixel data of a first format of the target video;
the watermark adding unit may be configured to add the pixel data in the first format of the watermark information to a preset adding position of the pixel data in the first format of the target video, so as to obtain the watermark added pixel data.
The device and method embodiments in the device embodiment are based on the same application concept.
The embodiment of the present application provides a video watermarking device, which includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or a set of instructions, and the at least one instruction, the at least one program, the code set, or the set of instructions are loaded and executed by the processor to implement the video watermarking method provided by the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal, a server or a similar operation device. Taking the example of running on a server, fig. 16 is a hardware structure block diagram of the server of a video watermarking method according to an embodiment of the present application. As shown in fig. 16, the server 1600 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1610 (the processor 1610 may include but is not limited to a Processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1630 for storing data, and one or more storage media 1620 (e.g., one or more mass storage devices) for storing applications 1623 or data 1622. Memory 1630 and storage media 1620 may be transient or persistent storage, among others. The program stored on the storage medium 1620 may include one or more modules, each of which may include a series of instruction operations in a server. Further, the central processor 1610 may be configured to communicate with the storage medium 1620, and execute a series of instruction operations in the storage medium 1620 on the server 1600. The server 1600 may also include one or more power supplies 1660, one or more wired or wireless network interfaces 1650, one or more input-output interfaces 1640, and/or one or more operating systems 1621, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The input/output interface 1640 may be used to receive or transmit data over a network. Specific examples of such networks may include wireless networks provided by the communications provider of server 1600. In one example, i/o Interface 1640 includes a Network adapter (NIC) that may be coupled to other Network devices through a base station to communicate with the internet. In one example, the input/output interface 1640 may be a Radio Frequency (RF) module, which is used to communicate with the internet via wireless.
It will be understood by those skilled in the art that the structure shown in fig. 16 is only an illustration and is not intended to limit the structure of the electronic device. For example, server 1600 may also include more or fewer components than shown in FIG. 16, or have a different configuration than shown in FIG. 16.
Embodiments of the present application further provide a storage medium that can be disposed in a device to store at least one instruction, at least one program, a code set, or a set of instructions related to implementing a watermarking method for a video in the method embodiments, where the at least one instruction, the at least one program, the code set, or the set of instructions are loaded and executed by the processor to implement the watermarking method for a video provided by the above method embodiments.
Optionally, in this embodiment, the storage medium may be located in at least one network device of a plurality of network devices of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
According to the embodiments of the video watermark adding method, the video watermark adding device, the video watermark adding server or the storage medium, the target attribute in the attribute description file can be set based on the target attribute data of the target video by acquiring the attribute description file of the watermark information instead of directly acquiring the watermark information with fixed attribute, so that the target attribute of the watermark information can be adjusted in a self-adaptive manner, then the set attribute description file is converted into the pixel data with the format consistent with the pixel data after video decoding, the pixel data is directly added to the pixel data after target video decoding to obtain the watermark added pixel data, and finally, the watermark added pixel data is encoded to obtain the video data after watermark addition with smooth picture. By using the technical scheme provided by the embodiment of the specification, the target attribute of the watermark information can be adaptively adjusted based on the target attribute data of the target video, the rendering generation of the watermark information is realized in the encoding process of the pixel data added with the watermark information, and the problems of watermark deformation, low resolution and poor fluency of the video picture added with the watermark, and the like caused by the attribute adjustment in the adding process of the existing watermark information with fixed attribute can be avoided.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device and storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is only a preferred embodiment of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A method of watermarking video, the method comprising:
acquiring an attribute description file of watermark information, wherein the watermark information comprises video watermark information, the attribute description file comprises a file in a data exchange format for describing the attribute of the watermark information, and the attribute described by the attribute description file comprises characteristic attribute information of each moving object forming the watermark information and attribute information corresponding to the video format;
setting a target attribute in the attribute description file based on target attribute data of a target video, wherein the target attribute data of the target video comprises a resolution ratio and a frame rate, and the target attribute in the attribute description file comprises a resolution ratio attribute and a frame rate attribute;
determining time axis data corresponding to the video watermark information based on the frame rate attribute set in the attribute description file;
converting the set attribute description file into pixel data in a second format according to the time axis data and the set resolution attribute, wherein the second format comprises an initial format for converting the attribute description file into the pixel data;
converting the pixel data in the second format into pixel data in a first format, wherein the first format is the format of the pixel data after the target video is decoded;
adding the pixel data of the first format of the watermark information into the pixel data of the first format of the target video to obtain watermark added pixel data;
and processing the watermark adding pixel data to obtain the video data added with the watermark information.
2. The method according to claim 1, wherein the obtaining the attribute description file of the watermark information comprises:
and acquiring a file in a json data exchange format for describing the attribute of the watermark information.
3. The method of claim 1, wherein the setting the target attribute in the attribute description file based on the target attribute data of the target video comprises:
analyzing the attribute description file to obtain a resolution attribute and a frame rate attribute of the watermark information;
acquiring the resolution and frame rate of the target video;
and setting the resolution attribute and the frame rate attribute in the attribute description file as the resolution and the frame rate of the target video respectively.
4. The method of claim 1, wherein the adding the pixel data of the first format of the watermark information to the pixel data of the first format of the target video to obtain the watermarked pixel data comprises:
decoding the target video to obtain pixel data of a first format of the target video;
and adding the pixel data of the first format of the watermark information at the preset adding position of the pixel data of the first format of the target video to obtain the pixel data of the added watermark.
5. An apparatus for watermarking video, the apparatus comprising:
the attribute description file acquisition module is used for acquiring an attribute description file of watermark information, wherein the watermark information comprises video watermark information, the attribute description file comprises a file in a data exchange format for describing attributes of the watermark information, and the attributes described by the attribute description file comprise characteristic attribute information of each moving object forming the watermark information and attribute information corresponding to the video format;
the target attribute setting module is used for setting a target attribute in the attribute description file based on target attribute data of a target video, wherein the target attribute data of the target video comprises a resolution ratio and a frame rate, and the target attribute in the attribute description file comprises a resolution ratio attribute and a frame rate attribute;
a time axis data determining unit, configured to determine time axis data corresponding to the video watermark information based on the frame rate attribute set in the attribute description file;
the pixel data conversion module is used for converting the set attribute description file into pixel data in a second format according to the time axis data and the set resolution attribute, wherein the second format comprises an initial format of converting the attribute description file into the pixel data; converting the pixel data in the second format into pixel data in a first format, wherein the first format is the format of the pixel data after the target video is decoded;
the watermark adding module is used for adding the pixel data of the first format of the watermark information in the pixel data of the first format of the target video to obtain watermark added pixel data;
and the pixel data processing module is used for processing the watermark adding pixel data to obtain the video data added with the watermark information.
6. The apparatus according to claim 5, wherein the attribute description file obtaining module is specifically configured to obtain a file in json data exchange format that describes an attribute of the watermark information.
7. The apparatus of claim 5, wherein the target property setting module comprises:
the first analysis processing unit is used for analyzing the attribute description file to obtain the resolution attribute and the frame rate attribute of the watermark information;
a first attribute data acquisition unit, configured to acquire a resolution and a frame rate of the target video;
and the first target attribute setting unit is used for setting the resolution attribute and the frame rate attribute in the attribute description file as the resolution and the frame rate of the target video respectively.
8. A watermarking device of a video, characterized in that the device comprises a processor and a memory, in which at least one instruction, at least one program, set of codes or set of instructions is stored, which is loaded and executed by the processor to implement the watermarking method of a video according to any of claims 1 to 4.
9. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the method of watermarking a video according to any of claims 1 to 4.
CN201910348979.4A 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium Active CN110198492B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910348979.4A CN110198492B (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium
CN202211440534.7A CN115866356A (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910348979.4A CN110198492B (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202211440534.7A Division CN115866356A (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110198492A CN110198492A (en) 2019-09-03
CN110198492B true CN110198492B (en) 2022-11-04

Family

ID=67752295

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202211440534.7A Pending CN115866356A (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium
CN201910348979.4A Active CN110198492B (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202211440534.7A Pending CN115866356A (en) 2019-04-28 2019-04-28 Video watermark adding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (2) CN115866356A (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730355A (en) * 2019-09-06 2020-01-24 西安万像电子科技有限公司 Video image processing method and device
CN110781463B (en) * 2019-10-29 2023-06-23 北京中电普华信息技术有限公司 Watermark information adding method and device
CN111669615B (en) * 2020-05-13 2022-09-30 北京奇艺世纪科技有限公司 Video stream processing method and device
CN111988672A (en) * 2020-08-13 2020-11-24 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN112333557A (en) * 2020-10-20 2021-02-05 深圳市前海手绘科技文化有限公司 Method for adding watermark in video
CN112422988A (en) * 2020-11-09 2021-02-26 合肥名阳信息技术有限公司 Video watermark adding method
CN115103227A (en) * 2022-06-21 2022-09-23 广州骏伯网络科技有限公司 Video material marking method, video material identification device, video material identification equipment and storage medium
CN115802105B (en) * 2022-11-16 2024-08-09 昆易电子科技(上海)有限公司 Video injection method, video injection device and information processing system
CN117688527B (en) * 2023-12-28 2024-07-16 北京领雁科技股份有限公司 Method and system for dynamically configuring watermark by application software

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102256184A (en) * 2011-07-21 2011-11-23 杭州海康威视软件有限公司 Space-domain-digital-watermark-based YUV file storage and play methods and devices
CN107464206A (en) * 2017-07-26 2017-12-12 维沃移动通信有限公司 A kind of watermark adding method and mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104135670B (en) * 2014-07-22 2018-01-19 乐视网信息技术(北京)股份有限公司 A kind of video broadcasting method and device
CN106412720B (en) * 2015-07-27 2020-06-16 腾讯科技(深圳)有限公司 Method and device for removing video watermark
CN105898323A (en) * 2015-12-04 2016-08-24 乐视致新电子科技(天津)有限公司 Method used for adding watermark in video and determining watermark information and device
CN107911641B (en) * 2017-10-27 2018-12-14 北京达佳互联信息技术有限公司 Video watermark generation method, device and terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102256184A (en) * 2011-07-21 2011-11-23 杭州海康威视软件有限公司 Space-domain-digital-watermark-based YUV file storage and play methods and devices
CN107464206A (en) * 2017-07-26 2017-12-12 维沃移动通信有限公司 A kind of watermark adding method and mobile terminal

Also Published As

Publication number Publication date
CN115866356A (en) 2023-03-28
CN110198492A (en) 2019-09-03

Similar Documents

Publication Publication Date Title
CN110198492B (en) Video watermark adding method, device, equipment and storage medium
JP6556818B2 (en) apparatus
US20200145692A1 (en) Video processing method and apparatus
JP2017508415A (en) Image encoding / decoding method and apparatus
CN111711824A (en) Loop filtering method, device and equipment in video coding and decoding and storage medium
CN112533059B (en) Image rendering method and device, electronic equipment and storage medium
US20150146794A1 (en) Decoding For High Efficiency Video Transcoding
US20140119456A1 (en) Encoding video into lower resolution streams
US20210112270A1 (en) Dynamic motion vector referencing for video coding
CN105432083A (en) Hybrid backward-compatible signal encoding and decoding
CN104581177A (en) Image compression method and device combining block matching with string matching
CN110430436A (en) A kind of cloud mobile video compression method, system, device and storage medium
CN105100814A (en) Methods and devices for image encoding and decoding
CN111263243B (en) Video coding method and device, computer readable medium and electronic equipment
EP2805504A1 (en) Distinct encoding and decoding of stable information and transient/stochastic information
CN107079159B (en) Method and device for parallel video decoding based on multi-core system
US12101489B2 (en) Supporting view direction based random access of bitstream
CN111182310A (en) Video processing method and device, computer readable medium and electronic equipment
CN114375577B (en) Video coding and decoding method and device
CN106028031A (en) Video coding device, video coding method, video decoding device and video decoding method
US11290735B1 (en) Visual element encoding parameter tuning
WO2020255771A1 (en) Image processing device and method
JP2015076765A (en) Image processing device, control method thereof, and computer program
US11350134B2 (en) Encoding apparatus, image interpolating apparatus and encoding program
CN111970508A (en) Video encoding method, video encoding device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant