You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
487 B
19 lines
487 B
#!/usr/bin/env fish |
|
|
|
function find-stereo -d 'Finds files that are stereo' |
|
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak' |
|
|
|
for f in $argv |
|
set out (ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -) |
|
|
|
if test "$out" != 'CRC=0x00000001' |
|
set other /tmp/(basename "$f") |
|
echo "$f is stereo, converting" |
|
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f" |
|
else |
|
echo "$f is mono" |
|
end |
|
end |
|
end |
|
|
|
## EOF
|
|
|