add stereo to mono script
parent
b6faddf7fd
commit
680f8bcf55
|
@ -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
|
Loading…
Reference in New Issue