]> git.plutz.net Git - serve0/commitdiff
performance: prescale thumbnails befor montage
authorPaul Hänsch <paul@plutz.net>
Tue, 17 Jun 2025 19:04:51 +0000 (21:04 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 17 Jun 2025 19:04:51 +0000 (21:04 +0200)
thumbnail.sh

index 09f5ab0b2330adb18b646fd14137e7c9afe8e5af..f13ec1cf12180de4bcf4987361bc040d62b7e31b 100755 (executable)
@@ -14,9 +14,11 @@ gen_thumb(){
     # ffmpeg -nostdin -y -i "$file" -vf fps=11/$length,scale=320:-2 -frames 10 "$tmp/thumb_%02d.jpg" 2>&-
 
     for n in 1 2 3 4 5 6 7 8 9 10; do
-      ffmpeg -nostdin -y -ss "$((n * length / 11))" -i "$file" -frames 1 "$tmp/thumb_$((n - 1)).jpg" 2>&-
+      nice -4 \
+      ffmpeg -nostdin -y -ss "$((n * length / 11))" -i "$file" -frames 1 -filter scale=640:-2 "$tmp/thumb_$((n - 1)).jpg" 2>&-
     done
 
+    nice -4 \
     montage "$tmp"/thumb_[0-9].jpg \
             -background "$bgcolor" \
             -tile 10x1 -geometry 320x180+0+0 \