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

Nicolas George nicolas.george at normalesup.org
Tue Jan 15 20:20:46 CET 2013

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.

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.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130115/63b6d964/attachment.asc>

More information about the ffmpeg-devel mailing list