How to transcode video files on Linux
Do you have some video files you want to transcode into a different format on your Linux PC? Unsure about how to do it? We can help. Follow along with this guide as we show you how to transcode video files on Linux
GUI – Handbrake
Handbrake is an excellent GUI tool for Linux (and other platforms) that can be used to transcode video files quite easily. To get started transcoding your videos with the Handbrake tool, you must install the app. To install Handbrake, open up a terminal window. Then, follow the command-line installation instructions outlined below that correspond with the OS you use to get the app working.
Ubuntu
Install Handbrake on Ubuntu with the Apt command below.
sudo apt install handbrake
Debian
Get Handbrake for Debian by entering the following Apt-get command in a terminal.
sudo apt-get install handbrake
Arch Linux
On Arch Linux, install Handbrake with the Pacman command.
sudo pacman -S handbrake
Fedora
Fedora users can get Handbrake with the Dnf command.
sudo dnf install handbrake
OpenSUSE
OpenSUSE users can get Handbrake working with the Zypper command.
sudo zypper install handbrake
Snap package
The Handbrake video transcoding tool is available to all Linux users via the Snap package store. To get the app installed, ensure that you have the Snap runtime installed on your system. Then, run the command below.
sudo snap install handbrake
Flatpak
Handbrake is available on the Flathub app store. To get the app installed in this way, do the following. First, ensure you have the Flatpak runtime installed. Then, enter the two commands below to get everything working.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install flathub fr.handbrake.ghb
Transcoding files with Handbrake
Transcoding means converting a file from one format to another. To do it in Handbrake, follow the step-by-step instructions below.
Step 1: Open up the Handbrake application on the desktop by searching for it in the app menu. Then, with the app open, find the “Open Source” button and click on it with the mouse.
Step 2: After clicking on the “Open Source” button, an open-file dialog box will appear. In this box, search for the video file you wish to convert from one format to the other. Click “Open” in the box to add the file to Handbrake.
Step 3: Upon adding the video file to Handbrake, you will see it in the preview window. From here, locate the “Preset” menu, and click on it with the mouse.
Look through the “Preset” menu for the transcoding format that works best for your needs.
Step 4: Locate the “Start” button in Handbrake, and click it to start the transcoding process. Keep in mind that this process will take a very long time. Be patient!
When the process is complete, Handbrake will give you a notification of completion. Your transcoded file is located in the “Videos” folder.
Command-line – FFMpeg
The FFMPeg tool is a command-line utility that can be used to transcode video files to different formats easily. However, before we can go over the transcoding process, we must demonstrate how to install the app on your system.
To start the installation of FFMPeg on your Linux PC, open up a terminal window. Then, follow the command-line installation instructions down below that corresponds with the Linux OS you currently use.
Ubuntu
On Ubuntu, the FFPMpeg app can be easily installed on the system with the Apt command.
sudo apt install ffmpeg
Debian
Are you using Debian? Get FFMpeg working with the Apt-get command.
sudo apt-get install ffmpeg
Arch Linux
Arch Linux users can install FFMpeg with the Pacman tool.
sudo pacman -S ffmpeg
Fedora
Fedora Linux users can install FFMpeg with the Dnf command.
sudo dnf install ffmpeg
OpenSUSE
On OpenSUSE Linux, install FFMpeg with Zypper.
sudo zypper install ffmpeg
Transcoding files with FFMPeg
Transcoding files from one format to the other with FFMpeg in the command-line isn’t as difficult as it sounds. To do it, follow the step-by-step instructions below.
Step 1: Open up a terminal window on the desktop. Then, with the terminal window open, use the CD command to move the terminal session to the location of the video file in which you wish to transcode.
Note: in this example, the video in which we wish to convert is located in the “Videos” folder. Yours may differ. Be sure to change the command below to suit your needs.
cd ~/Videos
Step 2: Specify the input file in the ffmpeg -i command below. In this example, the video file will be example-video.mp4.
ffmpeg -i example-video.mp4
Step 3: Specify the output file you’d like FFMpeg to generate. For example, to convert example-video.mp4 to an AVI file, you’d do the following.
ffmpeg -i example-video.mp4 output-video.avi
Or, to convert to MKV, you’d do:
ffmpeg -i example-video.mp4 output-video.mkv
FFMpeg will transcode your video file to virtually any video file format. Just specify it in the command.
ffmpeg -i example-video.mp4 output-video.DESIRED.VIDEO.FORMAT
Step 4: Press the Enter key to start the transcoding process. When the process is complete, the converted output file will be in the same directory as the source video.