[FFmpeg-devel] libavfilter: extending overlay filter

Mark Himsley mark
Sun Mar 13 21:54:09 CET 2011


On 13/03/11 19:28, Mark Himsley wrote:
> On 13/03/11 18:38, Stefano Sabatini wrote:
>> On date Sunday 2011-03-13 15:18:04 +0000, Mark Himsley encoded:
>>> On 13/03/11 14:26, Stefano Sabatini wrote:
>>>> On date Sunday 2011-03-13 14:18:42 +0000, Mark Himsley encoded:
>> [...]
>>> --- ffmpeg/libavfilter/vf_overlay.c 2011-02-19 15:20:16.000000000 +0000
>>> +++ FFmbc-0.6-rc3/libavfilter/vf_overlay.c 2011-03-13
>>> 15:11:23.000000000 +0000
>>
>> Please provide a patch created with git format-patch.
>
> Thanks Stefano for looking at the patch.
<SNIP>
>>> + if (over->inout_is_rgb != over->blend_is_rgb) {
>>> + av_log(ctx, AV_LOG_ERROR,
>>> + "Main and overlay are not similar formats, cannot mix YUV and RGB\n");
>>> + return AVERROR(EINVAL);
>>> + }
>>> return 0;
>>
>> Possibly I would like to avoid this kind of configuration failures, or
>> we're going to have lots of reports from users failing to interpret
>> the error message.
>
> Exactly. Which is why I said "I don't feel that I can submit [this
> patch] while it breaks users current filter chains".
>
>
>> A better approach is defining a configuration
>> parameter for setting the colorspace class,
>
> By this I assume you mean a filter configuration parameter.
>
> I suppose we could set the default PixelFormats back to only allow YUV
> and add an 'allow_RGB' switch to overlay.

I've followed the excellent suggestions, and provide this patch for your 
consideration.

The overlay filter now requires the user to add a :1 to the end of the 
overlay args in order to enable accepting RGB types.

I have left the error message because advanced users who use the RGB 
path may still need a hint when they use incompatible formats.


>> a yet better solution
>> would be to extend the framework to manage efficiently such
>> situations.
>
> True.

-- 
Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-overlay.patch
Type: text/x-patch
Size: 11130 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110313/55c8895b/attachment.bin>



More information about the ffmpeg-devel mailing list