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

Another Slew of Fake Articles About 'Linux' and 'Security' From Brittany Day at linuxsecurity.com (Spamfarm/Slopfarm)
linuxsecurity.com is basically a pariah and parasite. It lessens the incentive to write real articles about "Linux" by generating fake ones to outrank the originals.
IBM: Many Thousands of Layoffs in 2025
If 2025 is expected to be the same, then perhaps about 20,000 IBM workers will no longer be there
Google: Your Only Option is Google YouTube (Coming Soon: Mandatory DRM and Attestation?)
Digital Restrictions (DRM) to follow? Only for "approved" (attestation) browsers?
The Munich-Based EPO is Still Using a Platform That Promotes the Far Right and Rehabilitates Nazism
Active Twitter account
 
Links 30/01/2025: Fentanylware (TikTok) Causes Deaths, FBI Seizes Domains
Links for the day
Gemini Links 30/01/2025: Action vs Inaction, Gopherholes, and More
Links for the day
Links 30/01/2025: Microsoft Wants Convicted Felon to Give Fentanylware (TikTok) to It (After Making a Phonecall Asking for That in 2019), "Moving Away From Google's Ecosystem"
Links for the day
Jack M. Germain (LinuxInsider) Seems to Have Turned to LLM Slop, Graphics Slop, and B2B SPAM
LinuxInsider is barely active anymore
Links 30/01/2025: Amazon Layoffs and DeepSeek Panic
Links for the day
Gemini Links 30/01/2025: Chaos Reigns, E-mail, Searching
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, January 29, 2025
IRC logs for Wednesday, January 29, 2025
Mastodon Was Always Biased (Just Like Twitter After Abandoning Chronological and Neutral Timelines in Order to Become More Like Facebook)
So bury-brigading and click-farming control what people see
Certificate Authority Let's Encrypt Falls to Only 0.4% of the Total in Geminispace
Geminispace does not need to outsource trust
Links 29/01/2025: Dismantling Public Health in the US, Air Busan Plane Up in Flames (South Korea's Air Disasters Streak)
Links for the day
Announcements and Administrivia
This week we're going out for two days in a row to celebrate an achievement that's very respectable
Gemini Links 29/01/2025: Japan, GTD, and More
Links for the day
Sir, Yes, Sir. The Life of EPO Patent Examiners.
If working for the EPO makes it harder to sleep at night, take action
How the EPO Pressures Staff Into Minting More Monopolies (Patents), Even Illegal Ones That Harm Europe and Ultimately Dismantle the Rule of Law
insights into the pressure examiners are under
LLM Slop Machines Are Not a Win for "Open Source" and If They Get Cheaper, It's Even Worse
If some program that claims to be "Open Source" pollutes the Web with fake articles (Microsoft SPAM and fake "Linux" articles), whose win is it?
Links 29/01/2025: Data Privacy Day and Growing Tensions in Europe
Links for the day
Nazi Twitter (aka "X") Became a Troll Site That Lets People Buy a Blue Tick While Its Boss Actively Promotes Neonazi Politicians
the intellectual level of people who infest the Web through "Twitter" or "X"
This is Why They're So Afraid of Richard Stallman (He Tells People the Correct History)
Then they post about it to Microsoft's LinkedIn
Richard Stallman Speech in Bengaluru, "Silicon Valley of India"
62 years have passed since his "young nerd" days and he's still at it
Claim: Facebook Deletes Posts of IBM Red Hat Critics
As always, follow the money (advertisers)
Links 29/01/2025: Climate Crisis and "It’s time for the Xbox to fade away" (Microsoft Lose)
Links for the day
Links 29/01/2025: Buying Groceries During a Trade War, Political 'Retro'
Links for the day
More Illegal Patents at the EPO, Legality of Granted European Patents No Longer Matters to the Office
breaking the law for profit
Network Improvements Tomorrow
"Network maintenance" down in London
Sharing is Caring (But Advocating Copyleft Makes You a "Target")
GPLv3 does not close all the loopholes which the "Affero" helps close
Articles About Free Speech at Facebook
'Facebook vs Linux' story is now receiving a lot more media coverage
We Were Right About stallmansupport.org Making an Error by Joining Social Control Media. mastodon.social Suspends stallmansupport.org.
From what we can guess, accounts can be banned by some oversensitive admin or a mob of users ("bury brigades")
"Latest Technology News" in BetaNews Still LLM Slop and SPAM Composed by LLMs (It's Basically a Spamfarm Disguised as a News Site)
Only a fool would visit BetaNews in search of actual news
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, January 28, 2025
IRC logs for Tuesday, January 28, 2025
The EPO's Corruption, If It Remains Untackled, Helps the Far Right and Enemies of European Unity/Solidarity
Do not negotiate with evil
The Web, Including Wikipedia, Gets Filled With Lies About Bill Gates, Added by Bill Gates and His PR Team
Of course Wikipedia is funded by Gates
Facebook Banning Linux Sites (or People Who Link to Linux Sites) is Another Symptom of the Web's Demise
The state of media on the Web is really bad; Social Control Media amplifies the badness, as Facebook serves to show
Gemini Links 29/01/2025: Neovim Telescope and Writing Less
Links for the day
Links 28/01/2025: Chaffbot as Commodity Fad, New Import Restrictions in Thailand
Links for the day
Links 28/01/2025: "Against Social [Control] Media", "Smart" Buses' Ticketing System Cracked
Links for the day
[Video] Richard Matthew Stallman (RMS) in India, Talking About Proprietary Software's Dangers Only Yesterday
WebM file
Gemini Links 28/01/2025: Thinking About Not Much, Computing Fatigue, the Curse of JavaScript
Links for the day
"SuccessFactors" (SAP) Stunts at the EPO Used to Break Laws and Constitutions, Staff Tricked Into Harming Themselves
Ongoing corruption and lawlessness became the norm; Europe's second-largest institution (EPO) along with the largest institution (EU) has its very own Minsk
The GNU Manifesto Turns 40 in a Few Weeks
The FSF turns 40 later this year, too
Continued Support and Momentum at the Free Software Foundation (FSF)
"This helps protect our community."
Another Talk by Richard Stallman Tomorrow, This Time in Bengaluru
This means that in January 2025 he is giving at least 5 public talks
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, January 27, 2025
IRC logs for Monday, January 27, 2025