Question
How do I preprocess the content for watermarking using DoveRunner FFmpeg plugin?
Answer & Resolution
To preprocess your video for applying forensic watermarking, you must generate two watermarked versions of the content : one with symbol = 0 and another with symbol = 1. These files are later used for dynamic, session-based watermark insertion during playback.
Use the following FFmpeg preprocessing command:
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./lib ./ffmpeg -y \
-i input.mp4 \
-filter_complex "[0:v]split=2[in0][in1]; \
[in0]doverunnerwm=wm_key_base64=<BASE64_KEY>:access_key=<ACCESS_KEY>:symbol=0[wm0]; \
[in1]doverunnerwm=wm_key_base64=<BASE64_KEY>:access_key=<ACCESS_KEY>:symbol=1[wm1]" \
-map "[wm0]" -map 0:a -c:v <encoder> -g <gop_value> -c:a copy output_wm_0.mp4 \
-map "[wm1]" -map 0:a -c:v <encoder> -g <gop_value> -c:a copy output_wm_1.mp4
Points to remember :
-
You must preprocess each resolution separately (1080p, 720p, 480p, etc.). Two output files are created per resolution:
output_wm_0.mp4 (symbol 0)
output_wm_1.mp4 (symbol 1)
-
Choose an appropriate encoder based on your environment:
libx264, libx265, or h264_nvenc (for NVIDIA GPUs)
-
Set the GOP value according to your source FPS:
24 fps → 48
25 fps → 50
30 fps → 60
48 fps → 96
50 fps → 100
60 fps → 120
Encoder-Specific GOP Examples
libx264: -g 60 -x264-params keyint=60:min-keyint=60:scenecut=0:open-gop=0
libx265: -g 60 -x265-params keyint=60:min-keyint=60:scenecut=0:open-gop=0
h264_nvenc / hevc_nvenc: -g 60 -no-scenecut 1 -strict_gop 1
Note
This preprocessing is a one-time process and is required to be done before packaging or streaming.