Skip to content

Instantly share code, notes, and snippets.

@Windows81
Created June 4, 2021 07:41
Show Gist options
  • Save Windows81/b19841f1c08d07c838a9cd59d05f4547 to your computer and use it in GitHub Desktop.
Save Windows81/b19841f1c08d07c838a9cd59d05f4547 to your computer and use it in GitHub Desktop.
Searches for and generates a video that plays each subdirectory's songs in reverse order.
ls -dir|%{$d,$c=$_,0;$f=((ls $_|%{$c++;"amovie=`"./$($d.Name)/$($_.Name-replace "'","\\\'")`"[a$c];color=color=#111111:r=2:size=hd720:duration=7,drawtext=text=`"$($_.BaseName-replace "'","ʼ")`":fontcolor=white:x=(w-tw)/2:y=(h-42)/2:fontsize=42[v$c];"})-join '')+"anullsrc=cl=stereo,atrim=0:1[a0];color=color=black:d=1:s=hd720[v0];"+((($c++..0)|%{"[v$_][a$_]"})-join'')+"concat=v=1:a=1:n=$c[out0][out1]";echo $f;ffmpeg -f lavfi -i $f -v error -stats "$d.mp4" -y}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment