[Ffmpeg-devel] Optimizing encoding when knowing changed area

Loren Merritt lorenm
Tue Oct 11 20:40:44 CEST 2005

On Tue, 11 Oct 2005, Oleg Oksyuk wrote:
> Guys, thank you for replies. I meant optimizing the process of actually
> encoding.
> Now each 1/30 of the second I
> 1. Convert changed area from RGB to YUV (I already avoid colorspace
> conversion for the unchanged regions)
> 2. Give all area to FFMPEG to encode next frame.
> But there is no way here for FFMPEG to check quickly that the area was
> not changed.
> I have seen on AVCodecContext.me_threshold, as Loren suggested, it looks
> like what you'm asking for, but I couldn't find how to use it,
> particularly how to set changed area.
> Does anybody knows how to use it, may be somebody has code example?
> Thanks again,
> Oleg

You don't specifically set changed area. You set me_threshold=1, and 
set all the MVs and refs to 0, and all the MB types to skip or inter
(see AVFrame.motion_val, ref_index, mb_type)
Then the codec checks which blocks match the previous frame exactly, and 
doesn't do any more processing on them. Yes, there are still a few wasted 

--Loren Merritt

More information about the ffmpeg-devel mailing list