Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timelapse.sh: hide output by default #624

Merged
merged 2 commits into from
Oct 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions scripts/timelapse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ $# -lt 1 -o $# -gt 2 -o "${1}" = "-h" -o "${1}" = "--help" ] ; then
echo " or: ${ME} ${TODAY} /media/external/allsky"
echo -en "${YELLOW}"
echo "'DATE' must be in '${ALLSKY_IMAGES}' unless 'directory' is specified,"
echo "in which case 'DATE' must bin in 'directory', i.e., 'directory/DATE'."
echo "in which case 'DATE' must be in in 'directory', i.e., 'directory/DATE'."
echo -en "${NC}"
exit 1
fi
Expand Down Expand Up @@ -102,24 +102,27 @@ OUTPUT_FILE="${DATE_DIR}/allsky-${DATE}.mp4"
ffmpeg -y -f image2 \
-loglevel ${FFLOG:-warning} \
-r ${FPS:-25} \
-i ${SEQUENCE_DIR}/%04d.${EXTENSION} \
-i "${SEQUENCE_DIR}/%04d.${EXTENSION}" \
-vcodec ${VCODEC:-libx264} \
-b:v ${TIMELAPSE_BITRATE:-2000k} \
-pix_fmt ${PIX_FMT:-yuv420p} \
-movflags +faststart \
$SCALE \
${TIMELAPSE_PARAMETERS} \
${OUTPUT_FILE}
"${OUTPUT_FILE}" >> "${TMP}" 2>&1
RET=$?
if [ $RET -ne 0 ]; then
echo -e "\n${RED}*** $ME: ERROR: ffmpeg failed with RET=$RET"
if [ $RET -ne -0 ]; then
echo -e "\n${RED}*** $ME: ERROR: ffmpeg failed."
echo "Error log is in '${TMP}'."
echo
echo "Links in '${SEQUENCE_DIR}' left for debugging."
echo -e "Remove them when the problem is fixed.${NC}\n"
exit 1
fi
[ "${FFLOG}" = "info" ] && cat "${TMP}" # if the user wants output, give it to them...

if [ "$KEEP_SEQUENCE" = "false" ] ; then
rm -rf $DIR/sequence
if [ "${KEEP_SEQUENCE}" = "false" ] ; then
rm -rf "${SEQUENCE_DIR}"
else
echo -en "${ME}: ${GREEN}Keeping sequence${NC}\n"
fi
Expand Down