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

GNU/Linux Has Become More Mainstream in the United Kingdom
It's a long weekend here and we guess some people dabble in GNU/Linux migrations, at least at home
 
Links 30/08/2026: Soldiers in Niger Attack Presidential Palace and Airport, Nepali City Struggles to Handle the Many Dead Bodies
Links for the day
Clownflare Sees GNU/Linux Rising to 11% This Past Week
Is it the year of "Linux in China"?
Links 30/08/2026: Russian Strike on a Ukrainian Warehouse and Rhetoric Escalations
Links for the day
Gemini Links 30/08/2026: Photography, Paper Books, Linux Kernel and the Debian Projects Permitting Slop Plagiarism
Links for the day
Imagine a World Where Nobody Fights for Software (and Computing) Freedom
The community keeps fighting back, so some of these ambitions are delayed or watered down
FSF Has Grown (More Staff) After a Year of Financial Growth
On October 4 the FSF turns 41
SLAPP Censorship - Part 166 Out of 200: Garrett Wasn't Found Innocent Per Se, the Court Wanted More Evidence of Who Was Behind Particular Accounts Using Tor
It's complicated
Criminals Don't Obey Laws, California Does Not Enhance Online Safety
It has been a while since we last mentioned so-called 'age-verification' laws
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, August 29, 2026
IRC logs for Saturday, August 29, 2026
Links 29/08/2026: Stop the Hate, Goldfish Myths, and xmpp.nz
Links for the day
Links 29/08/2026: Wave of Social Control Media Bans, Suno Data Breach Class Actions
Links for the day
Links 29/08/2026: Microsoft GitHub Outage (Again), "Displaying Ads Directly on Your Monitor", and "Election Deniers Could Soon Control Elections"
Links for the day
IBM is "Taking the PIP" (Piss), People 'Retire' 'Voluntarily' to "Focus on Family"
IBM has a billion bucks for 'the butcher', but not a million dollars for critical projects and initiatives in Free software
It Should be Uncontroversial to Say That Social Control Media is a Weapon
Democracy is not compatible with the likes of Kapo-Berg and MElon controlling public discourse of billions
Misuse of Bots (Now Sold as "Agents", "Hey Hi", "Automation", and "Efficiency")
They even try to rebrand robotics as "hey hi" and try to sell slop as "work"
Debian: Plagiarism OK, Just be "Responsible" About It
The result isn't the worst, but it's not good either
Don't Let Them Kill Activism
Are the oligarchs shutting the lid on activism and whistleblowers?
SLAPP Censorship - Part 165 Out of 200: Two Years Since My Wife and I Sued
In early September 2024 we hit back
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, August 28, 2026
IRC logs for Friday, August 28, 2026
Gemini Links 29/08/2026: Death Notice, Systems Biology, and Gopher
Links for the day
Links 28/08/2026: Chatbot Pushers Admit They're Used Heavily for Social Engineering Scams, Strong Backlash Against "Smart Glasses" (CCTV on Legs)
Links for the day
Michael Catanzaro's Latest Blog Post Affirms Rumours of Red Hat Changes and RAs/PIPs at IBM
reading between the lines, IBM is "spitting out" Red Hat staff
If Linux Was Written in Rust, 80% or More of Linux Developers Would Not Understand It (Same If It's Composed by LLM Slop)
The licence (GPL) is not enough when there are ways to bypass it
Gemini Links 28/08/2026: Absurd Tomodachi Summer, Screen Piggery, and Jugulans 1.0.3 Released
Links for the day
Links 28/08/2026: "UK Power Grid Has a Phantom Data Center Problem" and "Growth at All Costs is Cancer"
Links for the day
SLAPP Censorship - Part 164 Out of 200: Patent Troll SLAPPs, Defamation Trolls, and Stranglers From America
You start to wonder if the core issue is insecurity
Rumours of More PIPs and Layoffs at Confluent Just Months After IBM Bought It
It is meanwhile apparent IBM will have mass layoffs next week (September)
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, August 27, 2026
IRC logs for Thursday, August 27, 2026
After Many Waves of PIPs (Silent Layoffs) IBM Makes Non-Silent Layoffs, Effective Next Week (September)
What we heard is turning out to be true