From e1ba233753beaf85522a3bfa15264b8ce357049d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Fri, 11 Apr 2025 12:53:14 +0200 Subject: [PATCH] sync-camera: copy MOV file and *then* convert. This is important to at least not keep files on the device for too long. --- sync-camera | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sync-camera b/sync-camera index 920a2c8..01e8b1e 100755 --- a/sync-camera +++ b/sync-camera @@ -88,8 +88,12 @@ do OUTPUT_PATH="$OUTPUT_DIR/${INPUT_FILE##*/}" if ! [ -f "$OUTPUT_PATH" ] then + echo "Copying $INPUT_FILE to ${OUTPUT_PATH} ..." + cp "${INPUT_FILE}" "${OUTPUT_PATH}" echo "Converting ${INPUT_FILE} to MP4 at ${OUTPUT_PATH::-4}.mp4 ..." - ffmpeg -loglevel fatal -nostdin -i "$INPUT_FILE" "${OUTPUT_PATH::-4}.mp4" + ffmpeg -loglevel fatal -nostdin -i "$OUTPUT_PATH" "${OUTPUT_PATH::-4}.mp4" + echo "Removing temporary file $OUTPUT_PATH ..." + rm "$OUTPUT_PATH" fi if [ $REMOVE_FILES -eq 1 ]