From 773f614b89368669d718efc953117277563d379d Mon Sep 17 00:00:00 2001 From: Findus23 Date: Mon, 16 Nov 2015 17:39:53 +0100 Subject: [PATCH] Thunbnail of whole Video --- thumbnail.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thumbnail.sh b/thumbnail.sh index eb6d516..af8b21e 100755 --- a/thumbnail.sh +++ b/thumbnail.sh @@ -43,10 +43,11 @@ then if [ "$setting" -gt "${duration%.*}" ] then echo "$(tput setaf 1)video is shorter than $setting seconds$(tput sgr0)" - exit 1 + LC_NUMERIC=C setting=$( printf "%.0f" $duration ) + echo "$(tput setaf 2)generating thumbnails from full video ($setting seconds)$(tput sgr0)" fi frames=$((${tile/"x"/"*"})) # 3x3 -> 3*3 - sec_between=$(python3 -c "print($setting/$frames)") + sec_between=$(python3 -c "print(int(round($setting/$frames)))") echo $sec_between < /dev/null ffmpeg -y -i $inputfile -vsync 0 -vf "fps=1/$sec_between,tile=$tile" -frames:v 1 $outputfile # alternativ: select every x frame https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect