Skip to content

Instantly share code, notes, and snippets.

@dsandler
Created December 16, 2022 15:48
Show Gist options
  • Save dsandler/af6e0afeed05aba19ed2dd6316cab3af to your computer and use it in GitHub Desktop.
Save dsandler/af6e0afeed05aba19ed2dd6316cab3af to your computer and use it in GitHub Desktop.
script to put the current frame number and elapsed time in the LL corner of a video
# framestamp.sh
# put the current frame number and elapsed time in the LL corner of a video
# (counts real frames, so vfr input will make the numbers stall from time to time)
if [ -z "$2" ]; then echo "usage: $0 input.mp4 output.mp4"; exit 2; fi
ffmpeg -i "$1" -vf "
drawtext=text='f=%{eif\:n\:d\:4}\ t=%{pts}': x=10: y=h-th-10:
fontcolor=white: fontsize=18: box=1: boxcolor=0x00000099
" -y "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment