~scripts
58 itemsDownload ./*

58 itemsDownload ./*

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


scriptsscan.sh
1 019•  4 years ago•  DownloadRawClose
4 years ago•  1 019

{}
#!/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 158 814 visits
... ^ v