FORUMS: list search recent posts

i-frame recognition

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Doug Bay
i-frame recognition
on Oct 9, 2012 at 2:15:16 pm

I need a CLI application that will analyze a video file and output the i-frame location as timecode or framenumber in text. I know its a long shot for ffmpeg to do something like this as ffmpeg is not made to analyze video, but its worth asking. Any suggestions?


Doug



Return to posts index

Michael Rampe
Re: i-frame recognition
on Oct 9, 2012 at 8:53:03 pm

[Doug Bay] "I know its a long shot for ffmpeg to do something like this"

Not at all!

FFprobe (which installs with newer FFmpeg builds) is your candidate.

$ ffprobe -show_frames input.mp4

This will print out various attributes for each frame.
What you are after is "coded_picture_number=" for the frame and "pict_type=" for frame type (I,P or B).

I usually use grep to turn this into useful data without all of the other noise.

For your requirements:
$ ffprobe -show_frames input.mp4 2> /dev/null | grep 'coded_picture_number|pict_type'

It is important to note that the "coded_picture_number" starts logically at 0 so you may need to offset this by 1 depending on how you use the output.

Michael


Return to posts index

Michael Rampe
Re: i-frame recognition
on Oct 10, 2012 at 5:57:25 am

I just realised my escape slash was removed by the text editor as an escape slash;-(

this:... grep 'coded_picture_number|pict_type'

should read

grep 'coded_picture_number\|pict_type'

Michael


Return to posts index


Reuben Martin
Re: i-frame recognition
on Oct 11, 2012 at 5:20:10 am

There is also a filter that will give frame info.


ffplay input.mp4 -vf showinfo |& grep 'type:I'


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]