How can I check keyframe interval of a video file?
all I can see in ffmpeg output is:
Metadata:
metadatacreator : Yet Another Metadata Injector
The following command will give you the offsets of all key Frames in the Video
ffprobe -show_frames -select_streams v:0 \
-print_format csv Video.mov 2> /dev/null |
stdbuf -oL cut -d ',' -f4 |
grep -n 1 |
stdbuf -oL cut -d ':' -f1
Note that the command might respond a little late. Have patience :-)
The ffprobe
command gives you the frame level details in CSV format. Rest is a smart combination of cut
and grep
commands.
cut -d ',' -f4
filters the fourth column - this refers to the 'key_frame' flag.
grep -n 1
filters the key-frames only, and shows their line numbers in the CSV feed.
The
stdbuf -oL
with the cut
command manipulates the buffer of the cut command.