diff --git a/scripts/find_stereo.sh b/scripts/find_stereo.sh new file mode 100755 index 0000000..8beb4a2 --- /dev/null +++ b/scripts/find_stereo.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +filter='pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak' + +for f in $@ +do + out=$(ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -) + + if [[ "$out" != 'CRC=0x00000001' ]] + then + other="${f%.ogg}.1.ogg" + echo "$f is stereo, converting" + ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f" + fi +done + +## EOF