Created
December 30, 2019 17:16
-
-
Save imaami/224d7d7dcf61dbea6f38fb0ecd36c868 to your computer and use it in GitHub Desktop.
Get frame indices + timestamps from video file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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