fps=8
debug=0
-
+trames=1
SED=sed
# -limit memory 5000mb -limit disk 5gb
echo
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 " -r nombre de trames par seconde (FPS)"
echo " -h affiche ce message d'aide"
}
-while getopts "dhr:" flag ;do
+while getopts "dhfr:" flag ;do
case ${flag} in
d)
debug="1"
;;
+ f)
+ trames=0
+ ;;
r)
fps="${OPTARG}"
;;
fi
done
-identify ${IM_OPS} -verbose -format "label:%l,geometry:%g\n" ${src} > ${layers}
-
-# Ignore empty labels:
-${SED} -i -e /label:,.*/d ${layers}
+if [ ${trames} -eq 1 ]; then
+ identify ${IM_OPS} -verbose -format "label:%l,geometry:%g\n" ${src} > ${layers}
-# Extract global frame size:
-size=$(get_size "${main_layer}")
+ # Ignore empty labels:
+ ${SED} -i -e /label:,.*/d ${layers}
-log_dbg "CANVAS SIZE=${size}"
+ # Extract global frame size:
+ size=$(get_size "${main_layer}")
-# Create background frame:
-convert -size ${size} xc:none ${dest}/background.png
+ log_dbg "CANVAS SIZE=${size}"
-# Remove first line (Layer 558):
-${SED} -i -e '1d' ${layers}
+ # Create background frame:
+ convert -size ${size} xc:none ${dest}/background.png
-# Will start at frame 2 at first loop iteration
-f=1
+ # Remove first line (Layer 558):
+ ${SED} -i -e '1d' ${layers}
-files=""
+ # Will start at frame 2 at first loop iteration
+ f=1
-while read l; do
- f=$((${f} + 1))
+ files=""
- label=$(get_label "${l}")
- p=$(get_pos "${l}")
- nf=$(get_frame_id "${l}")
+ while read l; do
+ f=$((${f} + 1))
- log_dbg "Couche ${f}"
- log_dbg " nom: ${label}"
- log_dbg " pos: ${p}"
+ label=$(get_label "${l}")
+ p=$(get_pos "${l}")
+ nf=$(get_frame_id "${l}")
- if is_skip_label "${label}"; then
- log_dbg " skip..."
- continue
- fi
+ log_dbg "Couche ${f}"
+ log_dbg " nom: ${label}"
+ log_dbg " pos: ${p}"
- files="${files} -page ${p} ${src}[${f}]"
+ if is_skip_label "${label}"; then
+ log_dbg " skip..."
+ continue
+ fi
- if [ x"${nf}" != x"" ]; then
- log_dbg "New frame ID: ${nf}"
- convert -colorspace sRGB -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/f${nf}.png
- files=""
- fi
+ files="${files} -page ${p} ${src}[${f}]"
-done <${layers}
+ if [ x"${nf}" != x"" ]; then
+ log_dbg "New frame ID: ${nf}"
+ convert -colorspace sRGB -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/f${nf}.png
+ files=""
+ fi
+ done <${layers}
+fi
if which ffmpeg 1> /dev/null 2>&1; then
# Conversion vidéo: