CN112333558B - Video file watermarking method - Google Patents
Video file watermarking method Download PDFInfo
- Publication number
- CN112333558B CN112333558B CN202011160289.5A CN202011160289A CN112333558B CN 112333558 B CN112333558 B CN 112333558B CN 202011160289 A CN202011160289 A CN 202011160289A CN 112333558 B CN112333558 B CN 112333558B
- Authority
- CN
- China
- Prior art keywords
- video
- video file
- container
- server
- client
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/835—Generation of protective data, e.g. certificates
- H04N21/8358—Generation of protective data, e.g. certificates involving watermark
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/232—Content retrieval operation locally within server, e.g. reading video streams from disk arrays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/258—Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
- H04N21/25866—Management of end-user data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8455—Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer Graphics (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
The invention relates to a watermark processing method of a video file, which comprises the following steps: step 1, the server stores the user information of the connected client in a Session; step 2, the client sends video file viewing request information to the server; step 3, the server sends the link of the video file to the client; step 4, the client establishes and loads the Video container and the Canvas container in sequence; and 5, monitoring a play button and a pause button of the Video file by the client, reading the content of the Video container through the Canvas container after the play button of the Video file is triggered, and drawing the Video content of the read Video container and preset watermark information on a Canvas curtain after a set time till the Video file is paused or played. The invention can dynamically add the watermark when looking up the video evidence, can not cause redundant storage space consumption, and ensures the authenticity of the video evidence while ensuring the efficiency.
Description
Technical Field
The invention relates to a watermark processing method, in particular to a watermark processing method of a video file.
Background
In order to ensure the rigor and security of the video evidence, a user generally uploads a video file to a server, and the video file is saved while a path for other users to view the video file is provided. When other users check the video, the video is bound to be watermarked for the safety and rigor of the video, if a traditional watermarking mode is used, a source file needs to be reserved, meanwhile, server resources need to be called, watermarking processing is carried out on the file, and different users also need different watermarks. If 100 different users need to retrieve videos, the server needs to perform 100 times of watermarking processing on the videos sequentially, so that the processing at high frequency inevitably increases the pressure of the server, meanwhile, the watermarking videos also increase the storage space, and the server crashes over time.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide a video file watermarking method, which can dynamically add watermarks when looking up video evidence, cannot cause redundant storage space consumption, ensures the efficiency and also ensures the authenticity of the video evidence.
According to the technical scheme provided by the invention, the watermarking method of the video file comprises a server for storing the video file and a plurality of clients which can be connected with the server; the watermark processing method comprises the following steps:
step 1, a client sends a connection request to a server, and after the client is connected to the server, the server stores user information of the connected client in a Session;
step 2, the client selects a video file to be inquired and sends video file viewing request information to the server;
step 3, the server inquires a storage address of a corresponding video file in a database in the server according to the video file viewing request information, and sends a link of the video file to the client;
step 4, after receiving the link of the Video file, the client creates and sequentially loads a Video container and a Canvas container, so that the content of the Video file is loaded through the Video container, and a Canvas curtain is loaded through the Canvas container;
and 5, monitoring a play button and a pause button of the Video file by the client, reading the content of the Video container through the Canvas container after the play button of the Video file is triggered, and drawing the Video content of the read Video container and preset watermark information on the Canvas curtain after a set time till the Video file is paused or played.
In step 1, the user information stored in the Session includes a user name, a login account, a department authority and/or a post authority.
In step 2, the video file viewing request information contains a unique mark of the video file; in step 3, the server queries a database according to the unique mark of the video file to obtain a storage address corresponding to the video file.
The client displays the video file in an HTML5 language mode; in step 5, setting the time to be 20ms, drawing the read Video content of the Video container on a Canvas curtain to obtain a Video content layer, and drawing preset watermark information on the Video content layer.
The invention has the advantages that: user information watermarks can be dynamically generated according to actual requirements; the video source file (MD5 value) is not changed after the watermarking, and the authenticity and uniqueness of the video are ensured. No other file is generated, the occupied storage space is unchanged, and the storage is advantageous; the result is equivalent to watermarking the source video file, but much faster; supporting cross-platform and being capable of being used under different operating systems. Video addresses cannot be exposed, and the safety of videos is guaranteed.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The invention is further illustrated by the following specific figures and examples.
As shown in fig. 1: in order to dynamically add watermarks when looking up video evidences, avoid redundant storage space consumption, ensure the efficiency and the authenticity of the video evidences, the invention comprises a server for storing video files and a plurality of clients which can be connected with the server; the watermark processing method comprises the following steps:
step 1, a client sends a connection request to a server, and after the client is connected to the server, the server stores user information of the connected client in a Session;
specifically, the video file is stored in a server, the server can be connected to one or more clients, and the specific matching form between the client and the server is consistent with that of the prior art, which is well known to those skilled in the art and is not described herein again.
In the embodiment of the invention, the user information stored in the Session comprises a user name, a login account, a department mechanism and/or a post authority. In computers, and in particular in network applications, sessions are referred to as "Session control". The Session object stores the attributes and configuration information needed for a particular user Session. Thus, when a user jumps between pages of an application, the variables stored in the Session object will not be lost, but will persist throughout the user Session. When a user requests a web page from an application, the server will automatically create a Session object if the user has not already a Session. When a session expires or is abandoned, the server will terminate the session. One of the most common uses of Session objects is to store user preferences. In specific implementation, after the user information is stored in the Session, when the user views the video, a system log can be formed according to the information recorded by the Session, and the system log is subjected to trace processing and stored; in addition, the watermark content generated subsequently can be the user name in the Session, so that if the divulgence occurs, the responsibility can be traced according to the watermark of the divulged video.
Step 2, the client selects a video file to be inquired and sends video file viewing request information to the server;
in the embodiment of the present invention, the client uses HTML5 to construct a web network, after the client is connected to the server, the client can select a video file to be queried, and both the manner and the process for specifically acquiring and selecting a queried video file may use conventional manners, which are well known to those skilled in the art and will not be described herein again. The video file viewing request information contains the unique mark of the video file, so that the server can quickly and accurately search the video file selected by the client according to the unique mark of the video file.
Step 3, the server inquires a storage address of a corresponding video file in a database in the server according to the video file viewing request information, and sends a link of the video file to the client;
in the embodiment of the invention, the server queries the database according to the unique mark of the video file to obtain the storage address corresponding to the video file.
Specifically, when the server manages the video file, a table is provided in the server to record some basic information such as a path, a video name and the like of the video storage, a UUID of a primary key of the table (the UUID is a number generated on one machine and is guaranteed to be unique to all machines in the same space-time) is unique, that is, a unique mark, and the storage position of the video can be found in the table according to the unique mark.
Primary keys are candidate keys that are chosen to uniquely identify rows of the table. A table has only one primary key. The primary key, which may also be referred to as a primary key, has a value that is used to uniquely identify a record in a table.
Step 4, after receiving the link of the Video file, the client creates and sequentially loads a Video container and a Canvas container, so that the content of the Video file is loaded through the Video container, and a Canvas curtain is loaded through the Canvas container;
in the embodiment of the present invention, when an HTML5 mode is adopted in the client, the Video container (Video container) and the Canvas container are both self-contained and commonly used technical features in HTML5, and the Video container and Canvas container loading process is a conventional operation, that is, by creating a Video tag and a Canvas tag, which are well known to those skilled in the art, and are not described herein again.
JavaScript ("JS") is a lightweight, interpreted or just-in-time high-level programming language with function precedence. Although it is named as a scripting language for developing Web pages, it is also used in many non-browser environments, JavaScript is based on prototypical programming, multi-modal dynamic scripting languages, and supports object-oriented, imperative, and declarative (e.g., functional programming) styles.
When the method is specifically implemented, the Canvas container of the HTML5 can realize a Canvas function, the method for drawing lines, arcs and rectangles, filling the area with styles and colors, writing stylized texts and adding images is provided by combining the self-contained API and using a JavaScript scripting language to draw images and process on the webpage, and each pixel of the method can be controlled by using the JavaScript. The Canvas container of HTML5 allows the browser to display graphics or animated images directly without requiring plug-ins such as Flash or Silverlight. Specifically, the Video container and the Canvas container may be created in the following manner: the mode of creating the Video label is as follows: create element ('VIDEO'); the way of creating the Canvas label is as follows: document element ('canvas').
And 5, monitoring a play button and a pause button of the Video file by the client, reading the content of the Video container through the Canvas container after the play button of the Video file is triggered, and drawing the Video content of the read Video container and preset watermark information on the Canvas curtain after a set time till the Video file is paused or played.
Specifically, in general, the viewing of a video is with a play button, which can trigger a Canvas container when a video file is viewed through the play button. After the play button is triggered, the created Video container starts to play videos, the Video container is invisible, the Canvas container can capture the current picture of the Video container, and the picture is drawn on the screen of the Canvas container in proportion, namely the content of the Video file and the content of the watermark information can be output through the Canvas container.
In the embodiment of the invention, the timing can be performed through the timer, so that the Canvas container can read the Video content of the Video container after the set time is passed. In specific implementation, the time is set to be 20ms through a timer, the read Video content of the Video container is drawn on a Canvas curtain to obtain a Video content layer, and the preset watermark information is drawn on the Video content layer. Specifically, when the set time is set to 20 milliseconds, 20ms can already cause the human persistence of vision effect, and the human vision looks like a complete continuous video and watermark effect.
In specific implementation, characters can be added, positions and transparency can be set through operation of the curtain, so that a picture with the watermark is formed, the picture is displayed, and a watermark video is formed after the picture is continuous. The text of the watermark can be set as a variable by HTML5, and different users click to view different values, so that the watermark formed is different.
When a JavaScript scripting language is adopted, the font style and size can be set in a context. The filling pattern may be set in a Context text ═ rgba (255, 0.7)' statement manner, and the watermark text may be added in a Context text (text, x, y) statement manner, where Context is a canvas, x is an x coordinate position (relative to the canvas) at which the text starts to be drawn, and y is a y coordinate position (relative to the canvas) at which the text starts to be drawn, and the manner of setting the watermark in the above manner is well known to those skilled in the art, and will not be described herein again.
Because the character drawing of the watermark is horizontal, if the watermark with an inclined pattern needs to be drawn, the curtain needs to be rotated, the curtain is rotated back after the watermark is drawn, the text (text) filled with the watermark is a variable, and before the function of generating the watermark is called, the information (user name + user number) of a login user in the Session can be transmitted into the text through parameter calling, so that the generated watermark is the user name + number of a specific user.
Through the watermarking processing process, the actions of screen recording, video recording and the like of people in the video watching process can be specifically prevented. After the video file is viewed, the file is not required to be saved, but the record can be recorded in a viewing server, so that the client can be confirmed to view the corresponding video file.
In conclusion, the invention can dynamically generate the user information watermark according to the actual requirement; the video source file (MD5 value) is not changed after the watermarking, and the authenticity and uniqueness of the video are ensured. No other file is generated, the occupied storage space is unchanged, and the storage is advantageous; the result is equivalent to watermarking the source video file, but much faster; supporting cross-platform and being capable of being used under different operating systems. Video addresses cannot be exposed, and the safety of videos is guaranteed.
Claims (4)
1. A watermark processing method for a video file comprises a server for storing the video file and a plurality of clients which can be connected with the server; the watermark processing method is characterized by comprising the following steps:
step 1, a client sends a connection request to a server, and after the client is connected to the server, the server stores user information of the connected client in a Session;
step 2, the client selects a video file to be inquired and sends video file viewing request information to the server;
step 3, the server inquires a storage address of a corresponding video file in a database in the server according to the video file viewing request information, and sends a link of the video file to the client;
step 4, after receiving the link of the Video file, the client creates and sequentially loads a Video container and a Canvas container, so that the content of the Video file is loaded through the Video container, and a Canvas curtain is loaded through the Canvas container;
and 5, monitoring a play button and a pause button of the Video file by the client, reading the content of the Video container through the Canvas container after the play button of the Video file is triggered, and drawing the Video content of the read Video container and preset watermark information on the Canvas curtain after a set time till the Video file is paused or played.
2. A method of watermarking a video file according to claim 1, wherein: in step 1, the user information stored in the Session includes a user name, a login account, a department authority and/or a post authority.
3. A method of watermarking a video file according to claim 1, wherein: in step 2, the video file viewing request information contains a unique mark of the video file; in step 3, the server queries a database according to the unique mark of the video file to obtain a storage address corresponding to the video file.
4. A method of watermarking a video file according to claim 1, wherein: the client displays the video file in an HTML5 language mode; in step 5, setting the time to be 20ms, drawing the read Video content of the Video container on a Canvas curtain to obtain a Video content layer, and drawing preset watermark information on the Video content layer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011160289.5A CN112333558B (en) | 2020-10-27 | 2020-10-27 | Video file watermarking method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011160289.5A CN112333558B (en) | 2020-10-27 | 2020-10-27 | Video file watermarking method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112333558A CN112333558A (en) | 2021-02-05 |
CN112333558B true CN112333558B (en) | 2022-06-10 |
Family
ID=74310827
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011160289.5A Active CN112333558B (en) | 2020-10-27 | 2020-10-27 | Video file watermarking method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112333558B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115002378A (en) * | 2022-06-06 | 2022-09-02 | 武汉市芯中芯科技有限公司 | IPC (Internet protocol communication) equipment playback video time watermark generation method |
CN115086763A (en) * | 2022-06-27 | 2022-09-20 | 平安银行股份有限公司 | Video playing method, device, system and medium based on canvas |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108055567A (en) * | 2017-10-25 | 2018-05-18 | 北京川上科技有限公司 | A kind of method for processing video frequency, device, terminal device and storage medium |
CN109327727A (en) * | 2018-11-20 | 2019-02-12 | 网宿科技股份有限公司 | Live streaming method for stream processing and plug-flow client in a kind of WebRTC |
CN109598667A (en) * | 2018-11-30 | 2019-04-09 | 北京金山云网络技术有限公司 | A kind of method and device for adding watermark on picture |
CN110276175A (en) * | 2019-06-27 | 2019-09-24 | 北京金山云网络技术有限公司 | Method, device, client and server for generating watermark in web page |
CN111652787A (en) * | 2020-05-29 | 2020-09-11 | 深圳市天一智联科技有限公司 | Processing method and device for adding watermark characters into picture and computer equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9426502B2 (en) * | 2011-11-11 | 2016-08-23 | Sony Interactive Entertainment America Llc | Real-time cloud-based video watermarking systems and methods |
-
2020
- 2020-10-27 CN CN202011160289.5A patent/CN112333558B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108055567A (en) * | 2017-10-25 | 2018-05-18 | 北京川上科技有限公司 | A kind of method for processing video frequency, device, terminal device and storage medium |
CN109327727A (en) * | 2018-11-20 | 2019-02-12 | 网宿科技股份有限公司 | Live streaming method for stream processing and plug-flow client in a kind of WebRTC |
CN109598667A (en) * | 2018-11-30 | 2019-04-09 | 北京金山云网络技术有限公司 | A kind of method and device for adding watermark on picture |
CN110276175A (en) * | 2019-06-27 | 2019-09-24 | 北京金山云网络技术有限公司 | Method, device, client and server for generating watermark in web page |
CN111652787A (en) * | 2020-05-29 | 2020-09-11 | 深圳市天一智联科技有限公司 | Processing method and device for adding watermark characters into picture and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112333558A (en) | 2021-02-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7920939B2 (en) | Method and system for creating and manipulating embroidery designs over a wide area network | |
US9934320B2 (en) | Method and apparatus for using proxy objects on webpage overlays to provide alternative webpage actions | |
CN108924622B (en) | Video processing method and device, storage medium and electronic device | |
CN112073794B (en) | Animation processing method, animation processing device, computer readable storage medium and computer equipment | |
CN112333558B (en) | Video file watermarking method | |
CN112256990B (en) | Image processing method and device and computer readable storage medium | |
CN110798711B (en) | Advertisement information processing method, device, computer equipment and storage medium | |
CN111581564B (en) | Webpage synchronous communication method implemented by Canvas | |
US20190230311A1 (en) | Video interface display method and apparatus | |
CN113411664B (en) | Video processing method and device based on sub-application and computer equipment | |
CN112074813A (en) | Capturing and processing interactions with user interfaces of native applications | |
US20190014063A1 (en) | System and Methods for Dynamically Generating Animated GIF Files for Delivery Via the Network | |
CN110826002A (en) | Information sharing method and device, terminal and storage medium | |
GB2610897A (en) | User interface (UI) engine for cloud UI rendering | |
CN113254822A (en) | Object editing method and device, electronic equipment and storage medium | |
CN113315982B (en) | Live broadcast method, computer storage medium and equipment | |
CN106557529B (en) | Display method and device for jump page in page jump | |
CN112765526B (en) | Page screenshot method and device, terminal equipment and medium | |
CN112287263A (en) | Webpage display method, device, system, terminal and computer readable storage medium | |
US11979645B1 (en) | Dynamic code integration within network-delivered media | |
CN112800365A (en) | Expression package processing method and device and intelligent device | |
CN116132733A (en) | Video display method and device | |
JP2020135505A (en) | Information processing equipment and programs | |
CN110457623A (en) | Acquisition methods, server and the storage medium of webpage frame | |
JP2023072949A (en) | Display control device, display control method, and program |
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 |