[FFmpeg-soc] [PATCH] Add fade filter to libavfilter

Baptiste Coudurier baptiste.coudurier at gmail.com
Thu Apr 1 20:40:03 CEST 2010


Hi Brandon, first thanks a lot for your work.

On 03/31/2010 08:22 AM, Brandon Mintern wrote:
> On Wed, Mar 31, 2010 at 5:47 AM, Benoit Fouet<benoit.fouet at free.fr>  wrote:
>> Hi,
>>
>> On Wed, 31 Mar 2010 00:43:50 -0400 Brandon Mintern wrote:
>>> I am happy to present my first-ever open source code contribution, a
>>> "fade" filter for libavfilter! Here is some example usage:
>>>
>>> # Fade in first 30 frames of video
>>> ffmpeg -i input.avi -vfilters fade=in:1:30 output.avi
>>>
>>> # Fade out last 45 frames of a 200-frame video
>>> ffmpeg -i input.avi -vfilters fade=out:156:45 output.avi
>>>
>>> # Fade in first 25 frames and fade out last 25 frames of a 1000-frame video
>>> ffmpeg -i input.avi -vfilters "fade=in:1:25, fade=out:976:25" output.avi
>>>
>>
>> Would it be possible to (also ?) make it work as follow ?
>> ffmpeg -i input -vfilters "fade=in:25, fade=out:25"
>>
>> That's to say: begin fade in at frame 0 and finish fade out at last frame.
>>
>> Ben
>
> The fade=in:25 is something I could do. Unfortunately the filter has
> no information regarding total number of frames until it reaches the
> end of the input stream (at least to my knowledge), so the fade=out:25
> would not work without buffering frames. It should be
> somewhat-trivial, however, to use ffprobe or something similar
> beforehand in order to get the total duration and multiply that by the
> FPS in order to get the total frames in the video. That's the way I
> plan to do it.
 >
> Hmm... I just thought of an idea that should work. For fade=out we
> could buffer frame_length frames until we hit the end of the video,
> then start outputting the fading frames. Unfortunately, this is beyond
> my knowledge of libavfilter at the moment, and I would rather get this
> initial version accepted before adding more functionality to it. This
> is definitely something I will keep in mind though, because this seems
> to be how most people would like to use fade.

Indeed, I thought about that as well, that could be an idea, and would 
help getting "buffering" mechanism implemented :)

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org


More information about the FFmpeg-soc mailing list