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

Hopping From One Set of Buzzwords to the Next
Rotating hype and vapourware
Currys PCWorld Hates GNU/Linux Even Though It Runs the World
If more and more people choose to remove Windows, then Currys PCWorld will feel the financial impact of its dumb policies
The Register MS Takes More Money to Boost Slop Hype, This Time From Snyk, a Notorious FUD Source
At some stage or at some point they might even decide to stop doing so
"AI" Hype or LLM Slop is Not About Efficiency, It's About Lowering Standards
It does not seem like IBM is genuinely committed to the same goals (or commitments) as the original Red Hat
If Free/Libre Software is Adding Trillions in Value to the European Economy, Then the European Commission Must Crush Software Patents
Further to what we wrote yesterday
 
Links 14/08/2025: Data Brokers Hiding Opt-Out Pages From Google, "Fight Chat Control"
Links for the day
FSF Infrastructure Under Constant Attack
The disconnect (literally) has had an effect on credibility
Feels Like The Register MS is Trying to Diversify a Bit
If The Register MS goes back to being The Register US (or UK), that will be a nice improvement
Gemini Links 14/08/2025: Reading Journal and LLM Fatigue Revisited
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, August 13, 2025
IRC logs for Wednesday, August 13, 2025
Internet Relay Chat and Gemini Protocol Help Us Relive the Net of the Dial-Up Era
The kids were alright
"GPT-5" is Another Microsoft Dead Cat Trying to Bounce
The hype, the momentum (or the inertia) is wearing off
Microsoft Windows Losing Its Grip Near Turkey and Russia
The 'corridor' nations connecting Iran to Europe
Slopwatch: LinuxSecurity, Google News, and Serial Slopper (SS)
The slop, the bad, and the ugly
Links 13/08/2025: The “Incriminating Video” Scam and Corruption in South Korea
Links for the day
Gemini Links 13/08/2025: Movie Memories and Mystery Machine Bus
Links for the day
Links 13/08/2025: GitHub Trouble and Openwashing by Microsoft OSI With the Typical Buzzwords
Links for the day
Microsoft Swallows GitHub Losses
Only Microsoft knows how much money it has already lost on GitHub
Gemini Links 13/08/2025: Climate, Coffee, and Deploying Troops in Washington DC After Pardoning 1,000+ Insurrectionists in Washington DC
Links for the day
The Register MS Lowered MS Focus This Week
We hope The Register recognises its errors and tries to make up for them
Learning Ethics From Jeffrey Epstein's Enabler/Client/Ally, Coca-Cola, and Microsoft Accenture
Whatever merits vocabulary changes initially had are being tainted or obscured by later iterations, which tell us to avoid word like "normal", which apparently offend some people (so they argue)
Personal Attacks From Rust People Serve to Confirm They Have Lost the Argument
"The discussion I find around the net so far has no technical merit and centers around ad hominem"
Physical Meters and Purely Mechanical Meters Aren't Dumb; It's Dumb to Mock or Dismiss Them as Antiquated
I've learned a lot this week, both online and over the telephone
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, August 12, 2025
IRC logs for Tuesday, August 12, 2025
GitHub Will End Up like XBox and Skype
It is not likely that the XBox franchise will survive the next 5 years
Stones Thrown in Glass Houses
Projecting? You bet!
As Europe Gets Increasingly Serious About Software Freedom and Digital Sovereignty It Needs to Enforce a Ban on Software Patents ASAP
many councils in Europe move to Free software and US policy/companies cannot be trusted
Windows 12 in Bahrain (Microsoft "Market Share" Down to 12%, an All-Time Low)
They really ought to get away from Windows even faster
The Web Needs 'Pest Control' When It Comes to LLM Slopfarms
The goal is to discourage more sites becoming slopfarms
Microsoft Can Now Stop Reporting the GitHub Layoffs (Even When They Happen)
GitHub's original staff will see the true cost of becoming "b0rged" - something that Microsoft earned a bad reputation for
How to Get Very Bad or Even Malicious Code Into Linux? Write it in a Language That Linus Torvalds and Most Other Linux Developers Don't Understand.
One point nobody brings up is, what if code gets committed while evading audits and scrutiny?
Links 12/08/2025: Wikipedia Fails at UK High Court, Perlmutter Still Fights to Squash the Slop Lobby
Links for the day
Gemini Links 12/08/2025: Field Recording and Digital Legacy
Links for the day
Links 12/08/2025: WinRAR Zero-Day, SonicWall Does More Harm Than Good
Links for the day
Links 12/08/2025: More Sabotage of Underwater Cable Ahead of Russian Alaska Summit
Links for the day
Richard Stallman Will Not Miss Microsoft GitHub, It Was Only Good at Harvesting a Lot of Code for Plagiarism-as-a-Service
investors are apparently willing to lose money for buzzwords
Slopfarms Slopping Away at "Linux" and Spreading Microsoft Misinformation
Slopfarms don't comprehend this as they lack actual comprehension, they're just parrots
Links 12/08/2025: Science, Hardware, and Ukraine Excluded From Negotiations About Its Future
Links for the day
GitHub the Company Has, in Effect, Just Died (Time to Look for Alternatives)
To Microsoft, what's left of GitHub after dismantling/folding it is some "training set" (people's code, without permission to "train" i.e. misuse under the guise of "GenAI" plagiarism)
Linux Foundation Says "Housekeeping", "Hung", "Normal", "Native Feature/Support" and "Girl/Girls" Are Offensive Words
Bombing people is OK, just use the right "terms"
It Looks More Like Microsoft GitHub Layoffs
GitHub is just losing loads of money
Gemini Links 12/08/2025: Meditation, OpenStreetMap, Smolweb, and More
Links for the day
Google News is Dying: Most of Its Top Stories Now Are LLM Slop With Slop Images (i.e. 100% Fake 'Content')
Google News has been drowning in this sort of stuff for quite some time
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, August 11, 2025
IRC logs for Monday, August 11, 2025
Our Predictions Were Right: GitHub Dying as Losses Pile Up (as a Company It Cannot Continue to Exist, It's Not 'Free Hosting')
GitHub always lost money