this repo has no description
0
fork

Configure Feed

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

vid2gif: add more descriptive error messages instead of just exiting

yemou 0e3ff583 5d871848

+13 -4
+4 -2
nix/vid2gif.nix
··· 10 10 builtins.replaceStrings 11 11 [ 12 12 "#!/bin/sh" 13 + "ffmpeg" 13 14 "mktemp" 15 + "printf" 14 16 "rm" 15 - "ffmpeg" 16 17 ] 17 18 [ 18 19 "#!${bash}/bin/sh" 20 + "${ffmpeg}/bin/ffmpeg" 19 21 "${coreutils}/bin/mktemp" 22 + "${coreutils}/bin/printf" 20 23 "${coreutils}/bin/rm" 21 - "${ffmpeg}/bin/ffmpeg" 22 24 ] 23 25 (builtins.readFile ../scritps/vid2gif) 24 26 )
+9 -2
scritps/vid2gif
··· 3 3 filters="scale=iw*${scale}:-1:flags=lanczos" 4 4 palette_file=$(mktemp --tmpdir XXX.png) 5 5 6 - [ -z "$1" ] && exit 1 7 - [ -z "$2" ] && exit 1 6 + [ -z "$1" ] && { 7 + printf '%s\n' "${0##*/}: missing input video" 8 + exit 1 9 + } 10 + 11 + [ -z "$2" ] && { 12 + printf '%s\n' "${0##*/}: missing output gif" 13 + exit 1 14 + } 8 15 9 16 ffmpeg -hide_banner -loglevel warning -i "$1" -vf "$filters,palettegen" -update true -y "$palette_file" 10 17 ffmpeg -hide_banner -loglevel warning -i "$1" -i "$palette_file" -filter_complex "$filters,paletteuse" "$2"