summaryrefslogtreecommitdiff
path: root/app-misc/ctpv/files/thumbnail-grid.diff
blob: 8645b37a2a5ecd9616f6f27b19bc4cb0e4acdc25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git i/sh/prev/video.sh w/sh/prev/video.sh
index 3e85e4f..d3d9f74 100644
--- i/sh/prev/video.sh
+++ w/sh/prev/video.sh
@@ -1,7 +1,11 @@
 # video: ffmpegthumbnailer
 
 video() {
-	ffmpegthumbnailer -i "$f" -o "$cache_f" -s 0 -t 50% 2>/dev/null
+	_wh=$(ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x "$f")
+	_w=$(echo "${_wh%%x*}/4" | bc)
+	_h=$(echo "${_wh##*x}/4" | bc)
+	thumbnail-grid -r 4 -c 4 -q 100 -w $_w -h $_h "$f" "$cache_f" 2>/dev/null
+	magick "$cache_f" "JPG:$cache_f"
 }
 
 convert_and_show_image video