/

How to Automatically Remove Silence in Videos

How to Automatically Remove Silence in Videos

As a developer, I tend to communicate through text, but there are times when I create videos, whether it’s for a coding tutorial or to connect with my newsletter audience. There’s a unique connection that comes from seeing someone’s face and hearing their voice in a video. It’s almost like meeting face to face.

However, creating videos can be a challenging task, especially for me. English is not my native language, and I only started learning it when I was 14. Additionally, I’m not the best speaker, and I make mistakes, even when speaking in my native language. This results in a lot of editing work.

One common issue I face is having long videos that need to be trimmed down. I often find myself with a 20-minute raw footage that I need to edit down to 10 minutes. Furthermore, I tend to have pauses in my recordings that I would like to remove during the editing process.

Luckily, I discovered a tool that can help streamline this process by automatically removing pauses in videos. However, it’s worth noting that this tool works best for videos where you’re speaking continuously. For coding videos where you switch between speaking and coding, it might not be as useful.

The tool I found is called jumpcutter, and it’s a Python program. You can find it on GitHub at the following link: https://github.com/carykh/jumpcutter.

To get started, follow these steps:

  1. Clone the jumpcutter repository by running the following command in a folder on your computer:

    1
    git clone https://github.com/carykh/jumpcutter.git
  2. Navigate to the jumpcutter folder:

    1
    cd jumpcutter
  3. Install the required dependencies:

    1
    python -m pip install --user -r requirements.txt

Now, you’re ready to use jumpcutter. Copy your video file into the jumpcutter directory (e.g., video.mp4) and run the following command:

1
python jumpcutter.py --input\_file video.mp4 --silent\_speed 999999 --frame\_margin 2 --frame\_rate 30

If you want to explore more options, you can refer to the Python source code of the program, which is only 200 lines long: https://github.com/carykh/jumpcutter/blob/master/jumpcutter.py.

In the above example, --silent_speed 999999 sets the speed at which the video should be cut during periods of silence. By setting it to a maximum value, we effectively remove the silence. The --frame_margin 2 option determines the number of frames before and after each sound that should be included to prevent abrupt cuts. Finally, --frame_rate 30 specifies the video’s frame rate.

For further details on jumpcutter, I recommend watching this video by the author.

I want to express my gratitude to this gist for helping me discover this useful tool.

I personally tested jumpcutter on a 24-minute video, which I managed to reduce to 14 minutes. Now, with the silence removed, I only need to edit out any repeated takes to finalize the video according to my preferences.

tags: [“video editing”, “jumpcutter”, “coding tutorial”, “remove silence”, “Python programming”]