Script header

#! /usr/bin/env bash

Functions

function setup {
    mkdir audio/
    mkdir thumbs/
    mkdir out/
    }

setup

ffmpeg examples

See ffmpeg

Bash expansions

"${f%.mp4}.m4a"

The {} is the expansion. % matches last occurrence of pattern in string. Pattern is set by the text after the symbol.

ffmpeg -i "$f" -vn -acodec copy "${f%.mp4}.m4a"

Loop through directory

for f in *.mp4
do 
ffmpeg -i "$f" -vn -acodec copy "${f%.mp4}.m4a"
done

Loop through a string

while read -r line; do
    echo "... $line ..."
done <<< "$list"