[FFmpeg-devel] [PATCH] lavdev: add libavfilter virtual input device

Mina Nagy Zaki mnzaki at gmail.com
Wed Aug 10 14:13:49 CEST 2011


On Sat, Aug 06, 2011 at 05:03:02PM +0200, Stefano Sabatini wrote:
> On date Saturday 2011-08-06 15:46:38 +0200, Stefano Sabatini encoded:
> > On date Friday 2011-06-17 02:15:29 +0200, Stefano Sabatini encoded:
> > > On date Thursday 2011-06-16 21:17:02 +0200, Michael Niedermayer encoded:
> > > > On Sat, Jun 11, 2011 at 10:58:49PM +0200, Stefano Sabatini wrote:
> > [...]
> > > > If it works and doesnt break anything it might make sense to commit
> > > > and work in git on it. that way users can easier  test and other devs
> > > > can easier contribute
> > > 
> > > No it still has a bunch of problems, ffplay crashes randomly when
> > > switching streams with "v", I suspect there are still problems with
> > > timestamps, and the syntax needs to be changed as well, so committing
> > > is still premature.
> > > 
> > > I'll work through it though as it looks like a very useful tool for
> > > testing lavfi sources, multi-streams files, transmedia filtering, A/V
> > > synch and timestamp handling.
> > 
> > Updated work in progress.
> > 
> > Todo:
> 
> > * free context stuff when closing
> 
> Fixed.
> 
> > * syntax fix? I wonder if we should prefer the "outN" syntax over
> >   "v0", "v1"... , "a0", "a1".... Comments?
> 
> Fixed, opted for "outN", simpler and more generic.
> 
> > * support for buffer caching in the video sink (currently broken
> >   with split)
> > * support to audio
> > 
> > I want to fix the syntax problem, buffer caching is not so crucial
> > since the source is already usable in the current state (avoiding the
> > use of split).
> -- 
> FFmpeg = Funny & Fabulous Minimalistic Programmable Ecumenical Ghost

> From 0f4dfd8c1bd62a8164446df9fc42e266e441c46b Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sat, 11 Jun 2011 15:40:08 +0200
> Subject: [PATCH] lavdev: add libavfilter virtual input device
> 

[...]

> +    /* count the video outputs */
> +    for (n = 0, inout = output_links; inout; n++, inout = inout->next);
> +
> +    if (!(lavfi->sink_stream_map = av_malloc(sizeof(int) * n)))
> +        return AVERROR(ENOMEM);
> +    if (!(lavfi->stream_sink_map = av_malloc(sizeof(int) * n)))
> +        return AVERROR(ENOMEM);
> +    for (i = 0; i < n; i++)
> +        lavfi->stream_sink_map[i] = -1;
> +
> +    /* parse the output link names - they need to be of the form v0, v1, ...
> +     * create a mapping between them and the streams */

Typo v0 -> out0

[...]

For audio support, asink is going to need peeking support as well. Can the sink
APIs be combined somehow? It seems like we would benefit from one common API for
sinks, instead of duplicating it with each sink.


More information about the ffmpeg-devel mailing list