[HowTo] Merge videos with ffmpeg

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
vandykmarsu
Posts: 12
Joined: Wed Mar 04, 2020 8:55 pm

[HowTo] Merge videos with ffmpeg

#1 Post by vandykmarsu »

FFmpeg is a collection of open source software intended for processing audio or video streams. Source

Be sure that you have the last version of ffmpeg:

Code: Select all

ffmpeg -version
You will see an output of your version, in my case i have the last stable version 4.1.6.


No output??? Whaaaat!!! Don't panic on the Titanic, we need just to install the package:

Code: Select all

sudo apt update && sudo apt upgrade -y
sudo apt install ffmpeg -y

Go to the Videos folder and we create an file like this, necessary to concat later:

Code: Select all

file '/path_to_my_file/part1.mp4'
file '//path_to_my_file/part2.mp4'
file '/=/path_to_my_file/part3.mp4'
then save the file with a name of your choice in .txt output, in my example merge.txt.


Now we can merge our vids, the per-file main options retained are:

-f input/output with the concat option
-i input file or url
-c codec or stream output with the copy option

Code: Select all

 ffmpeg -f concat -safe 0 -i merge.txt -c copy my_vids.mp4


After a few moments you can see your new merged video.

Enjoy! :D

Source
Last edited by vandykmarsu on Thu Jul 30, 2020 6:32 pm, edited 2 times in total.
Ryzen 3600 - AB350Gaming - 16Gb - RX570 8Gb - PSU Lepa 500W - Case Z9 Neo

User avatar
Stevo
Developer
Posts: 14441
Joined: Fri Dec 15, 2006 7:07 pm

Re: [HowTo] Merge videos with ffmpeg

#2 Post by Stevo »

When outdated just make an update and upgrade of your sources list like:

Code: Select all

sudo apt update && sudo apt upgrade -y
That's not going to get you a newer ffmpeg from our test repo, you know...or on any stable Debian or Ubuntu release either, unless Debian pushes a newer version into main, which is quite rare (though it just happened).

vandykmarsu
Posts: 12
Joined: Wed Mar 04, 2020 8:55 pm

Re: [HowTo] Merge videos with ffmpeg

#3 Post by vandykmarsu »

Stevo wrote: Thu Jul 30, 2020 2:45 am
When outdated just make an update and upgrade of your sources list like:

Code: Select all

sudo apt update && sudo apt upgrade -y
That's not going to get you a newer ffmpeg from our test repo, you know...or on any stable Debian or Ubuntu release either, unless Debian pushes a newer version into main, which is quite rare (though it just happened).
Did an update, thanks for reply.
Ryzen 3600 - AB350Gaming - 16Gb - RX570 8Gb - PSU Lepa 500W - Case Z9 Neo

User avatar
Stevo
Developer
Posts: 14441
Joined: Fri Dec 15, 2006 7:07 pm

Re: [HowTo] Merge videos with ffmpeg

#4 Post by Stevo »

Thanks! I trust everyone knows how to get a newer ffmpeg from our test repo using MX Package Installer.

Post Reply

Return to “Tips & Tricks by users”