Archived
1
0
Fork 0

Thunbnail of whole Video

This commit is contained in:
Findus23 2015-11-16 17:39:53 +01:00
parent 2bd5241c62
commit 773f614b89

View file

@ -43,10 +43,11 @@ then
if [ "$setting" -gt "${duration%.*}" ] if [ "$setting" -gt "${duration%.*}" ]
then then
echo "$(tput setaf 1)video is shorter than $setting seconds$(tput sgr0)" 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 fi
frames=$((${tile/"x"/"*"})) # 3x3 -> 3*3 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 echo $sec_between
< /dev/null ffmpeg -y -i $inputfile -vsync 0 -vf "fps=1/$sec_between,tile=$tile" -frames:v 1 $outputfile < /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 # alternativ: select every x frame https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect