[FFmpeg-devel] [PATCH] zmq filters

Clément Bœsch ubitux at gmail.com
Tue May 14 18:57:45 CEST 2013


On Mon, May 13, 2013 at 05:23:19PM +0200, Stefano Sabatini wrote:
[...]
> > >  # libraries
> > >  avcodec_deps="avutil"
> > > @@ -4051,6 +4055,9 @@ enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 &&
> > >                          die "ERROR: libx264 must be installed and version must be >= 0.118."; }
> > >  enabled libxavs    && require  libxavs xavs.h xavs_encoder_encode -lxavs
> > >  enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
> > > +enabled libzmq     && require  libzmq zmq.h zmq_ctx_new -lzmq &&
> > 
> > require_pkgconfig libzmq possibly
> 
> why?

It's meant to be the more common reliable way to get libs and flags AFAIK.
Maybe I'm wrong.

[...]
> > ditto broke
> 
> "broker" is correct if I'm not mistaken.
>  

I'm learning English every day...

[...]
> > > +Consider the following filtergraph generated by @command{ffplay}
> > > + at example
> > > +ffplay -dumpgraph 1 -f lavfi "color=s=100x100:c=red [l]; color=s=100x100:c=blue [r]; nullsrc=s=200x100, zmq [bg]; [bg][l]overlay[bg+l]; [bg+l][r]overlay=x=100"
> > 
> > Possibly more clear:
> > 
> >     ffplay -dumpgraph 1 -f lavfi "
> >         color=s=100x100:c=red  [l];
> >         color=s=100x100:c=blue [r];
> >         nullsrc=s=200x100, zmq [bg];
> >         [bg]  [l] overlay        [bg+l];
> >         [bg+l][r] overlay=x=100"
> > 
> 
> > Also, I realize it would possibly be more elegant to have zmq working
> > (optionally?) as a source filter, maybe using an option, or simply
> > defining an extra zmqsrc filter or whatever.
> 
> Uh? No zmq requires to process frames, it processes frames only when
> they are in input; it could be used as a null source but would be IMO
> more awkward, not less.
> 

Yes I was thinking a null source, but OK.

[...]
> > > +#if !HAVE_GETOPT
> > > +#include "compat/getopt.c"
> > > +#endif
> > > +
> > 
> > Note: this is kind of rare violence.
> 
> ???
> 

Just looks awkward; I know it's done like this everywhere, just wanting to
point it out.

[...]
> Feel free to revamp your script and commit it separately, in
> particular it should allow to specify the url.
>  

I'll do when it's upstream.

> > [...]
> > 
> > Nice work overall.
> > 
> > Did you have the opportunity to discuss such design & code with the zmq
> > developers? AFAIK they have a fairly active IRC channel; it might be
> > relevant to discuss this with them.
> 
> No (I'll probably avoid unless I have specific reasons).

OK.

[...]
> From 5fe83d5c53c99bdb27a8604559855c27cb46ddd1 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Fri, 3 May 2013 18:05:18 +0200
> Subject: [PATCH] tools: add zmqsend tool, useful to test the zmq filters
> 
> ---
>  .gitignore           |    1 +
>  doc/filters.texi     |   27 ++++++++
>  libavfilter/Makefile |    2 +-
>  tools/zmqsend.c      |  167 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 196 insertions(+), 1 deletion(-)
>  create mode 100644 tools/zmqsend.c
> 
> diff --git a/.gitignore b/.gitignore
> index 979d617..dd93958 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -74,3 +74,4 @@
>  /tools/qt-faststart
>  /tools/trasher
>  /tools/seek_print
> +/tools/zmqsend
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 22a6d67..86e1412 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -8358,6 +8358,33 @@ will send a reply to the client, adopting the format:
>  
>  @var{MESSAGE} is optional.
>  
> + at subsection Examples
> +
> +Look at @file{tools/zmqsend} for an example of a zmq client which can
> +be used to send commands processed by these filters.
> +
> +Consider the following filtergraph generated by @command{ffplay}
> + at example
> +ffplay -dumpgraph 1 -f lavfi "
> +color=s=100x100:c=red  [l];
> +color=s=100x100:c=blue [r];
> +nullsrc=s=200x100, zmq [bg];
> +[bg][l] overlay        [bg+l];
> +[bg+l][r] overlay=x=100
> +"

nit+++: indent filtergraph and trailing '"' on previous line.

[...]

Rest LGTM, thanks.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130514/87afadbe/attachment.asc>


More information about the ffmpeg-devel mailing list