I'm trying to get the list of indexes for all I-frames in a video in Python (and later save a portion of them as JPEG
). Right now, I can traverse all frames using FFProbe
in terminal, and see which one is I-frame:
ffprobe -select_streams v -show_frames -show_entries frame=pict_type -of csv 18s.mp4
which gives me something like this:
frame,I
frame,B
frame,P
frame,B
frame,P
frame,B
But how can I do that in Python (I'm in Windows) and get a list of all their indexes?