Skip to content
elv-lqy edited this page Aug 11, 2022 · 5 revisions

This page shows examples and documentations for the command line interface of blind-video-watermark.

Watermark by text image

Embedding

The following command watermarks a video by a text image with key 123 in parallel with 8 processes.

bvw embed -a img -wm wm.jpg -i input.mp4 -o output.mp4 -k 123 -j 8

Detailed explanation of the arguments:

bvw embed -a img \                # use `img` embedding algorithm
    -wm wm.jpg \                  # set watermark image (alpha channel not supported)
    -i input.mp4 -o output.mp4 \  # set input and output video path
    -k 123 \                      # set 123 as key
    -str 1.0 \                    # set watermarking strength (the default is 1.0)
    -j 8                          # run in parallel with 8 processes (use all logical CPU cores if not specified)

Extraction

The following command extracts watermarks as images frame by frame with key 123 into OUTPUT_FOLDER. Create OUTPUT_FOLDER if it doesn't exist.

bvw extract -a img -k 123 -i input.mp4 -o OUTPUT_FOLDER

Detailed explanation of the arguments:

bvw extract -a img \              # use `img` algorithm for extraction
    -i input.mp4 -o output \      # set input video path and output folder path
    -k 123 \                      # set 123 as key
    -str 1.0 \                    # set watermarking strength (the default is 1.0)
    -size 1080:1920               # set original video size in case of resizing for recovery (height:width)

Watermark by sequence

Embedding

The following command watermarks the sequence 2012 into the video with three keys [123, 456, 789] in parallel with 8 processes. Each number in the sequence represents the index of the key from the keys list. For example, 2012 can be interpreted as [456, 123, 456, 789].

bvw embed -a seq -wm 2012 -i input.mp4 -o output.mp4 -k 123 456 789 -j 8

Detailed explanation of the arguments:

bvw embed -a seq \                # use `seq` embedding algorithm
    -wm 2012 \                    # set sequence as watermark 
    -i input.mp4 -o output.mp4 \  # set input and output video path
    -k 123 456 789 \              # set [123, 456, 789] as keys (please ensure the number of keys work for the sequence)
    -str 1.0 \                    # set watermarking strength (the default is 1.0)
    -l 1 \                        # set length of each segment in sec (the default is 1)
    -j 8                          # run in parallel with 8 processes (use all logical CPU cores if not specified)

Extraction

The following command extracts a sequence(watermark) with key [123, 456, 789] from the video and write the sequence into OUTPUT_FILE.

bvw extract -a seq -i input.mp4 -o OUTPUT_FILE -k 123 456 789

Detailed explanation of the arguments:

bvw extract -a seq \              # use `seq` algorithm for extraction
    -i input.mp4 -o output \      # set input video path and output folder path
    -k 123 456 789 \              # set [123, 456, 789] as keys (not providing all keys leads to incorrect sequence upon extraction)
    -str 1.0 \                    # set watermarking strength (the default is 1.0)
    -l 1 \                        # set length of each segment in sec (the default is 1)
    -size 1080:1920 \             # set original video size in case of resizing for recovery (height:width)
    -j 8                          # Use 8 processes

Table of Contents

Clone this wiki locally