[FFmpeg-devel] [PATCH] ffmpeg: accept "chapters" as forced key frames.

Stefano Sabatini stefasab at gmail.com
Tue Jan 15 23:59:05 CET 2013

On date Tuesday 2013-01-15 20:20:46 +0100, Nicolas George encoded:
> Le quintidi 25 nivôse, an CCXXI, Stefano Sabatini a écrit :
> > Alternatively, considering my other patch: we read the chapter times,
> > and we store the next chapter time in a variable, so the equivalent
> > syntax for "chapters-0.1" would be:
> > 
> > expr:gte(t, NEXT_CHAPTER_T-0.1)
> I am not sure that is as simple as that. Assuming NEXT_CHAPTER_T is 90, then
> this formula will match frames at 89.92, 89.96 and 90.00 (assuming 25 fps),
> three frames instead of one wanted. The formula would have to be (using a
> more readable notation):
> 	t >= NEXT_CHAPTER_T - 0.1 && last_keyframe_t > NEXT_CHAPTER_T - 0.1
> But that is not the worst case: if I want to add a keyframe 0.1 second after
> the chapter starts instead of before, with "+ 0.1" instead of "- 0.1" then

> it will not work at all: as soon as the frame at 90.04 is processed,
> NEXT_CHAPTER_T would point to the next chapter, maybe 600, so the condition
> would not be triggered by the frame at 90.12.

this would be PREV_CHAPTER_T

> There are probably ways of getting it to work (NEAREST_CHAPTER_T?), but I am
> afraid it would become more complicated and ad-hoc than this parser.

Anyway I'm not opposed to the patch, at the same time I'd like to find
a convenient way to express near-position conditions in a
flexible/extensible way, so we don't have rely on other options such
as "delta" in the segment muxer.
FFmpeg = Fast Fabulous Mastodontic Plastic Elitarian Gadget

More information about the ffmpeg-devel mailing list