Linux: Command line video editing

By | February 10, 2017

The best way to do simple video in Linux is using the command line. This way you can do quick one liner commands that do the job fast and clean.

My favourite tool is ffmpeg.

Install ffmpeg:

If you do not have it already installed to intall ffmpeg simply do (in Fedora):

The following are several operations you can do.

Sub-sample a high frame rate video.
By default my GoPro is set to film at 720p and 60fps. This is great for dash camera setup (I mainly use the camera for that) but the disadvantage is that the video files are huge. To be able to post sequences a sub-sampling is necessary.

To sub-sample the video file execute the following:

-r 25 = specifies the sub-sampled framerate to be 25fps
-i GOPR4406.MP4 = the input file
file0.mp4 = the output file

Concatenate several video files with the same encoding
It is important for the files to be concatenated to have the same encoding. If not a conversion as described in the previous step can be done.

Create a text file mySet.txt with the following content:

Note that the files will be concatenated in the order they are listed.

Then execute the following: