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

Many People Have Said That They "Leave" IBM in Recent Days (Ahead of Mass Layoffs)
So the real extent of layoffs is greater than what's publicly stated (there are silent layoffs) [...] Whatever IBM says about the scope, scale, or magnitude of the "RAs", it doesn't tell the full story
Techrights Will Contact German Media About the EPO's Substance Abuse
This scandal won't "go to waste"
Search @ Techrights: Almost There Now (Maybe an Anniversary Gift)
Just to be very clear, search would not be unprecedented at Techrights
The Rumour Was True, Mass Layoffs at IBM Today
How widespread the layoffs are (or how they're disguised, e.g. PIPs) is hard to assess
 
We Turned Down Every Settlement Offer Because Truths Aren't Determined in Bank Accounts
Without free press, there won't be free society
"All truths are easy to understand once they are discovered; the point is to discover them." -Galileo Galilei
This site is educational
Why I'm Always Proud of the Site I've Devoted My Life to
As a graffiti around the corner from our home says, "be a better person"
Standing Up or Standing for What's True But Inconvenient
Bad actors need to be called out
Media Coverage Regarding IBM is Vapourware and LLM Slop
With slop images, too
statCounter Says GNU/Linux Rose to 4% in the Russian Federation
Adoption of Vista 11 has been embarrassingly weak
Corruption is Not a Joke
we'll try to limit our use of humour to avoid misunderstandings or misinterpretations
The Slopfarm WebProNews is Overwhelming "linux" Results in Google News
Google News is slop
The Fall of IBM: What Happened?
Just like the EPO continues riding some old reputation acquired in the 1970s IBM relies on old myths like, "nobody gets fired for buying IBM."
IBM's CEO Already Has the Excuse for the Latest Wave of Mass Layoffs
Only days ago the CEO told a bunch of nonsense
Links 04/11/2025: Conflicts, Politics, and IPv6 at Home
Links for the day
Gemini Links 04/11/2025: Entering WiFi Passwords and Programming Rambles
Links for the day
Arch Linux Seems Like the New Debian
Arch users (btw!) are growing in relative and absolute share
Analytics From US Government Affirm a Trend: Microsoft's "Market Share" in Search is Falling
the data set is large
Holding Institutions Such as the EPO Accountable Through Public Information
Speaking truth to power is never easy
EPO Staff Losing Holidays, as Usual, as the Office Increases Profits by Illegally Granting Invalid Patents While Reducing Salaries
How much more can the staff endure and generally tolerate?
Free Software Does Not Always Speak for Itself, It Needs Advocates
Legal matters that relate to sharing of code will be discussed
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, November 03, 2025
IRC logs for Monday, November 03, 2025
The Register MS Continues Looking for Money in Promotion of the "AI" Ponzi Scheme
That The Register MS participates in this deceit rather than tackle/debunk it says a lot about The Register MS
IBM Layoffs in "Software", This Likely Impacts Red Hat as Well
Many people say "software" people are impacted
Escaping Proprietary Software, Not Just Escaping Microsoft
To take control of your life adopt GNU/Linux
A Lot of Fake News About Microsoft Headcount (Also: Microsoft's Debt Rose by About 24 Billion Dollars in Past 12 Months)
If you see some headline about Microsoft's CEO making claims about hirings, look away
Techrights Turns 19 in Three Days
It would be nice to meet for a chat
Akira Urushibata on How Grokipedia Fails to Work
The Grokipedia article gives the wrong character for the "Ko" on "Koan"
Links 03/11/2025: Data Breaches, Wars, and Digital Censorship
Links for the day
Gemini Links 03/11/2025: Poetry, Old Androids and Small Shells
Links for the day
Links 03/11/2025: Internet Anniversary
Links for the day
Two Years of Uptime
Reboots are seldom involuntary
Richard Stallman is Giving Another Talk in Less Than a Fortnight
in two weeks' time (13 days from now)
Windows Falls Below 20% in the UK
Many people choose to leave Windows altogether
Microsoft's Search Business Falls to Lowest Point in 2 Years, Based on statCounter
what can Microsoft sell other than shares in Microsoft?
Evidence Regarding Layoffs at Red Hat
Seems like IBM layoffs
Microsoft: Our "Goodwill" Value Grew More Than Tenfold Since 2011
Hallmark of pseudo-economics
GNU/Linux as a Boarding Pass
being mostly analogue is still feasible
Links 03/11/2025: Lack of Trust in LLMs and Windows TCO at Jaguar
Links for the day
Gemini Links 03/11/2025: Books in October and Change
Links for the day
Mozilla Firefox Won't Survive and Many Sites Don't Work With It (Compatibility Abandoned)
The Web has become monocultural
Debian is Non-Free
Devuan might be worth looking into
Slopwatch: Brian Fagioli and LinuxSecurity
This is a real problem and most certainly a big problem because when people try to find real information about security and GNU/Linux they instead read "word salads" made by bots
Four Reasons to Party With Us in Four Days, Celebrating the Four Freedoms
Today we expect to be back to a more-or-less regular publication pace
Links 03/11/2025: The "Smartphone Panopticon" and Belarus' Hybrid Attacks on EU Intensify
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, November 02, 2025
IRC logs for Sunday, November 02, 2025
Microsoft's Debt Has Skyrocketed by More Than 15 Billion Dollars in 6 Months or 8.2 Billion Dollars in the Past 3 Months Alone
The corporate media intentionally disregards - or merely turns a blind eye to - such data
Rumour: IBM Layoffs in Canada Starting Tomorrow
"RA (IBM's term for layoffs) Coming to Canada this week (Nov 3rd)"
Debunking False/Misleading Statements Made or Told to the High Court
People who try to cheat the system by gaslighting judges will end up discrediting themselves
Fear, Uncertainty, Doubt (FUD) by LLM Slop
The Web has become such a sordid mess that this FUD made by bots is what Google News deems to be "the news"
This Month's Analytics Show Vista 11 Down, GNU/Linux Up
After pulling the plug on Vista 10 we see losses - not gains - for Vista 11
Almost Fully Caught Up
The EPO series will continue very soon, maybe tomorrow or on Tuesday
Links 02/11/2025: Another Halloween Bust and MAGA Regime Says Public Universities Should No Longer Hire 'Foreign' Employees
Links for the day
The Long-Coveted Milestone of 3,200 Active Gemini Capsules
Despite being away some days last week, about 50,000 Gemini requests were served each day, on average
Five More Days Till Techrights Party
We'll have many more batches of Daily Links as we catch up with a 'backlog' of news
Links 02/11/2025: More Nuclear Escalations and "Anti-Cybercrime Laws Are Being Weaponized to Repress Journalism"
Links for the day
Gemini Links 02/11/2025: "The Pragmatic Programmer", Perl New Features and Foostats
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, November 01, 2025
IRC logs for Saturday, November 01, 2025