~scripts
47 itemsDownload ./*


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


scriptsscan.sh
501 month agoDownloadRawClose


#!/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 at twily dot info
©twily.info 2013 - 2020



1 442 516 visits
... ^ v