Created
April 14, 2021 19:11
-
-
Save xenotropic/c4802fad7e2e5496aecc835743804101 to your computer and use it in GitHub Desktop.
ffmpeg compand Dynamic Range Compression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Dynamic range compression via ffmpeg. Takes single filename as input, writes temporarily to a file in tempdir, then copies back (and overwrites!) to the original location. | |
# Because of the overwrite, make sure you're working with a backed-up file, at least at first. | |
# Based on https://medium.com/@jud.dagnall/dynamic-range-compression-for-audio-with-ffmpeg-and-compand-621fe2b1a892 | |
tempdir=/home/joe/temp/ #modify to be a place writable by the script | |
extension="${1##*.}" | |
ffmpeg -y -err_detect ignore_err -copyts -i "$1" -filter_complex "compand=attacks=0:points=-80/-900|-45/-15|-27/-9|0/-7|20/-7:gain=5" "${tempdir}ffcompand-temp.${extension}" && mv "${tempdir}ffcompand-temp.${ex\ | |
tension}" "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment