this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

vid2gif: new script to turn a video into gif with ffmpeg

yemou 56cb6ab7 a0196a34

+41 -4
+23
.nix/vid2gif.nix
··· 1 + { writeScriptBin 2 + , bash 3 + , coreutils 4 + , ffmpeg 5 + , ... 6 + }: 7 + 8 + writeScriptBin "vid2gif" (builtins.replaceStrings 9 + [ 10 + "#!/bin/sh" 11 + "mktemp" 12 + "rm" 13 + "ffmpeg" 14 + ] 15 + [ 16 + "#!${bash}/bin/sh" 17 + "${coreutils}/bin/mktemp" 18 + "${coreutils}/bin/rm" 19 + "${ffmpeg}/bin/ffmpeg" 20 + ] 21 + (builtins.readFile ../scritps/vid2gif) 22 + ) 23 +
+3 -3
flake.lock
··· 2 2 "nodes": { 3 3 "nixpkgs": { 4 4 "locked": { 5 - "lastModified": 1726062873, 6 - "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=", 5 + "lastModified": 1770841267, 6 + "narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=", 7 7 "owner": "NixOS", 8 8 "repo": "nixpkgs", 9 - "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f", 9 + "rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae", 10 10 "type": "github" 11 11 }, 12 12 "original": {
+3 -1
flake.nix
··· 17 17 prefon = final.callPackage ./.nix/prefon.nix { }; 18 18 scr = final.callPackage ./.nix/scr.nix { }; 19 19 thm = final.callPackage ./.nix/thm.nix { }; 20 + vid2gif = final.callPackage ./.nix/vid2gif.nix { }; 20 21 yemou-scripts = final.symlinkJoin { 21 22 name = "yemou-scripts"; 22 - paths = [ colorgrab prefon scr thm ]; 23 + paths = [ colorgrab prefon scr thm vid2gif ]; 23 24 }; 24 25 }; 25 26 ··· 29 30 prefon = pkgs.prefon; 30 31 scr = pkgs.scr; 31 32 thm = pkgs.thm; 33 + vid2gif = pkgs.vid2gif; 32 34 yemou-scripts = pkgs.yemou-scripts; 33 35 }); 34 36 };
+12
scritps/vid2gif
··· 1 + #!/bin/sh 2 + scale=${3:-0.2} 3 + filters="scale=iw*${scale}:-1:flags=lanczos" 4 + palette_file=$(mktemp --tmpdir XXX.png) 5 + 6 + [ -z "$1" ] && exit 1 7 + [ -z "$2" ] && exit 1 8 + 9 + ffmpeg -hide_banner -loglevel warning -i "$1" -vf "$filters,palettegen" -update true -y "$palette_file" 10 + ffmpeg -hide_banner -loglevel warning -i "$1" -i "$palette_file" -filter_complex "$filters,paletteuse" "$2" 11 + 12 + rm "$palette_file"