[FFmpeg-devel] [PATCH] lavfi: add drawgraph filter

Dave Rice dave at dericed.com
Sun Jun 28 19:49:31 CEST 2015


> On Jun 28, 2015, at 11:07 AM, Paul B Mahol <onemda at gmail.com> wrote:
> 
> On 6/28/15, Dave Rice <dave at dericed.com> wrote:
>> Hi,
>> 
>>> On Jun 27, 2015, at 4:52 PM, Paul B Mahol <onemda at gmail.com> wrote:
>>> 
>>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>>> ---
>>> doc/filters.texi           |  76 ++++++++++++
>>> libavfilter/Makefile       |   1 +
>>> libavfilter/allfilters.c   |   1 +
>>> libavfilter/vf_drawgraph.c | 297
>>> +++++++++++++++++++++++++++++++++++++++++++++
>>> 4 files changed, 375 insertions(+)
>>> create mode 100644 libavfilter/vf_drawgraph.c
>>> 
> 
> [...]
> 
>> 
>> With this version using a color name for foreground no longer works:
>> 
>> This works:
>> ffplay -f lavfi -i mandelbrot -vf
>> signalstats,drawgraph=metadata=lavfi.signalstats.YAVG:min=0:max=255:slide=scroll:bg=green:fg=0x0000FF
>> 
>> This doesn't:
>> ffplay -f lavfi -i mandelbrot -vf
>> signalstats,drawgraph=metadata=lavfi.signalstats.YAVG:min=0:max=255:slide=scroll:bg=green:fg=red
> 
> AFAIK The expressions can not work with strings.
> 
>> 
>> Also here's an example with blend:
>> ffplay -f lavfi -i mandelbrot -vf "signalstats,split=3[a][b][c];\
>> [a]drawgraph=metadata=lavfi.signalstats.YAVG:min=0:max=255:slide=scroll:fg=0xFFFF0000:mode=dot[a1];\
>> [b]drawgraph=metadata=lavfi.signalstats.UAVG:min=0:max=255:slide=scroll:fg=0xFF00FF00:mode=dot[b1];\
>> [c]drawgraph=metadata=lavfi.signalstats.VAVG:min=0:max=255:slide=scroll:fg=0xFFFFFF00:mode=dot[c1];\
>> [a1][b1]blend=and[ab];[ab][c1]blend=and[out]"
>> 
> 
> The blending kills difference in colors so I may add multiple graphs
> support for filter.

Setting the background to black and blending seems a little better, though I’m losing one of my graphs in this example.

./ffplay -f lavfi -i mandelbrot -vf "signalstats,split=3[a][b][c];\
[a]drawgraph=lavfi.signalstats.YAVG:min=0:max=255:slide=scroll:bg=black:fg=0x0000FF:mode=dot[a1];\
[b]drawgraph=lavfi.signalstats.YLOW:min=0:max=255:slide=scroll:bg=black:fg=0x00FF00:mode=dot[b1];\
[c]drawgraph=lavfi.signalstats.YHIGH:min=0:max=255:slide=scroll:bg=black:fg=0xFF0000:mode=dot[c1];\
[a1][b1]blend=lighten,[c1]blend=lighten[out]”

Also the foreground expression is in ABGR or BGR.  This is the opposite arrangement of what is specified here http://ffmpeg.org/ffmpeg-utils.html#Color.
Best Regards,
Dave Rice


More information about the ffmpeg-devel mailing list