[Ffmpeg-devel] Optimizing encoding when knowing changed area

Oleg Oksyuk Oksyuk
Tue Oct 11 17:57:16 CEST 2005

>On Mon, Oct 10, 2005 at 12:33:33AM -0700, Loren Merritt wrote:
>> On Mon, 10 Oct 2005, Oleg Oksyuk wrote:
>> >Hello everyone,
>> >
>> >I use ffmpeg to encode graphics animation produced by another
program. The
>> >contains API interface that allows to get output pixmap in RGB
format and
>> >changed area, for example (100, 100) - (200, 300).
>> >When encoding MPEG using FFMPEG I simply convert changed area from
RGB to
>> >YUV each 1/30 of second. But often nothing was changed or only some
>> >rectangle was changed. Are there any way to use knowledge about
>> >area
>> >to optimize encoding?
>> While I haven't used them myself, AVCodecContext.me_threshold and 
>> mb_threshold look like what you're asking for.
>I think he wants to avoid the colorspace conversion for the unchanged
Guys, thank you for replies. I meant optimizing the process of actually
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,

More information about the ffmpeg-devel mailing list