All pastes #194001 Raw Edit

movies_preview.sh

public text v1 · immutable
·published 2006-10-07 13:03 UTC
rendered paste body
#!/bin/sh

FFMPEG='ffmpeg'
CONVERT='convert'

while [ "$#" -ne 0 ]; do
    if [ -f  "$1" ]; then
	echo "$1" "${1%.*}.png"
	i=0
	while [ "$i" -lt 60 ]; do
	    ${FFMPEG} -i "$1" -y -vcodec png -vframes 1 -an -f rawvideo -ss 00:01:"$i" - | convert - -quality 95 "${1%.*}_$(printf '%03d' $i).jpg"
	    i=$((i+7))
	done
#| ${CONVERT} - -thumbnail 100x100 "${1%.*}.png"
#${FFMPEG} -i "$1" -y -vcodec png -vframes 1 -an -f rawvideo -ss 00:01:00 - | ${CONVERT} - -thumbnail 100x100 "${1%.*}.jpg"
    fi
    shift
done