From 8069cfcdf2a126b45dbc5f07e094f15eb6b34d08 Mon Sep 17 00:00:00 2001 From: xfnw Date: Thu, 28 Dec 2023 21:47:38 -0500 Subject: [PATCH] zshrc: correct ffdiff colors this avoids having the gray background for no motion --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index d6db149..1217107 100644 --- a/.zshrc +++ b/.zshrc @@ -7,7 +7,7 @@ calcpi() { echo "scale=$1; 16*a(1/5)-4*a(1/239)" | bc -l ; } calcbd() { echo "h=sqrt($1*2*l(2))+1; scale=0; h/1" | bc -l ; } vhsify() { ffmpeg -i "$1" -vf fps=24,scale="(iw*sar)*max(640/(iw*sar)\,480/ih):ih*max(640/(iw*sar)\,480/ih)",crop=640:480,setsar=1:1,convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2",curves="0/0 0.5/0.58 1/1",rgbashift=rh=-1:gh=1 -preset veryfast -c:a copy "$2" ; } deshake() { ffmpeg -i "$1" -vf "format=rgb24,split[a][b];[a]deshake=rx=64:ry=64:edge=0,colorkey=0x008000:blend=0:similarity=.2[a];[b]drawbox=color=black:t=fill[b];[b][a]overlay" -c:a copy "$2" ; } -ffdiff() { ffmpeg -i "$1" -c:a "${3:-copy}" -filter_complex "tblend=all_mode=${4:-grainextract},setsar=1" -vsync vfr "$2" ; } +ffdiff() { ffmpeg -i "$1" -c:a "${3:-copy}" -filter_complex "tblend=all_mode=${4:-grainextract},curves=all=0/1 .5/0 1/1,setsar=1" -vsync vfr "$2" ; } datamosh() { ffmpeg -i "$1" -c copy -bsf:v noise=drop='gt(pts/tb\,30)*key' "$2" ; } dither() { convert "$1" -filter box -resize 700 -ordered-dither o4x4,2 "$2" ; } ditherc() { convert "$1" -colorspace RGB -filter box -resize 700 -ordered-dither o4x4,2 -colorspace sRGB "$2" ; }