Skip to content

Instantly share code, notes, and snippets.

@daviesian
Created April 26, 2016 21:04
Show Gist options
  • Save daviesian/bc6bf4906e272d0fae35dee22c1681bd to your computer and use it in GitHub Desktop.
Save daviesian/bc6bf4906e272d0fae35dee22c1681bd to your computer and use it in GitHub Desktop.

To detect all silences longer than a second:

TIMES=`/c/dev/bin/ffmpeg-20160425-git-9ac154d-win64-static/bin/ffmpeg.exe -i ~/Desktop/DW33\ -\ Going\ Postal/Going\ Postal\ 01\ -\ Terry\ Pratchett.mp3 -af silencedetect=noise=0.001:d=1 -f null - 2>&1 | grep -E '^\[silence.*start' | cut --delimiter=\  --fields=5 | tr '\n' ','

To split file at those times:

/c/dev/bin/ffmpeg-20160425-git-9ac154d-win64-static/bin/ffmpeg.exe -i ~/Desktop/DW33\ -\ Going\ Postal/Going\ Postal\ 01\ -\ Terry\ Pratchett.mp3 -acodec copy -f segment -segment_times ${TIMES::-1} thing-%03d.mp3 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment