Skip to content

A project combining pyAudioAnalysis' silence removal feature with some ffmpeg magic to automatically cut videos into segments while removing longer silences.

Notifications You must be signed in to change notification settings

bjoernpl/VideoSilenceRemover

Repository files navigation

VideoSilenceRemover

VideoSilenceRemover

Automatically cut video into segments containing speech while removing silence.

This repo contains a Jupyter Notebook which demonstrates the combination of pyAudioAnalysis and FFmpeg to cut any input video into distinct segments containing speech. To do this, it uses pyAudioAnalysis audioSegmentation.silence_removal() function to find the start and end times of speech segments, and a bunch of FFmpeg calls for all audio and video conversions, cuts and concatenations.

Installation

Step 1. Prerequisites

  • conda or some other environment manager to create a virtual environment.
  • python 3.7 and the linux distro of your choice are recommended.
  • ffmpeg must be installed and in the path. See here for more info.

Step 2. Clone this repo

Clone this repo while making sure to include --recursive to also get the pyAudioAnalysis submodule.

git clone --recursive git@github.com:bjoernpl/VideoSilenceRemover

Step 3. Install pyAudioAnalysis

To install pyAudioAnalysis, first make sure your virtual environment is activated.

cd ./pyAudioAnalysis
pip install -r ./requirements.txt
pip install -e .

Step 4. Install requirements

cd ..
pip install -r ./requirements.txt

Done!

You can now run the notebook by calling jupyter lab or jupyter notebook.

Usage

For more info on the usage, see the explanations in VideoSegmentation.ipynb

References

This repo relies mainly on the pyAudioAnalysis library. Thanks very much to it's creators and contributors.

@article{giannakopoulos2015pyaudioanalysis,
  title={pyAudioAnalysis: An Open-Source Python Library for Audio Signal Analysis},
  author={Giannakopoulos, Theodoros},
  journal={PloS one},
  volume={10},
  number={12},
  year={2015},
  publisher={Public Library of Science}
}

Thanks also to the creators and contributors at FFmpeg for their awesome tool.

About

A project combining pyAudioAnalysis' silence removal feature with some ffmpeg magic to automatically cut videos into segments while removing longer silences.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published