[FFmpeg-devel] 答复: 答复: [PATCH]Filter: Add snapshot filter. It is enable to save snapshot.
kl222
kl222 at 126.com
Sat May 28 07:31:29 CEST 2016
> -----邮件原件-----
> 发件人: ffmpeg-devel-bounces at ffmpeg.org
> [mailto:ffmpeg-devel-bounces at ffmpeg.org] 代表 Nicolas George
> 发送时间: 2016年5月27日 19:50
> 收件人: FFmpeg development discussions and patches
> 主题: Re: [FFmpeg-devel] 答复: [PATCH]Filter: Add snapshot filter. It is enable
> to save snapshot.
>
> Le nonidi 9 prairial, an CCXXIV, kl222 a écrit :
> > 发件人: ffmpeg-devel-bounces at ffmpeg.org
> > [mailto:ffmpeg-devel-bounces at ffmpeg.org] 代表 Michael Niedermayer
> > 发送时间: 2016年5月26日 19:24
> > 收件人: FFmpeg development discussions and patches
> > 主题: Re: [FFmpeg-devel] Filter: Add snapshot filter. It is enable to save
> snapshot.
>
> Plese remember that top-posting is not welcome on this mailing-list. See
> comments below on the patch itself.
>
> > From: KangLin <kl222 at 126.com>
> > Date: Wed, 25 May 2016 16:29:45 +0800
> > Subject: [PATCH] avfilter/vf_snapshot: Add snapshot filter. It is
> > enable to save snapshot.
>
> For possible future evolutions, we need a long-term contact. Who would we call
> if the discussion of a global license change in the project were started?
I am copy the license from vf_smartblur.c. I am not discussion to cheange the license.
> >
> > Signed-off-by: KangLin <kl222 at 126.com>
> > ---
> > doc/filters.texi | 23 +++++
> > libavfilter/Makefile | 1 +
> > libavfilter/allfilters.c | 1 +
> > libavfilter/vf_snapshot.c | 256
> > ++++++++++++++++++++++++++++++++++++++++++++++
> > 4 files changed, 281 insertions(+)
> > create mode 100644 libavfilter/vf_snapshot.c
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi index
> > aa208f1..a75005a 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -12037,6 +12037,29 @@ in [-30,0] will filter edges. Default value is 0.
> > If a chroma option is not explicitly set, the corresponding luma
> > value is set.
> >
> > + at section snapshot
> > +
> > +it can save a snapshot picture. Supports .png, .jpg, .bmp formats
> > +Snapshot with process_command api.
>
> Can you explain your use case for this filter?
>
> I ask because I am very uncomfortable with filters that perform direct output
> instead of producing frames for the rest of the graph. They need to duplicate
> the encoding and muxing code, usually with fewer options and features, and
> that duplicated code becomes itself a maintenance burden in case of API
> changes and such.
>
> IMHO, a better solution would be some kind of "interactive select" (or just an
> option of plain select) filter, and encode its output as image2.
>
I want to implement to the snapshot function whenever push stream,
and set the file name of snapshot picture.
this function can snapshot pictures before, between or after the other filters.
Because I want to change the file in filter, so duplicate the encoding and muxing code
can not be avoided.
OK, add it to "select" filter and a single filter patch. Chosen by you. see annex.
> > +
> > +It accepts the following options:
> > +
> > + at table @option
> > + at item directory
> > +Save the snapshot directory. Default value is snapshot.
> > + at item filename
> > +Snapshot file name
> > + at end table
> > +
> > + at example
> > +After ffmpeg start, when you want a snapshot, enter the following
> > +command at the command console:
> > +
> > +csnapshot -1 filename snapshot.png
> > +
> > +Save the snapshot to the snapshot directory.
> > + at end example
> > +
> > @section ssim
> >
> > Obtain the SSIM (Structural SImilarity Metric) between two input videos.
> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index
> > 65a831e..aceeed6 100644
> > --- a/libavfilter/Makefile
> > +++ b/libavfilter/Makefile
> > @@ -292,6 +292,7 @@ OBJS-$(CONFIG_YADIF_FILTER)
> += vf_yadif.o
> > OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o
> > OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o
> > OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o
> > +OBJS-$(CONFIG_SNAPSHOT_FILTER) += vf_snapshot.o
> >
> > OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o
> > OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index
> > d0d491e..b2e3b3c 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -307,6 +307,7 @@ void avfilter_register_all(void)
> > REGISTER_FILTER(ZMQ, zmq, vf);
> > REGISTER_FILTER(ZOOMPAN, zoompan, vf);
> > REGISTER_FILTER(ZSCALE, zscale, vf);
> > + REGISTER_FILTER(SNAPSHOT, snapshot, vf);
> >
> > REGISTER_FILTER(ALLRGB, allrgb, vsrc);
> > REGISTER_FILTER(ALLYUV, allyuv, vsrc);
> > diff --git a/libavfilter/vf_snapshot.c b/libavfilter/vf_snapshot.c new
> > file mode 100644 index 0000000..0f210e3
> > --- /dev/null
> > +++ b/libavfilter/vf_snapshot.c
> > @@ -0,0 +1,256 @@
> > +/*
>
> > +* Copyright (c) 2002 Michael Niedermayer <michaelni at gmx.at>
> > +* Copyright (c) 2012 Jeremy Tran
>
> This looks nonsensical.
>
> > +*
> > +* This file is part of FFmpeg.
> > +*
>
> > +* FFmpeg is free software; you can redistribute it and/or modify
> > +* it under the terms of the GNU General Public License as published
> > +by
> > +* the Free Software Foundation; either version 2 of the License, or
> > +* (at your option) any later version.
>
> Most of FFmpeg code is under LGPL. Is the choice of GPL intentional? If so, you
> need to update the dependencies in configure.
I am copy the license from vf_smartblur.c. I forgot to modify the license.
Is follows?
/*
* Copyright (c) 2016 KangLin<kl222 at 126.com>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avfilter-vf_snapshot-Add-snapshot-filter.-It-is-enab.patch
Type: application/octet-stream
Size: 10355 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160528/9c38887a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Remove-redundant-description.patch
Type: application/octet-stream
Size: 624 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160528/9c38887a/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-libavfilter-f_select.c-Add-snapshot.patch
Type: application/octet-stream
Size: 8016 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160528/9c38887a/attachment-0002.obj>
More information about the ffmpeg-devel
mailing list