Bonum Certa Men Certa

Self-Hosting Videos With Free Formats and Animated Previews, Watermarks/Logos and Translucency

Summary: We examine the power of video editing with ffmpeg, chained with command-line scripting and HTML5 features

The Web is a powerful platform -- to the point where it's a little 'too' powerful if put in the hands of malicious actors. But we're still using the Web by default; it's just what most people use. Video functionality on the Web improved a lot over the years, putting aside DRM/EME. So let's explore what we can accomplish with some command-line scripting and ffmpeg.



We're always trying to encourage digital autonomy, which is why we adopt self-hosting whenever possible. This includes videos. For the sake of example, in this post we use an old video about Gemini proxies. It was picked at random, no special reason at all. None.

Extracting bits of the video with ffmpeg isn't hard (check the official ffmpeg Web site; their documentation explains the pertinent options, which should be changed depending on the video):

ffmpeg -ss 600 -t 5 -i gemini-proxies.webm -vf "select=not(mod(n\,1)),fps=10,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 roy-talks.gif

This gets us started:



To add the resultant preview (known as "poster") to the video, consider using the following, based on the above example: poster="http://techrights.org/wp-content/uploads/2021/04/roy-talks.gif"

This attribute belongs in the <video> element as it is part of the standard.

Add the watermark/logo with ffmpeg:

ffmpeg -i roy-talks.gif -i mogz-video-poster-4-small.png -filter_complex "overlay=0:H-h--1" -codec:a copy roy-talks2.gif

We use artwork prepared by Mogz for us.

These two passes may be lossy and maybe possible to combine rather easily, but splitting it into two stages aids simplicity. Here it goes:



For center: overlay=(W-w)/2:(H-h)/2 Top left (with 5 pixels of padding): overlay=5:5 Top right: overlay=W-w-5:5 Bottom right: overlay=W-w-5:H-h-5 Bottom left: overlay=5:H-h-5

With improved quality and translucency:

ffmpeg -i roy-talks.gif -i mogz-video-poster-4-small.png -filter_complex "[1]format=rgba,colorchannelmixer=aa=0.7[logo];[0][logo]overlay=0:H-h--1:format=auto" -codec:a copy roy-talks2.gif



The above scripts are possible to chain together and variables can be used, too. Let's change the time to one minute from the start (-ss 60) for a duration of 2 seconds (-t 2):

VIDEO_FILE='gemini-proxies' ffmpeg -ss 60 -t 2 -i $VIDEO_FILE.webm -vf "select=not(mod(n\,1)),fps=10,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 intermediate.gif ffmpeg -i intermediate.gif -i mogz-video-poster-4-small.png -filter_complex "[1]format=rgba,colorchannelmixer=aa=0.7[logo];[0][logo]overlay=0:H-h--1:format=auto" -codec:a copy $VIDEO_FILE.gif

Of course it is also possible to use loops and batch-process many files in this way. Welcome to the power of GNU/Linux.



Voila. The translucency is easier to see because of the mug of coffee.

Recent Techrights' Posts

The End of FOSSPost (fosspost.org), It Has become an LLM Slopfarm Like FOSSLinux
These sites will never get lucky with slop. These experiments always end badly.
 
European Patent Office (EPO) Strikes Persist, EPO Management Tries to Give False Impression of "Happy Staff"
EPO is trying to broadcast to the world a totally phony image of itself
Gemini Links 23/05/2026: Patience, LLM Chatbts Being Bad, and Unexpected Computer Surgery
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, May 22, 2026
IRC logs for Friday, May 22, 2026
Links 22/05/2026: Ebola Crisis and Samsung Averts a Walkout With Big Bonuses
Links for the day
Links 22/05/2026: Inflation Fears and Thailand Tightens Visa Rules for Tourists From Dozens of Nations
Links for the day
EPO Staff Representation Speaks of This Week's Discussion With the EPO's Budget and Finance Committee (BFC) Amid Mass Strikes
The Central Staff Committee's outline (prepared in a rush) or the "flash report"
SLAPP Censorship - Part 84 Out of 200: New Legislation Against SLAPPs on the Way (After We Reached Out to Ministers)
They dealt with the matter individually too, but we won't share this in public, at least not at this time
The Corrupt Lecture the Non-Corrupt - Part XXX - Where Was "The Ethics and Compliance Team" When the Family of EPO President Campinos Was Caught Doing Cocaine?
It remains to be seen if national delegates will tolerate this in future meetings
Gemini Links 22/05/2026: Esperanto Music History, Suspicious Adoption of Signal, and Unauthorised LLM Slop in Code
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, May 21, 2026
IRC logs for Thursday, May 21, 2026
Links 21/05/2026: "Declining America" and Why Slop 'Code' is Made to Fail
Links for the day
Techrights and Tux Machines Subjected to Cyberattacks for Several Weeks
In the past I spoke to the cybercrime unit of British Police. Maybe it's time to do so again.
The Register MS Has Become a 'Content' Farm Promoting Slop for Hostile Corporations
Now they call it "PARTNER CONTENT" - not "SPONSORED" - as if semantics make the difference
Latest Example of Widespread Fake Assertions (False News) About "Hey Hi"
The false narrative of "Hey Hi layoffs"
Links 21/05/2026: Facebook Rewarded With Tax Breaks to Destroy the Environment and Cause Global Warming, Shortages, Pollution; SpaceX (SPCX) Continues Losing Billions of Dollars
Links for the day
Codecs and Software Patents - Part VIII - GNU Audio/Video Team Has Chosen the AV1 Video Codec and It Explains Why (They've Researched Their Options)
AV1 video codec will be used to encode and share GNU videos online
Dr. Stallman Helps Establish Free Software Advocacy Outside the Free Software Foundation (FSF) as Well
The ideals or principles of Free Software needn't be centralised or monopolised; they can be federated
22 Years of Tux Machines and a Community Stronger Than Ever Before
We've already received some feedback from the community and improved it accordingly
Microsoft Under Investigation for Breaches of Law in the UK
Just like the Microsofters
More Microsoft Layoffs on the Way (June and July 2026)
with or without PIPs
LWN Sponsored by the Linux Foundation (Monopolies)
We must be able to casually point this out
The Corrupt Lecture the Non-Corrupt - Part XXIX - European Patent Office (EPO) Tells Staff "Speaking up" is Good, But Not When the "Brother-in-law" of EPO's President Does Cocaine
Do we still have a functioning democracy and potent press?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, May 20, 2026
IRC logs for Wednesday, May 20, 2026
Gemini Links 21/05/2026: Immigration, Slop, and Slop 'Code' Suggestions Infesting Code Repositories
Links for the dayGemini Links 21/05/2026: Immigration, Slop, and Slop 'Code' Suggestions Infesting Code Repositories