add stereo to mono script

master
an 2019-06-08 11:59:13 -04:00
parent b6faddf7fd
commit 680f8bcf55
1 changed files with 17 additions and 0 deletions

17
scripts/find_stereo.sh Executable file
View File

@ -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