function generate_video()
{
+ local png_files
+
if which ffmpeg 1> /dev/null 2>&1; then
- if [ -f ${dest}/${group}-f1.png ]; then
+ set +e
+ png_files=$(ls ${dest}/${group}-f*.png 2> /dev/null)
+ set -e
+
+ if [ x"${png_files}" != x"" ]; then
log_dbg "generate_video start"
if [ ${dry_run} -eq 1 ]; then
touch ${dest}/${group}.mp4
else
- ffmpeg ${FFMPEG_OPTS} -r ${fps} -start_number 1 -i ${dest}/${group}-f%d.png ${dest}/${group}.mp4
+ ffmpeg ${FFMPEG_OPTS} -r ${fps} -pattern_type glob -i "${dest}/${group}-f*.png" ${dest}/${group}.mp4
fi
log_dbg "generate_video: end"