[FFmpeg-devel] [PATCH / RFC] Deshake / stabilize filter

Daniel G. Taylor dan
Mon Apr 12 23:38:17 CEST 2010

On 04/12/2010 05:07 PM, compn wrote:
> On Mon, 12 Apr 2010 19:26:53 +0200, Michael Niedermayer wrote:
>> [ ... ]
> you might want to ask the author of this filter for some tips:
> http://www.guthspot.se/video/deshaker.htm

Already did and was shot down. He has no interest in porting or really 
talking to me at all from what I can tell.

>>>    2. Get it into FFmpeg trunk
>> this filter is very interresting but
>> could you look at motion_est* please, the code there likely can be used.
>> Changing or extending motion_est* so it has a nice public API would for
>> this be required but i think its the better approuch than having
>> each filter and codec duplicate motion estimation.
> seems like a lot of work for one filter author.

Agreed. I'm not sure I can take on such a large project messing with all 
the internals of libavcodec, especially considering I'm just starting 
out. My head is spinning just looking at those files and the size of 

>>> + * TODO:
>>> + *   - Compensate for rotation (requires full transform, slower)
>>> + *   - Zoom instead of filling frame edges (requires full transform, slower)
>>> + *   - Fill frame edges based on previous/next reference frames
>> 1. allocate a larger internal picture
>> 2. for each frame match its contents to the larger picture and copy the new
>>    frame in there. If no good match reset things and draw in the middle
>> 3. output center portion of the larger internal picture or smooth motion
>>    to compensate for panning and output the resulting rectangle
>> With this you not only fill in cornrs fron the next/prev frames but even
>> more distant frames.
>> And it might work for something else too. If you pan a cammera over a static
>> scene the internal picture should then contain the whole thing stitched
>> together
> content aware fill?
> http://www.logarithmic.net/pfh/resynthesizer

Good point; I had thought about this before too. I checked out the 
algorithm and code for that thing and it seems doable, though it would 
be very slow. A mixture of that and Michaels idea might produce some 
very, very nice results though.

Take care,
Daniel G. Taylor

More information about the ffmpeg-devel mailing list