From 0be58cabb4588860631c8340438316ce55a3222a Mon Sep 17 00:00:00 2001 From: Davide Polonio Date: Mon, 6 Sep 2021 11:48:25 +0200 Subject: [PATCH] feat: add first demuxer function Still WIP, not working --- kioskgen.sh | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 kioskgen.sh diff --git a/kioskgen.sh b/kioskgen.sh new file mode 100644 index 0000000..f2fb2c7 --- /dev/null +++ b/kioskgen.sh @@ -0,0 +1,100 @@ +#!/bin/env bash + +set -e + +LONG_ARGUMENTS=( + "output:" + "debug" + "help" +) +SHORT_ARGUMENTS=( + "o:" + "d" + "h" +) +OPTS=$(getopt \ + --longoptions "$(printf "%s," "${LONG_ARGUMENTS[@]}")" \ + --options "$(printf "%s," "${SHORT_ARGUMENTS[@]}")" \ + --name "$(basename "${0}")" \ + -- "${@}" + ) + +eval set -- "${OPTS}" + +### Utility functions ### +print_help() { + echo "$(basename "${0}") [FLAGS...] FOLDER + + + +Parameters: +-d --debug Enable debug output +-h --help This very help +" +} + +err() { + echo "${@}" >&2 +} + +create_demuxer_file() { + local demuxer_file="$(mktemp)" + local entry_template=<> "${demuxer_file}" +file '${img_to_demux}' +duration ${random_duration} +EOF + done + + echo "file '${last_img}'" >> "${demuxer_file}" +} +######################## + + +### Config ### +VIDEO_TITLE="output" +MAX_PHOTO_DURATION_SECONDS=10 +############## + + +while [[ $# -gt 0 ]]; do + case "${1}" in + --debug) + set -x + shift 1 + ;; + -d) + set -x + shift 1 + ;; + --help) + print_help + exit 0 + ;; + -h) + print_help + exit 0 + ;; + --) + shift 1 + break + ;; + esac +done + +INPUT_FOLDER="${1}" +shift 1 +