Skip to content

Instantly share code, notes, and snippets.

@iandunn
Created June 5, 2017 02:07
Show Gist options
  • Save iandunn/32c5c098aaed8a0d76b453ec89f15b27 to your computer and use it in GitHub Desktop.
Save iandunn/32c5c098aaed8a0d76b453ec89f15b27 to your computer and use it in GitHub Desktop.
Alias to convert a stereo recording to mono
# Alias to convert a stereo recording to mono
#
# $1 - The input filename
function qtmono {
basename=$(basename "$1")
filename="${basename%.*}"
extension="${basename##*.}"
ffmpeg -i $1 -codec:v copy -af pan="mono: c0=FL" $filename-mono.$extension
}
@phpguru
Copy link

phpguru commented Nov 6, 2024

If you get Error applying option ‘c0’ to filter ‘pan’: Option not found try this version (2024, Sonoma)

function qtmono {
    basename=$(basename "$1")
    filename="${basename%.*}"
    extension="${basename##*.}"
    ffmpeg -i $1 -ac 1 $filename-mono.$extension
}

@jcesardasilva
Copy link

This is great! Thanks. The conversion is slower than when using the first implementation, but that solution decreases the file size. The files are 10x smaller for me, and the quality is still outstanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment