[FFmpeg-soc] Help needed with new concatenate filter

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Apr 5 01:23:32 CEST 2010


On date Sunday 2010-04-04 16:16:28 -0400, Brandon Mintern encoded:
> On Thu, Apr 1, 2010 at 9:03 AM, Stefano Sabatini
> <stefano.sabatini-lala at poste.it> wrote:
> > On date Wednesday 2010-03-31 20:06:17 -0400, Brandon Mintern encoded:
> >> Thanks a lot for the feedback. A new, much cleaner (and actually
> >> similar to what I wrote on my first try before changing it to what you
> >> saw) patch is at the bottom of this post. I still can't see why the
> >> 2nd input is not being output; it seems like everything should be
> >> getting properly propagated.
> >
> > You need to shift the PTSes of the second source, something of the
> > kind:
> > pts += last_pts_of_first_source;
> 
> I tried to do this in start_frame:
> 
> static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> {
>     ConcatenateContext *con = link->dst->priv;
> 
>     if (con->first_input_consumed)
>         picref->pts += con->first_input_last_pts;
>     else
>         con->first_input_last_pts = picref->pts;
> 
>     avfilter_null_start_frame(link, picref);
> }
> 
> 
> first_input_consumed is set in request_frame when the first input
> returns a nonzero number.
> 
> Apparently my approach here is incorrect, because the filter still
> isn't working as I am expecting it to. My current patch is attached if
> anyone is interested in taking a look at what I have.

I don't know how are you testing this, but I suppose you're using
ffplay to test this.

In order to understand what's going on you need to understand the
threading model used by ffplay (hint: from gdb use thread apply all
bt).

The problem here looks like that when the decode thread stops to
process packets, it doesn't send anymore packets to the queue where it
is waiting the video thread.

So the video thread doesn't have a way to signal to the filterchain
that the input source ended, and ffplay will simply stop to play the
video.

Yes maybe this should be fixed in ffplay, patches are welcome of
course :-).

> Thanks for your help,
> Brandon

Regards.



More information about the FFmpeg-soc mailing list