How to replace audio in a video on Linux
If you’ve ever recorded a video clip on your Linux PC but realized that you might want to replace the audio track in it with something else, you’ll be happy to know that it’s much easier than you might think. In this guide, we’ll show you how to use the Kdenlive video editor to separate a video from its audio track.
Installing Kdenlive on Linux
Kdenlive is widely available on Linux, and it is one of the most popular video editing tools on the platform. Furthermore, it is perfect for this tutorial, as it allows us to quickly replace and modify audio tracks in video clips on Linux.
To install Kdenlive on your computer, you must open up a terminal window. Press the Ctrl + Alt + T or Ctrl + Shift + T keyboard combination to launch a terminal window. Then, follow the command-line installation instructions below that correspond with the Linux OS you currently use.
Ubuntu
Kdenlive can be set up on Ubuntu with the Apt command.
sudo apt install kdenlive
Debian
The Kdenlive video editor is available for Debian users, though, be warned that the app doesn’t include the latest features, as Debian updates their packages very slowly. Install it with the Apt-get command below.
sudo apt-get install kdenlive
Are you looking for a more up to date release of Kdenlive on Debian? Consider following the Snap or Flatpak instructions instead.
Arch Linux
To get Kdenlive working with Arch Linux, enter the following Pacman command.
sudo pacman -S kdenlive
Fedora
On Fedora Linux, the Kdenlive video editor can be set up using the Dnf command.
sudo dnf install kdenlive
OpenSUSE
If you’re an OpenSUSE Linux user, you will be able to get the Kdenlive video editor up and running using the Zypper command.
sudo zypper install kdenlive
Flatpak
Kdenlive is available as a Flatpak. So, if you cannot install Kdenlive easily on your current operating system’s package manager, but it has support for Flatpaks, you’re in luck! To start the installation process, please follow our in-depth guide on how to set up the Flatpak runtime. Once the runtime is set up, use the flatpak remote-add command to add the Flathub app store to your Linux PC.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
With Flathub set up, the installation can begin. Using the flatpak install command, get Kdenlive working.
flatpak install flathub org.kde.kdenlive
Snap package
Kdenlive is usable as a Snap package from the Ubuntu Snap Store. If you would like to install the Kdenlive video editor on your computer through the Snap Store, do the following. First, follow our in-depth tutorial on how to set up the Snapd runtime onto your Linux system. Then, once the runtime is up and running, execute the following snap install command to get Kdenlive working.
sudo snap install kdenlive
Replace audio in video clip
To replace the audio in a video clip with Kdenlive, start by launching the app on the Linux desktop. Once the app is open, follow the step-by-step instructions outlined below.
Step 1: Find the “Project” button, and click on it with the mouse to reveal its options. Then, locate the “Add clip or folder” button, and select it with the mouse.
By clicking on “Add clip or folder,” you will see a pop-up window appear on the screen. Use this pop-up window to browse for the video clip you wish to edit in Kdenlive.
Step 2: Drag the video clip from the clip box to the video timeline with the mouse. Be sure to place this clip at the very start of the timeline (AKA 00:00:00:00), else your video will have some blank space at the start. Additionally, make sure that the video clip is added to the timeline in the V1 slot. This slot is called Video 1.
Step 3: After dragging your video clip to V1, you will notice that the audio for the video clip has appeared in A1 (AKA Audio 1.) As of now, the audio and video are grouped together.
To de-couple the audio clip from the video clip, right-click on the video clip with the mouse to reveal the right-click menu. Then, look through the right-click menu for the option that says “un-group clips.” Select it to ungroup the video track and the audio track, so that they are two independent clips.
Step 4: Now that the audio and video are de-coupled, you can replace the audio. To delete the original audio, simply right-click on it with the mouse, access the right-click menu, and select the “Delete selected clip” option.
Step 5: To replace the deleted audio track, simply add a new audio file to Kdenlive and place it in the A1 slot.
Step 6: To render the project, press Ctrl + Enter on the keyboard.
These instructions seem to be out of date, in kdenlive 19.12.3 there is no button labeled “Project” (fails at step 1!)