#!/usr/bin/env bash # ## DESCRIPTION: Transcode with FFmpeg all (mkv, mp4) media files in specified directory, ## overwriting the original source files. ## ## AUTHOR: Travis Runyard ## Revised: 10/31/2020 ## URL: https://sysinfo.io/ffmpeg-batch-transcode-audio/ # Exit on first non-zero exit code set -e # Set shell options shopt -s globstar shopt -u nullglob # Declare variables (optionally) are indexed arrays # Only associative arrays require declaration, but standardizing is a good thing declare -a FILENAME declare -a LOG # Modify TEMPDIR and WORKDIR to suit your needs TEMPDIR="/mnt/pool0/p0ds0smb/temp/ffmpeg" WORKDIR="$TEMPDIR/.working" SCRIPT_NAME=$(basename "$0") usage() { cat 1>&2 <