Last active
December 21, 2018 15:10
-
-
Save tyabu12/6d604a35fd8bc72650e9db1e63c9d71b to your computer and use it in GitHub Desktop.
Thumbnails generator script using VLC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VLC="vlc -I dummy" | |
TARGET_DIR="movies" | |
THUMBNAIL_DIR="movies/thumbnails" | |
THUMBNAIL_FMT="jpg" | |
set -eux | |
gen_options() { | |
local options='' | |
while read target; do | |
filename=`basename $target`; | |
filename=${filename%.*}; | |
options="$options $target \ | |
--rate=1 \ | |
--video-filter=scene \ | |
--vout=dummy \ | |
--start-time=10 \ | |
--stop-time=11 \ | |
--scene-format=$THUMBNAIL_FMT \ | |
--scene-ratio=24 \ | |
--scene-prefix=${filename}_ \ | |
--scene-path=$THUMBNAIL_DIR" | |
done | |
echo $options | |
return 0 | |
} | |
$VLC `find $TARGET_DIR -mindepth 1 -type f | gen_options` "vlc://quit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment