initial working ffmpeg static/shared

This commit is contained in:
2025-04-20 09:43:08 -05:00
parent b907d4936c
commit 56d07f44be
11 changed files with 699 additions and 0 deletions

35
scripts/common.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034
# ANSI colors
RED='\e[0;31m'
CYAN='\e[0;36m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
NC='\e[0m'
# echo wrappers
echo_fail() { echo -e "${RED}FAIL${NC}:" "$@" ; }
echo_info() { echo -e "${CYAN}INFO${NC}:" "$@" ; }
echo_pass() { echo -e "${GREEN}PASS${NC}:" "$@" ; }
echo_warn() { echo -e "${YELLOW}WARN${NC}:" "$@" ; }
echo_exit() { echo_fail "$@" ; exit 1 ; }
echo_if_fail() {
local cmd=("$@")
local out="/tmp/.stdout-${RANDOM}"
local err="/tmp/.stderr-${RANDOM}"
"${cmd[@]}" > ${out} 2> ${err}
local retval=$?
if ! test ${retval} -eq 0; then
echo
echo_fail "command [" "${cmd[@]}" "] failed"
echo_warn "command output:"
tail -n 10 ${out}
tail -n 10 ${err}
echo
fi
rm ${out} ${err}
return ${retval}
}