[FFmpeg-devel] [PATCH] ffmpeg: implement -force_key_frames_expr option

Stefano Sabatini stefasab at gmail.com
Sat Dec 15 23:00:59 CET 2012


On date Saturday 2012-12-15 19:18:59 +0100, Michael Niedermayer encoded:
> On Sat, Dec 15, 2012 at 10:57:27AM +0100, Stefano Sabatini wrote:
[...]
> > Now the problem is that I can't set frame->key_frame in
> > avcodec_encode_video2(), since the struct is const. The best way seems
> > to set a field in AVCodecContext.force_key_frame, but that would
> > require changing all the encoders.
> > 
> > Do you see a better way?
> 
> the keyframe expression evaluation could be put in a seperate function
> and called from mpegvideo or other encoders for which it makes sense.

> You cant call it from the generic code anyway as it doesnt know the
> scene change score and other parameters from motion estimation and
> rate control which may be interresting.

I need the option to be as generic as possible, having it working only
for MPEGVIDEO codecs doesn't simply work for me.

Implementing a private MPEG-codecs option, overriding the generic one
and accessing the internal MPEG context, would be a possibility (but I
don't volunteer for doing it, as I have no need for it and limited
time).
-- 
FFmpeg = Forgiving and Friendly Most Ponderous Exuberant Gem


More information about the ffmpeg-devel mailing list