Bonum Certa Men Certa

Adding, Seaming Together, Merging, or Concatenating Videos From the Command Line With FFMPEG (Scripting for Streamlining of Workflows)

Video download link



Summary: In order to enrich the looks of videos with almost no extra time/effort (all scripted, no GUIs should be needed) use ffmpeg with the concat operator; but there are several big gotchas, namely lack of sound and need for consistency across formats/codecs and even sampling rates

TODAY we focused on some site 'logistics' and especially dealt with video and sound. The goal is to automate some tasks and/or improve the presentation of multimedia using Free software. Free as in freedom...



Frankly, the tool we used to generate some video segments was an "online" thing called Canva (never heard of it before, but it seems powerful enough and doesn't require downloading anything, logging in etc. -- not even an E-mail address). On the face of it, problem solved! But no... it gets trickier from then on. I spent many hours working around barriers.

Well, ffmpeg is very powerful and extremely versatile. However, as it turns out, ffmpeg will first need to convert .mp4 files downloaded from there (Canva) so as to incorporate sound, even if it's just mute (inaudible sound track).

For this reason and for that purpose, as per people who had similar issues concatenation tracks that lack sound (merged or combined with some that do have sound), run a command as follows (depending on the sampling rate, 48000 in my case, or else the sound/pitch will be funny).

ffmpeg -i "file.mp4" -f lavfi -i anullsrc=cl=mono:r=48000 -shortest -y "file-new.mp4"

Assuming you now have a track that is compatible with what you'd merge it with, ensure that the original is moreover re-encoded for it to be applied consistently. As I always record as WebM, I need to then run (for a video like the above):

ffmpeg -i video-ffmpeg-concat.webm -c:v libx264 -preset slow video-ffmpeg-concat.mp4

This yields something suitable as it must be strictly compatible in sampling, codec type, and other factors. That's a limitation in ffmpeg. This is a common issue for a lot of people and it took me hours to overcome (many trials and errors). I wished to document this as other people too got stuck (many forum posts).

Depending on which files you wish to concatenate with (and the order), write down the 'recipe', e.g. recipe.txt, containing

file file-new.mp4
file testing-6.mp4
file outro-new.mp4


Relative paths too can be prepended (e.g. file Videos/outro-new.mp4). The ffmpeg documentation explains the syntax better. There's a lot more about concat [1, 2].

Then run everything as follows:

ffmpeg -f concat -i recipe.txt output.webm

The reason the assembly of files is done with .mp4 files (to yield a WebM) is the insistence of Canva that downloaded videos are either MP4 or GIF. There must be some better ways and I'll improve this over time (this is all still very fresh in the mind; I've spent a lot of time on this).

From now on we have the ability to make videos that are 1) smaller in size because of re-encoding with strong compression and 2) have a little bit of extra context. We'll improve this over time and push to git.

Update: This is what the outcome can look like (mind start and end of clip).

Video download link

Recent Techrights' Posts

The Old Days
In the early days of this site (2006) it was mostly just a couple of people, plus comments
Links 28/03/2026: Microsoft's LinkedIn a National Security Risk, Microsoft's Slop "Ambitions Face Investor Scrutiny Amid Soaring Costs"
Links for the day
 
LLM Slop Kills Sites, as Sites That Adopt Slop Are Doomed
People won't subscribe to such sites and visit them if they recognise it's just slop
Links 29/03/2026: Indonesia Cracks Down on Social Control Media Addiction, China Becomes World’s Scientific Superpower
Links for the day
Fedora at the Mercy of Microsoft Because of Back-Doored Kick-Switch Boot
We'll soon revisit the defamation attacks on Torvalds
Links 29/03/2026: Water Shortages and No Kings Rallies
Links for the day
Gemini Links 29/03/2026: Return to Gopherspace, "Zen of Marking Playing Cards"
Links for the day
The Real XBox is Dead, So Microsoft is Calling Everything "XBox" Now
It even wanted to run a campaign to convince everybody that XBox is not actually a console
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, March 28, 2026
IRC logs for Saturday, March 28, 2026
Open Web Destroyed by Centibillionaires, Says Anil Dash of Blogging Fame
Blogging was going through its 'prime years' about 20 years ago
"Linux" Slop Going Away, Microsoft et al Pay 'Linux' Foundation to Promote Slop
It's a timely reminder that the Linux Foundation exists to promote whoever pays the Linux Foundation, even pedophiles and companies that attack the GPL
Gemini Links 28/03/2026: "Finding My Base Tone", "Astrobotany", and BugoutBack/OFFLFIRSOCH
Links for the day
Links 28/03/2026: More Worldwide Bans on Social Control Media (Harms to Adolescents), Protests in US Against Dictatorship
Links for the day
SLAPP Censorship - Part 26 Out of 200: Asking for Documents and Information You Already Have, Even Letters and E-mails That You Yourself Sent!
barristers are expensive
Gemini Links 28/03/2026: Echo Delay and 0x0.st
Links for the day
Rumours of More IBM Mass Layoffs at Beginning of April
IBM is not doing well
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, March 27, 2026
IRC logs for Friday, March 27, 2026
"Headcount" as Distraction From Mass Layoffs and Salary Reductions
Things aren't looking well when one considers revenue is acquired, not earned
"Linux" Slop Turning Rarer, New York Times Nowadays Contaminated With LLM Slop
Another day has passed without much slop about "linux"
Links 27/03/2026: Studying Whale Births, Apple is Cancelling Products, Cambodia Arrests Journalists Over Photographs
Links for the day
Gemini Links 27/03/2026: GTD, Gopher Catchup, Gemini Crawlers, and "Slop Everywhere"
Links for the day
Mozilla Was Ruined Like Sirius Open Source Was Ruined - From the Top Down
Mozilla will never return to its Free software roots
Nokia Could Never Recover From Microsoft
It's very important to remember what really happened
Why Techrights and Many Other Sites Stopped Doing April Fools’ Day Articles
Well before slop (made by LLMs) it was "bad optics" to have satire or humour in a site, irrespective of the day of the year
President Not-Cocaine Campinos Notified of Historic EPO Strikes (Thousands of Workers Not Coming Back to the Office)
Please do pay attention to how the media treats these strikes in Europe's second-largest institution
Slides From the Presentation Discussing EPO Strikes Until End of June or Until End of 2026 (Maybe Next Year Too)
More to come soon (later today)
IBM Cuts Are Everywhere (Global), the Aim is to Lower the Pay
Because the revenues keep falling (IBM buys other companies' revenues using borrowed money)
Perpetual Strikes to Begin at European Patent Office (EPO), Large Majority Votes for Strikes Any Day of the Week
Approved industrial actions [...] Notice how none of the media or even so-called 'IP' blogs write about it
Mozilla is Not a Privacy Company, Mozilla is Run by GAFAM Executives and Managers Who Came From American Surveillance Companies
Would you trust a VPN they claim to be "free"?
SLAPP Censorship - Part 25 Out of 200: That Time Matthew J. Garrett Got Temporarily Banned/Suspended From Twitter
That he gets banned from large social control media platform is hardly surprising given his combative communications
Ubuntu Started as Free With ShipIt, Now It Becomes Payware That Exploits Debian Volunteers (Slaves)
"Ubuntu" the distro now replaces the GNU components inherited from Debian with a bunch of Microsoft GitHub (proprietary) things that reject reciprocal licences
Last Night The Register MS Published a Fake Article. It Mentioned "AI" 27 Times.
Paid-for nonsense! [...] What's left of once-respectable news sites actively harms society
Links 27/03/2026: Google Executive (GAFAM, US, Surveillance) "Named the New BBC Head", Prominent Climate Scientist Resigns From NASA
Links for the day
Gemini Links 27/03/2026: "Being Busy" and "Posting Again"
Links for the day
GNOME Has No "Real" Executive Director, Only an IBM (Perma)'Interim' One With No Openings in Sight
GNOME is having financial problems
Microsoft Experiencing "Leadership Exodus"
Microsoft's current position is no better than Meta's (Facebook)
GNU/Linux Distros Should Reject "Age Verification" and Uphold Software Freedom for Users
It's not about protecting children
Slop Plunge
we can already "smell the blood" of the so-called 'AI industry'
IBM Media Puff Pieces While Layoffs Go On and On
Has the PR industry absorbed the press?
Media Says Microsoft Hiring Freezes, But There Are Already Microsoft Layoffs
They want the public to talk about Microsoft as if it's just not hiring when it is actually firing
Richard Stallman lynchings: Sruthi Chandran splitting Debian
Reprinted with permission from Daniel Pocock
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, March 26, 2026
IRC logs for Thursday, March 26, 2026