On Mon, Feb 23, 2009 at 7:27 PM, Mike Sullivan <[email protected]> wrote:
> On Mon, Feb 23, 2009 at 6:59 PM, Ronald S. Bultje <[email protected]> wrote:
>> Hi Mike,
>>
>> On Mon, Feb 23, 2009 at 9:53 PM, Mike Sullivan <[email protected]> wrote:
>>> I want to make a modified img2 format (or option to img2) to only save
>>> "keyframes" (the frames where the codec sends the whole frame, I think
>>> it is also called a B-Frame but I get confused about the terminology).
>>
>> I-frame?
>>
>>> The question is, how can I tell from an AVPacket if the current frame
>>> is a keyframe from the format_write_packet method?
>>
>> Well, that depends entirely on your encoding settings. You should be
>> able to read that from the codec's
>> AVCodecContext->coded_frame->keyframe or pict_type.
>>
>> Ronald
>> _______________________________________________
>> libav-user mailing list
>> [email protected]
>> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>>
>
> Great Ronald, thanks so much for the help!!
>
> -Mike
>

Ok, so now I am able to only deal with I frames, which is a step in
the right direction but I realized I'm still not completely there.

Lets say I use the following command:

ffmpeg -i mymovie.flv -r 2 moviejpgs-%08d.jpg


As the frames come in, I check if they are I-Frames and only save them
if they are.  As a result, I'm sometimes not saving any frames at all.

The problem is that since I used -r 2, I am inadvertently skipping
I-Frames.  In other words I will get a frame with a timestamp of .5
seconds, 1 second, 1.5 seconds, etc but the I frames don't line up
with this timing.

Is there any way to only get the I-frames other than cranking up the frame rate?

I hope I'm being coherent...

-Mike
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to