From 721f85651243b6bce8b5cd6c17877bc9be5b6669 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 23 Dec 2024 21:17:01 -0500 Subject: [PATCH] Script to generate QR code video --- video.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 video.sh diff --git a/video.sh b/video.sh new file mode 100644 index 0000000..20b2bbe --- /dev/null +++ b/video.sh @@ -0,0 +1,25 @@ +#/bin/bash + +W=800 +H=600 + +TMP=$(mktemp -d) + +ffmpeg -ss 203 -i "${1}" -r 8 -t 10 -s 19x14 "${TMP}/frame_%06d.png" + +QR=$(mktemp -d) + +source env/bin/activate + +for FILE in "${TMP}/"*; do + FILENAME=$(basename "${FILE}") + echo "${FILENAME}..." + bash generate.sh "${FILE}" "${QR}/${FILENAME}" +done + +deactivate + +ffmpeg -y -framerate 8 -pattern_type glob -i "${QR}/frame_"'*.png' -c:v libx264 -r 24 -pix_fmt yuv420p -vf "scale=${W}:${H}:force_original_aspect_ratio=decrease,pad=${W}:${H}:-1:-1:color=white" "${2}" + +rm -rf "${QR}" +rm -rf "${TMP}" \ No newline at end of file