dosbox-x/mtavi2wav.sh
Robert de Rooy 694cc766a4 Cleanup Bash scripts.
This makes them pass shellcheck. Except for a few unused
export warnings.

I also wonder if the majority of these files should be
in the root of the project, or should be moved to "build-scripts"
(or should still even exist).

a few minor changes

one more minor changes
2023-04-15 15:53:08 +02:00

20 lines
573 B
Bash
Executable File

#!/usr/bin/env bash
#
# Stupid multitrack audio hack for stupid Premiere.
# Turns a DOSBox-X multitrack AVI capture into several WAV files.
# Requires FFMPEG 3.0 or higher.
# get the track names. DOSBox-X always writes track names
declare -a NAMES
for x in $(ffprobe "${1}" 2>&1 | grep title | cut -d ':' -f 2 | sed -e 's/^ *//'); do
NAMES=("${NAMES[@]}" "${x}")
done
# do it
i=0
for name in "${NAMES[@]}"; do
name="${name// /_}" # in case of spaces
ffmpeg -i "${1}" -acodec copy -map 0:${i} -vn -y -f wav "${1}.${i}-${name}.wav" || break
i=$((i+1))
done