Search code examples
ffmpegvideo-streamingmoodlevideo.js

Dynamic watermark on Moodle videos


I am a novice moodle administrator and, in addition, they ask me for things that I think are out of the ordinary. My users need their videos to have a dynamic watermark to prevent piracy.

I have evaluated some options, such as VDO Cipher, but they seem too expensive for a training that is offered almost free of charge.

Can you advise me something else? In addition to being an administrator, I am an application architect and maybe I could do a custom development, maybe using fmpeg or similar.

What do you recommend?


Solution

  • You can try this

    ffmpeg -i video.mp4 -vf "drawtext=text='Text':x=w-mod(max(t\,0)*(w+tw)/10\,(w+tw)):y=h-text_h:fontsize=24:fontcolor=black:box=1:[email protected]:boxborderw=5" -c:a copy -y output.mp4
    

    This will create a text that will scroll horizontally, for the duration of the video

    "drawtext=text='Text' Change the "Text" here to match what you want

    x=w-mod(max(t\,0)*(w+tw)/10\,(w+tw)) makes the text run across the screen in 10 seconds.

    y=h-text_h positions the text at the bottom of the video

    black:box=1:[email protected]: boxborderw=5 creates a frame around the text to make it more visible, but you can remove it

    Note that you can use a font file of your choice by adding the "fontfile" option in the filter