lf: use ffmpegthumbnailer for video thumbnail preview

This commit is contained in:
krolxon 2025-12-08 23:59:08 +05:30
parent 22b8483178
commit ffd4a5b1c4
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,11 @@ case "$(file -Lb --mime-type -- "$1")" in
image/*) image/*)
chafa -f sixel -s "$2x$3" --animate off --polite on -t 1 --bg black "$1" chafa -f sixel -s "$2x$3" --animate off --polite on -t 1 --bg black "$1"
;; ;;
video/*)
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0
chafa -f sixel -s "$2x$3" --animate off --polite on -t 1 --bg black "$CACHE"
;;
text/*) text/*)
bat "$1" bat "$1"
;; ;;