Skip to content

Instantly share code, notes, and snippets.

@llllvvuu
Created April 12, 2017 22:51
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 llllvvuu/f4f5e79ba8956372c810fb171cd14a48 to your computer and use it in GitHub Desktop.
Save llllvvuu/f4f5e79ba8956372c810fb171cd14a48 to your computer and use it in GitHub Desktop.
command line script to grab frames from video files with .ass subs using fast seek
infile=$1
shift
outfile=$1
shift
ffmpeg -dump_attachment:t "" -i "$infile"
mv *.ttf *.TTF *.otf *.OTF *.ttc *.TTC ~/.fonts
fc-cache -fv ~/.fonts
ffmpeg -i "$infile" -map 0:s:0 subs.ass
for var in "$@"
do
ffmpeg -ss $var -i subs.ass subs2.ass
ffmpeg -ss $var -i "$infile" -vf ass=subs2.ass -vframes 1 "$outfile $var.png"
rm subs2.ass
done
rm subs.ass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment