debug=0
trames=1
+dry_run=0
+
SED=sed
FFMPEG_OPTS="-hide_banner -loglevel error -y"
echo "Options:"
echo " -d affiche les informations de debug"
echo " -f ne regénère pas les trames, mais uniquement la séquence vidéo"
+ echo " -n mode de test (dry-run)"
echo " -r nombre de trames par seconde (FPS)"
echo " -h affiche ce message d'aide"
}
-while getopts "dhfr:" flag ;do
+while getopts "dhfnr:" flag ;do
case ${flag} in
d)
debug="1"
f)
trames=0
;;
+ n)
+ dry_run=1
+ ;;
r)
fps="${OPTARG}"
;;
if [ x"${ng}" != x"" ]; then
if which ffmpeg 1> /dev/null 2>&1; then
if [ -f ${dest}/${group}-f1.png ]; then
- # Conversion vidéo:
- ffmpeg ${FFMPEG_OPTS} -r ${fps} -start_number 1 -i ${dest}/${group}-f%d.png ${dest}/${group}.mp4
+ if [ ${dry_run} -eq 0 ]; then
+ # Conversion vidéo:
+ ffmpeg ${FFMPEG_OPTS} -r ${fps} -start_number 1 -i ${dest}/${group}-f%d.png ${dest}/${group}.mp4
+ fi
fi
fi
fi
log_dbg "New frame ID: ${nf}"
- convert -colorspace sRGB -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/${group}-f${nf}.png
+
+ if [ ${dry_run} -eq 1 ]; then
+ touch ${dest}/${group}-f${nf}.png
+ else
+ convert -colorspace sRGB -page +0+0 ${dest}/background.png \
+ ${files} -background none -layers merge \
+ ${dest}/${group}-f${nf}.png
+ fi
+
files=""
oldnf="${nf}"
fi