18 lines
405 B
Bash
18 lines
405 B
Bash
|
#!/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
|