Skip to content

Instantly share code, notes, and snippets.

@kiwec
Last active July 3, 2017 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiwec/f271790c605112d3505cdea04e25acaa to your computer and use it in GitHub Desktop.
Save kiwec/f271790c605112d3505cdea04e25acaa to your computer and use it in GitHub Desktop.
#!/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