Skip to content

Instantly share code, notes, and snippets.

@kane-thornwyrd
Created January 30, 2025 22:00
Show Gist options
  • Save kane-thornwyrd/86a95e823593af3ee33a03168e522242 to your computer and use it in GitHub Desktop.
Save kane-thornwyrd/86a95e823593af3ee33a03168e522242 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
readarray -t ts
path=$1
fn=${1##*/}
dir=${path%$fn}
name=${fn%.*}
ext=${fn#$name}
for ((i=1; i<${#ts[@]}; i++)); do
printf -v part '%02d' "$i"
echo ffmpeg -ss "${ts[i-1]}" -to "${ts[i]}" -i "$path" "$dir$name-$part$ext"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment