2 Commity 8954e98863 ... ce88146a64

Autor SHA1 Wiadomość Data
  Joe Ceresini ce88146a64 Fixup some output 3 lat temu
  Joe Ceresini c4ddd4cc05 Use a single tempo filter 3 lat temu
1 zmienionych plików z 10 dodań i 3 usunięć
  1. 10 3
      powerhour.sh

+ 10 - 3
powerhour.sh

@@ -12,7 +12,7 @@ fi
 file=$1
 sep=$2
 
-FFMPEG="docker run -ti --rm -v $(pwd):/data -w /data linuxserver/ffmpeg"
+FFMPEG="docker run -ti --rm -v $(pwd):/data -w /data linuxserver/ffmpeg -hide_banner -loglevel error"
 FFPROBE="docker run -ti --rm -v $(pwd):/data -w /data --entrypoint ffprobe linuxserver/ffmpeg"
 
 CLIP_LEN=60
@@ -21,24 +21,31 @@ audio_len=$($FFPROBE -v error -show_entries format=duration -of default=noprint_
 max_start=$(expr $audio_len - $CLIP_LEN)
 
 # first make a bunch of 60s clips with random start positions
+echo "Making the clips"
 for i in {0..59}; do
+  echo -n "$i "
   rand_start=$(($RANDOM % $max_start))
   outfile="clip-$i.wav"
   $FFMPEG -ss $rand_start -t 60 -i $file $outfile
 done
+echo
 
 # next loop over those clips and shrink them appropriately
+echo "Adjusting tempo"
 for i in {1..59}; do
+  echo -n "$i "
   outfile="clip-$i.wav"
   infile="_$outfile.tmp"
   mv $outfile $infile
-  tempo=$(eval printf 'atempo=1.01,%.0s' {0..$i} | sed 's/,$//')
-  $FFMPEG -i $infile -filter:a "$tempo" -vn $outfile
+  tempo=$(echo "0.033 * $i"| bc)
+  $FFMPEG -i $infile -filter:a "atempo=$tempo" -vn $outfile
   rm $infile
 done
+echo
 
 # stitch em together
 # Using a file here because i need to access it in docker
+echo "Stitching them together"
 >_concat
 for i in {0..59}; do
   echo "file clip-$i.wav" >>_concat