7

I want to extract information of a video file to get the count of its I/P/B frames. How to do it in ffmpeg? Or should I programming using libavformat and libavcodec to do it? Many thanks!

Treper
  • 3,539
  • 2
  • 26
  • 48

1 Answers1

12

On the command line use ffprobe -show_frames input_file. you can parse this input to get the frame type information.

You can also do ffprobe -show_frames inputfile | grep pict_type

The string to grep may vary depending on version of ffprobe you have.

Kenan
  • 13,156
  • 8
  • 43
  • 50
av501
  • 6,645
  • 2
  • 23
  • 34
  • 1
    this is amazingly slow; doing the same with ffmpeg is much faster; I'm currently looking for a faster solution as well. – Thomas Jun 01 '17 at 13:14