0xbaadf00d
0xbaadf00d

Reputation: 2643

How to hack ffmpeg to consider I-Frames as key frames?

I'm trying to get ffmpeg to seek h264 interlaced videos, and i found that i can seek to any frame if i just force it.

I already hacked the decoder to consider I - Frames as keyframes, and it works nicely with the videos i need it to work with. And there will NEVER be any videos encoded with different encoders.

However, i'd like the seek to find me an I - Frame and not just any frame.

What i'd need to do is to hack The AVIndexEntry creation so that it marks any frame that is an I-Frame to be a key frame. Or alternatively, hack the search thing to return I - Frames.

The code does get a tad dfficult to follow at this point.

Can someone please point me at the correct place in ffmpeg code which handles this?

Upvotes: 2

Views: 1058

Answers (1)

0xbaadf00d
0xbaadf00d

Reputation: 2643

This isn't possible as far as i can tell..

But if you do know where the I-Frames are, by either decoding the entire video or by just knowing, you can insert stuff into the AVIndexEntry information stored in the stream.

AVIndexEntries have a flag that tells if it's a keyframe, just set it to true on I-Frames.

Luckily, i happen to know where they are in my videos :)

-mika

Upvotes: 1

Related Questions