Skip to content

Instantly share code, notes, and snippets.

@imaami
Created December 30, 2019 17:16
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 imaami/224d7d7dcf61dbea6f38fb0ecd36c868 to your computer and use it in GitHub Desktop.
Save imaami/224d7d7dcf61dbea6f38fb0ecd36c868 to your computer and use it in GitHub Desktop.
Get frame indices + timestamps from video file.
#!/bin/bash
#
# Extract list of zero-based frame indices with timestamps.
#
ffprobe -v error -show_entries frame=pkt_pts_time \
-select_streams v -of csv=p=0 "$1" | grep -n '^' \
| while read L; do
i="${L%%:*}"
echo "$((i-1)):${L#*:}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment