]> git.plutz.net Git - serve0/commitdiff
allow background color
authorPaul Hänsch <paul@plutz.net>
Sat, 2 Oct 2021 19:54:33 +0000 (21:54 +0200)
committerPaul Hänsch <paul@plutz.net>
Sat, 2 Oct 2021 19:54:33 +0000 (21:54 +0200)
thumbnail.sh

index 4a6f828b846f7a213830ff8361afafb79dac0707..a2686be02e8b30e69ca0e98179c34d920af7aaaa 100644 (file)
@@ -4,7 +4,8 @@
 include_thumbnails="$0"
 
 gen_thumb(){
-  local file="$1" thumb="$2" tmp="${TMPDIR:-/tmp}/serve0tmp_$$/" lenght n
+  local file="$1" thumb="$2" bgcolor="${3:-#000000}"
+  local tmp="${TMPDIR:-/tmp}/serve0tmp_$$/" lenght n
 
   if [ "${file%.part}" = "${file}" -a ! -s "$thumb" -a -s "$file" ] && mkdir "$tmp"; then
     length="$( ffprobe -show_entries stream=duration "$file" 2>&- )"
@@ -17,6 +18,7 @@ gen_thumb(){
     done
 
     montage "$tmp"/thumb_[0-9].jpg \
+            -background "$bgcolor" \
             -tile 10x1 -geometry 320x180+0+0 \
             -interlace line -quality 85 "$thumb"
     rm -r -- "${tmp}"