Skip to content

Instantly share code, notes, and snippets.

@xunzhou
Created July 22, 2023 19:06
Show Gist options
  • Save xunzhou/980c1b8ffeb12c12bcc728018b633896 to your computer and use it in GitHub Desktop.
Save xunzhou/980c1b8ffeb12c12bcc728018b633896 to your computer and use it in GitHub Desktop.
screenshot at T-3
#!/bin/bash
OLD_IFS=$IFS
IFS=$'\0'
for i in *.webm; do
T=$(ffprobe -i $i -show_format -v quiet | sed -n 's/duration=//p' | awk -F. '{print $1-3}')
ffmpeg -i $i -ss $T -vframes 1 output/"${i%.*}.png"
done
IFS=$OLD_IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment