~scripts
55 itemsDownload ./*

55 itemsDownload ./*

..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
ana-wall.sh
battery-monitor
brightness.sh
checkit
cleverbot.py
clock
color-gen
colors-hex
colorscheme.sh
compton
dailywall
dmenu
ffthumb
grid
gridmacro
gridmacro.kde
help
importw
indexer
install-all.sh
install-twily.sh
installng
keep-on
mp3ogg
orage
pipes
pipes.x
pipewire_bt.sh
ports
rain
randwall
rotate.sh
scan.sh
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptsscan.sh
880•  4 years ago•  DownloadRawClose
4 years ago•  880

{}
#!/bin/bash

IN="$1" # eg. ./folder/video.mp4

SIZE_W=180
SIZE_H=140

rm -rf ./thumbs
mkdir ./thumbs

echo "processing" > ./thumbs/imgready.log

LN=$(ffprobe -i "$IN" -show_entries format=duration -v quiet -of csv='p=0')
WH=$(ffprobe -i "$IN" -show_streams -v quiet|grep "width\|height" | cut -d = -f 2)
WH=(${WH[0]})
W=${WH[0]}
H=${WH[1]}

#ffmpeg -i "../_files/vid/$IN" -vf "fps=30/$LN,scale=$SIZE_W:$SIZE_H" ./thumbs/img%03d.jpg -y

ASPECT=$(echo "$W/$H" | bc -l)
POS=$(echo "(($SIZE_H*$ASPECT)-$SIZE_W)/2" | bc)

ffmpeg -ss 00:00:00.0 -i "$IN" -vf "fps=30/$LN,scale=-1:$SIZE_H,crop=$SIZE_W:$SIZE_H:$POS:0" ./thumbs/img%03d.jpg -y

echo "ready" > ./thumbs/imgready.log

montage -density 300 -tile 6x5 -geometry +5+5 -border 0 ./thumbs/*.jpg ./thumbs/out.png

exit

Top
©twily.info 2013 - 2024
twily at twily dot info



2 045 082 visits
... ^ v