Can you tell me the command for extracting the index of key frames from a video using ffmpeg in Windows. I tried

ffprobe -select_streams v -show_frames \-show_entries frame=pict_type \-of csv bbb480.avi \| grep -n I | cut -d ':' -f 1 > frame_indices.txt

but this error is displayed:

'grep' is not recognized as an internal or external command, operable program or batch file

    On Windows, grep isn't available unless you install a package such as a port of coreutils.

    Anyway, you can run

    ffprobe in.mp4 -select_streams v -show_entries frame=key_frame,pkt_pts_time -of csv=nk=1:p=0 | findstr "1,"
    • Thank you sir for answering the question .But by using above command I am getting only key frame time instant not keyframe index.Can you please suggest the command for keyframe index. Thank you sir.– B GaneshJul 28 '16 at 15:28

    Your Answer


    By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.