Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
LAST=""
LINE=0
while read TIME
do
if [ -n "$LAST" ]
then
NAME=$(cat names.txt | head -n $LINE | tail -1)
START="ffmpeg -i input.mkv -ss $LAST -to $TIME"
$START -c:a flac "$NAME.flac"
fi
LAST="$TIME"
LINE=$(($LINE + 1))
done < times.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment