[FFmpeg-devel] Fade to/from white
bcardarella at gmail.com
Mon Jul 18 23:21:59 CEST 2011
Yes! That will suit my needs nicely. Thank-you very much :)
I agree with the nature of this filter. I actually emailed Stefano
directly with the question. He directed me to the mailing list but
also said he plans on rewriting the filter to allow fading with a
specific color. I would love to help, any pointers on how to better
understand the draw slice function as well as the luma and chroma
planes I think would be a good place for me to start.
On Mon, Jul 18, 2011 at 5:03 PM, Mark Himsley <mark at mdsh.com> wrote:
> On 18/07/2011 17:54, Brian Cardarella wrote:
>> I'm trying to modify the fade filter to fade from white instead of black.
>> I'm guessing the luma plane is where I want to do this. I'm not quite
>> sure how best to cycle the luma plane here. I've seen that the Y'
>> value of 1 is represented by the integer 65535 (unsigned int). I
>> thought it would be as easy as actually using the fade->factor value
>> as this is already cycling. The result is not what I want (choppy and
>> actually goes to black)
>> So any tips on this would be great.
> In My Humble Opinion, the fade filter is slightly broken, because what it
> currently does is just multiply the input signal by 65535/fade->factor. That
> makes "studio" level input signals tend towards 0 rather than tending
> towards 16 (studio level black).
> So, assuming the same broken-ness for studio colours, instead of fading to 0
> like this on line 112 of vf_fade.c:
> *p = (*p * fade->factor + 32768) >> 16;
> You'd need to fade to 255, something like this (not tested in code, but the
> principal tested in a spread sheet):
> *p = (255 * (65536 - fade->factor) + *p * fade->factor + 32768) >> 16;
> I don't think you'll need to alter the chroma multipliers.
> Hope that helps.
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
More information about the ffmpeg-devel