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

Intercontinental Brigading - Part XIV - Six Years of Learning Irish, But the Real Issue Was Microsoft-controlled 'Secure' (Restricted) Boot
Had I not opposed back doors in Linux, not of this would come about
Microsoft Sort of Tried to Sell XBox Piecewise (Offloading Microsoft)
XBox is in a morbid state
 
Links 25/10/2026: TMZ Revisits Epstein's Connections to Bill Epsteingate, "Italy Hit by New Cost of Living Protests"
Links for the day
Microsoft’s Spin About Mass Layoffs and Shutdowns: They "Never Should Have Existed"
Microsoft-sponsored spin
It's Slop
Maybe we'll exclude It's Slop from our curation. It's a Linux Foundation outpost of sorts, an apologist of sloppy code and plagiarism.
Gemini Links 25/10/2026: Moana (2026) and OpenBSD Updates
Links for the day
The Netherlands Fast to Adopt GNU/Linux, "Market Share" Rises to Two-Digit Value (on Desktops/Laptops)
It peaked at around 20% yesterday
DST Still Needs to Get Abolished
Get rid of DST, efficiency will improve and systems will become more reliable
PHP2Shell as Paid-for FUD Campaign (Intended to Help Sell Slop and Fake "Market Value" of Slop Pushers)
PHP2Shell considered overhyped [...] Remember all the paid-for hype regarding Mythos? What happened to all that?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, October 24, 2026
IRC logs for Saturday, October 24, 2026
Gemini Links 24/10/2026: Arch Linux Journey and Amin Bandali's Priorities
Links for the day
Bluewashing as a Form of Silent Layoffs
IBM will continue to shed off loads of workers while its debt climbs
Turning 20 in 2 Weeks and Upcoming Network Maintenance
That ought not interrupt our anniversary
Microsoft Shutdowns Accelerating, More Shutdowns Revealed (Not Connected to Gaming)
Silent layoffs disguised as "voluntary" "exits"
Links 24/10/2026: Microsoft Blackmail and Lingering Unrest in France:
Links for the day
Gemini Links 24/10/2026: From Bendigo to Kerang, Enshittification of Radio and Music in the UK
Links for the day
Red Hat Sinks With the Blue (IBM) Ship
As IBM's debt continues to soar so do the silent layoffs
Linux is Not Controlled by Linus (Torvalds)
Torvalds has become "90% marketing hype"
The "No Pain No Gain" Expectations in Publishing
Sometimes truth hurts; but that does not mean it mustn't be told
Intercontinental Brigading - Part XIII - Censorship by All Means Available in a Continent So Far Away, as 'Secure' (Restricted, Restriction by Microsoft) Boot Has a Crisis of Legitimacy
it's about America controlling sites and computers everywhere
Links 24/10/2026: Oligarchs Already Buy US Elections, GAFAM Front Group "EFF" Speaks of "Vulnerability Apocalypse"
Links for the day
Gemini Links 24/10/2026: Automobile Differential Tire Movement, Samsung Washer Woe, and Slop Scraping
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, October 23, 2026
IRC logs for Friday, October 23, 2026
As Usual, Late on a Friday XBox (Microsoft) Releases Evidence of Its Demise
We covered several such Friday announcements earlier this year
Gemini Links 24/10/2026: Break/Fix and OpenStreetMap
Links for the day
Links 23/10/2026: Slop "is Scaling Transnational Repression" and Infringement and DMCA Suits Against Suno/Anthropic (Plagiarism Blenders)
Links for the day
More Shutdowns at Microsoft, Hundreds of Workers Impacted Shortly
It's not the entire wave, just part of it
The Register MS: About 60 Mentions of "AI" in One Day Are Paid-for Spam (Sponsored Hype, Composed by the Companies Covered)
The Register MS is a dying site
Links 22/10/2026: MElon (Elon Musk) Election Interference and Perl/Raku Foundation by the Numbers
Links for the day
Techrights Audience Grew as a Function of the Intensity of Attacks on Its Existence
We try to publish fewer stories but better (not necessarily long but at least important) stories
TechRepublic is Becoming a Slopfarm
It seems like TechRepublic became LLM slop (maybe all of it, maybe only some of it for now)
Techrights is Not About GNU/Linux, Tux Machines Is
When we say "GNU/Linux" we emphasise the GNU
The World Needs Activists With Social Skills and Perseverance
An everyday activist makes life better for everybody, everywhere (not for personal gain or even credit)
Intercontinental Brigading - Part XII - Lawfare to Cover Up Microsoft's Restricted Boot Calamity (Microsoft as Authority Over Linux), Garrett Wants to Talk About Penises Instead
When lawsuits become a political weapon
Without Microsoft's Monopoly (and Monopoly Rents) the Inevitable Microsoft Mass Layoffs Carry on Endlessly
Microsoft Windows is not retaining the dominance it once had
IBM's Debt Grew About $2 Billion in 3 Months
The silent layoffs still seem to impact Red Hat
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, October 22, 2026
IRC logs for Thursday, October 22, 2026