From d53a2d5f5d9563c9bd3a56affc046d8e59cc8d21 Mon Sep 17 00:00:00 2001 From: Phantop Date: Sat, 11 Jul 2020 01:41:32 -0400 Subject: [PATCH] Fish: parallel optiflac --- .config/fish/functions/optiflac.fish | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.config/fish/functions/optiflac.fish b/.config/fish/functions/optiflac.fish index 547325d..d2f2d52 100644 --- a/.config/fish/functions/optiflac.fish +++ b/.config/fish/functions/optiflac.fish @@ -1,9 +1,7 @@ -# Defined in /tmp/fish.yFtyWn/optiflac.fish @ line 2 +# Defined in /tmp/fish.Yy0Eg4/optiflac.fish @ line 2 function optiflac mkdir out - for i in *.flac - ffmpeg -i $i -c:v copy -c:a flac -compression_level 12 -af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16 $argv out/$i - end + ls *.flac | parallel ffmpeg-static -i {} -c:v copy -c:a flac -compression_level 12 -af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16 $argv out/{} cd out for i in * if test (du $i | cut -f1) -lt (du ../$i | cut -f1) @@ -14,7 +12,7 @@ function optiflac cd .. cp *.flac out cd out - flacc * + ls | parallel flacc {} for i in * if test (du $i | cut -f1) -lt (du ../$i | cut -f1) echo $i