Perform Simple Video Editing with Ubuntu/Mac OS (from terminal)

You can do simple video editing with your Linux/Unix machine by using terminal. This means, you don’t have to buy any software or exploring complicated Graphical User Interface (GUI) video editing software. This can be easily done with FFmpeg.

Cost 💰

Free. FFmpeg is free to install and free to use.


System Requirements

None.

Known OS that support FFMpeg: Ubuntu, Mac OS

Hardware will only determine the time required to process a video. The better processing power, the faster video processing will be.

Source: https://superuser.com/questions/1584816/what-are-the-minimum-requirements-specs-for-ffmpeg

I’m not familiar with terminal. How can I benefit from FFmpeg? 🥲

ChatGPT/ Copilot/ Claude/ any Ai chatbot will definitely help. You just need to ask Ai to generate a command for you.

Ask your favourite Ai to create a command for you. In this case, it is about resizing video to 720p while maintaining aspect ratio 😉.

Demo 🎥

This is a demo on how to convert a video from mov to mp4 using terminal.

Just paste the command in your terminal. It will straightaway do the conversion. You don’t have to buy or install any software to do simple video editing.

I’m using Mac. How to install FFmpeg? 🖥️

Simple. Run this command on your zsh terminal (using brew).

$ brew install ffmpeg

This will install the ffmpeg binary and all of dependencies that are used by ffmpeg. Your Mac needs to have brew installed first.


I’m using Ubuntu. How to install FFmpeg? 🐧

Simple. Run this command on your Ubuntu terminal (using apt).

$ sudo apt update
$ sudo apt install ffmpeg

This will install the ffmpeg binary and all of dependencies that are used by ffmpeg. Ubuntu out-of-the-box comes with apt package manager.


Verdict

The cons of using online video conversion: ❌

  1. Requires fast internet connectivity to upload and download video.
  2. On the mercy of video conversion platform to manage your video.
  3. The conversion could be deprioritized depending on the platform server availability.
  4. Free online video editor has limited file size limit.

The pros of using FFmpeg: ✅

  1. No need for fast internet connectivity.
  2. Video stays on your environment.
  3. Use your own server capacity.
  4. Didn’t have any hard limit on video size.
Online Video Conversion PlatformFFmpeg
Privacy
Requires Fast Internet Connectivity
Processing speedDepends on the online video conversion platform capability and availabilityDepends on your hardware capability
Video file size limitDepends. Usually at most at 1GBNo limit
CostFree with limited capabilityFree

Common task I do with FFmpeg

Resizing video to 720p while maintaining aspect ratio

$ ffmpeg -i input.mp4 -vf "scale=-1:720" -c:a copy output.mp4

Combine video

This requires you to create a txt file containing all the video filename you want to combine. Create a videos.txt file and list the video filename.

file 'video1.mp4'
file 'video2.mp4'
file 'video3.mp4'

Then, execute the following command in terminal:

$ ffmpeg -f concat -safe 0 -i videos.txt -c copy output.mp4

Trimming a video

$ ffmpeg -i input.mp4 -ss 00:01:00 -t 00:00:30 -c copy output.mp4

Conclusion

Relying on online converters to convert, trim, resize, or combine videos is not an option when dealing with sensitive information. Using online video conversion services can risk leaking confidential information. Therefore, using FFmpeg allows you to manipulate videos internally without uploading them to unknown servers on the internet.