#!/usr/bin/env bash # set -euo pipefail IFS=$'\n\t' DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function main { local cmd cmd=$1 shift if [ "$cmd" = "copy" ]; then copy "${@}" elif [ "$cmd" = "stream_software_h264" ]; then stream_software_h264 "${@}" elif [ "$cmd" = "stream_hardware_h264" ]; then stream_hardware_h264 "${@}" elif [ "$cmd" = "preprocess_software_h264" ]; then preprocess_software_h264 "${@}" elif [ "$cmd" = "preprocess_hardware_h264" ]; then preprocess_hardware_h264 "${@}" elif [ "$cmd" = "vp9" ]; then vp9 "${@}" elif [ "$cmd" = "preprocess_hardware_vp9" ]; then preprocess_hardware_vp9 "${@}" elif [ "$cmd" = "vp8" ]; then vp8 "${@}" elif [ "$cmd" = "software_vp8" ]; then software_vp8 "${@}" elif [ "$cmd" = "preprocess_h264" ]; then preprocess_h264 "${@}" elif [ "$cmd" = "preprocess_vp8" ]; then preprocess_vp8 "${@}" elif [ "$cmd" = "webcam" ]; then webcam "${@}" elif [ "$cmd" = "encode_webcam" ]; then encode_webcam "${@}" else (>&2 echo "Unknown command: $cmd") exit 1 fi } function copy { local file_to_cast file_to_cast="$3" local USERNAME PASSWORD USERNAME="$1" PASSWORD="$2" set -x