extractaud
Script courtesy of Andrei Amatuni; Last updated: March 2017
A script for pulling out the audio stream from video files.
all the audio, all the files
To pull out all the audio from all the files in a directory:
$: python extractaudio.py input_directory output_directory
specific timestamps, specified files
If you only want to pull out specified timestamps within a video file, pass in a csv file with filenames/onset_ms/offset_ms timestamps:
$ python extract_audio.py timestamps.csv output_directory
The csv file should be in this form:
You will end up with .wav files in the output directory, named after the original video it came from, with the timestamps included in the filename.
This script depends on FFmpeg, which you can get here. Make sure the binary is somewhere in your $PATH.