Remove noise from audio files

Many years ago, I took advantage of the fact that my parents had a DVD-VR325, a device with a built-in DVD and VCR recorder, and an integrated VHS-to-DVD converter.

I took the opportunity to copy all the VHS we had on a rewritable DVD, and then copy the DVD on the PC. It would have been faster to copy the VHS directly on the PC, (or use multiple DVDs to parallelize some of the work) but apparently, I used to have more free time than now.

I did it for multiple reasons.

The first was that the VHS where degrading. Even if no one watched them for a long time, there were artifacts that I am confident were not there when the tapes were new. Thus I wanted to preserve a copy that would not degrade further.

The second reason was that I knew that someday in the future, we would not be able to play VHS Tapes anymore. As I predicted, today I still have the VHS, but not a device for watching them.

Unfortunately, I was not able to copy all the VHS tapes, one reason is that the recorder broke. The other one was that some tapes had a copy-protection mechanism.

Today I watched one of those backups, I was aware that the video quality would not have been great, but I was not prepared for the background noise in the audio

Background noise from the first tape
Background noise from the second tape

The background noise is consistent during the whole video and disturbs the whole time, not only during silent scenes.

Thus I decided to verify how I could remove it. While it was easier than expected to do it manually, I did not find a reliable way to do it automatically. Thus of the 40 tapes I savaged, only 4 have a cleaned audio track.

Required programs

Just two tools: an audio editor, and something for replacing the audio track in the video file.

Both programs are open source, and available on multiple platforms; in particular GNU/Linux and Windows.

Note 📝
Because of some controversy (about the privacy policy, the introduction of a CLA, introduction of telemetry, and possibly other topics), users of audacity created multiple forks, like tenacity. The version of Audacity packaged in your distribution might have telemetry and other network-based "features" already turned off.

Detect and remove the noise from the audio

First, open the mkv file in audacity. There is no need to extract separately the audio track from the video file

Once the content has been loaded search and select the region that contains only noise. Use the Play button (▶️) to listen to the selected region.

Region containing only noise

Then click on the menu entry Effects  Noise Removal and Repair  Noise Reduction…​.

From the new dialog, click on the button labeled Get Noise Profile

Get Noise profile

At this point, select the whole audio track (Ctrl+A), and click (again) on the menu entry Effects  Noise Removal and Repair  Noise Reduction…​.

From the dialog press on the button labeled Preview (it plays first five seconds). You can use the radio button "Residue" to hear what is being removed but do not forget to unselect residue before clicking on OK.

After applying the filter, menu entry File  Export Audio…​ (⇧ Shift+Ctrl+E).

The whole process is also explained in the official documentation.

Note that you can zoom in and out in the audio file, this is useful for finding, and selecting, a region containing only noise.

Replace the original audio track with the clean one

Open the .mkv file with mkvtoolnix-gui.

Add (for example with drag-and-drop from the file manager) the cleaned audio file. Select the radio button "Add as new source files to the current multiplex settings".

Dialog for adding audio track

Unselect the original audio track

Unselect original audio track

Note that the video is left untouched, with no loss in quality, only the audio has been modified.

Note that it is possible to replace the audio file programmatically from the command line with mkvmerge.

You can use mkvtoolnix-gui to make the edits you desire, and then see the equivalent mkvmerge command, by clicking on Multiplexer  Show Command Line.

I found it easier to do everything with the GUI since I was editing the video files either way one by one.

Note that you can keep the original audio track, and have both the original and the cleaned up in one mkv file. In my case, I decided to remove it, but if you want to keep it as a backup (especially if you believe you might be able to create a better-cleaned version in the future), you can leave it untouched with the new version.

What about other formats?

Audacity supports multiple audio formats, thus it is possible to use it for cleaning a lot of different types of audio and video files.

.mkv files are just a container, you can embed other videos in it, thus it is possible to use mkvtoolnix even with other video formats.


Do you want to share your opinion? Or is there an error, some parts that are not clear enough?

You can contact me anytime.