projects
/
fgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
bbd1154
)
Add dry-run option
author
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 7 Oct 2023 03:13:13 +0000
(23:13 -0400)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 7 Oct 2023 15:51:24 +0000
(11:51 -0400)
fgen.sh
patch
|
blob
|
history
diff --git
a/fgen.sh
b/fgen.sh
index
b6a45c2
..
1e92b1e
100755
(executable)
--- a/
fgen.sh
+++ b/
fgen.sh
@@
-17,6
+17,8
@@
fps=8
debug=0
trames=1
debug=0
trames=1
+dry_run=0
+
SED=sed
FFMPEG_OPTS="-hide_banner -loglevel error -y"
SED=sed
FFMPEG_OPTS="-hide_banner -loglevel error -y"
@@
-85,11
+87,12
@@
print_usage()
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 "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"
}
echo " -r nombre de trames par seconde (FPS)"
echo " -h affiche ce message d'aide"
}
-while getopts "dhfr:" flag ;do
+while getopts "dhf
n
r:" flag ;do
case ${flag} in
d)
debug="1"
case ${flag} in
d)
debug="1"
@@
-97,6
+100,9
@@
while getopts "dhfr:" flag ;do
f)
trames=0
;;
f)
trames=0
;;
+ n)
+ dry_run=1
+ ;;
r)
fps="${OPTARG}"
;;
r)
fps="${OPTARG}"
;;
@@
-190,8
+196,10
@@
if [ ${trames} -eq 1 ]; then
if [ x"${ng}" != x"" ]; then
if which ffmpeg 1> /dev/null 2>&1; then
if [ -f ${dest}/${group}-f1.png ]; then
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
fi
@@
-227,7
+235,15
@@
if [ ${trames} -eq 1 ]; then
fi
log_dbg "New frame ID: ${nf}"
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
files=""
oldnf="${nf}"
fi