]> git.plutz.net Git - serve0/commitdiff
improved reliability
authorPaul Hänsch <paul@plutz.net>
Sat, 2 Oct 2021 20:01:28 +0000 (22:01 +0200)
committerPaul Hänsch <paul@plutz.net>
Sat, 2 Oct 2021 20:01:28 +0000 (22:01 +0200)
thumbnail.sh

index a2686be02e8b30e69ca0e98179c34d920af7aaaa..09f5ab0b2330adb18b646fd14137e7c9afe8e5af 100644 (file)
@@ -8,7 +8,7 @@ gen_thumb(){
   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>&- )"
+    length="$( ffprobe -show_entries format=duration "$file" 2>&- )"
     length="${length#*duration=}" length="${length%%${BR}*}" length="${length%.*}"
   
     # ffmpeg -nostdin -y -i "$file" -vf fps=11/$length,scale=320:-2 -frames 10 "$tmp/thumb_%02d.jpg" 2>&-