[FFmpeg-soc] libavfilter: movie source filter

Víctor Paesa victorpaesa at googlemail.com
Wed Jan 30 23:18:13 CET 2008


Hi,

On Jan 29, 2008 11:19 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Jan 28, 2008 at 11:23:25PM +0100, Víctor Paesa wrote:
> > Hi,
> >
> > On Jan 27, 2008 8:18 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
> > > Hi, and sorry for taking so long to look at it.
> >
> > No problem, SoC doesn't have FFmpeg's frenetic pace.
> >
> > > Víctor Paesa wrote:
> > > > Hi,
> > > >
> > > > On Jan 27, 2008 3:42 PM, Diego Biurrun <diego at biurrun.de> wrote:
> > > >> On Sun, Jan 27, 2008 at 03:31:48PM +0100, Víctor Paesa wrote:
> > > >>> Here is attached the next revision:
> > >
> > > [...]
> > >
> > > > +    return 0;
> > > > +}
> > > > +
> > > > +static int config_props(AVFilterLink *link)
> > > > +{
> > > > +    MovieContext *mv = link->src->priv;
> > > > +
> > > > +    link->w = mv->w;
> > > > +    link->h = mv->h;
> > > > +
> > >
> > > I think you should set the aspect ratio. Something like
> > >
> > > link->dst->outputs[0]->outpic->pixel_aspect.num =
> > > mv->pCodecCtx->sample_aspect_ratio.num;
> > > link->dst->outputs[0]->outpic->pixel_aspect.den =
> > > mv->pCodecCtx->sample_aspect_ratio.den;
> >
> > Thanks for your review, and the code snippet. I have set it in
> > a different place, I hope is correct.
> >
> > Attached is revision fourth, should there be no further comments
> > I will commit it tomorrow.
> [...]
>
> > +    // To make things nice and easy, we simply use the first video stream we find
> > +    mv->videoStream = -1;
> > +    for(i = 0; i < mv->pFormatCtx->nb_streams; i++)
> > +        if(mv->pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO) {
> > +            mv->videoStream = i;
> > +            break;
> > +        }
> > +    if(mv->videoStream == -1) {
> > +        av_log(ctx, AV_LOG_ERROR, "movie_init() No video stream found\n");
> > +        return -1;
> > +    }
>
> simply using the first video stream is a little limited, but that can be fixed
> after commit ...

Added a TODO.

> [...]
> > +    int num_fields;
> > +
> > +    if(args) {
> > +        num_fields = sscanf(args, "%lld:%15[^:]:%255s",
> > +                            &mv->seek_point, mv->format_name, mv->file_name);
>
> declaration and init can be merged

Merged.

> [...]
>
> > +                // Advance in the time line
> > +                mv->pic->pts = packet.pts * AV_TIME_BASE *
> > +                    av_q2d(mv->pFormatCtx->streams[mv->videoStream]->time_base);
>
> see av_rescale_q()

Seen and used, thanks.

> [...]
> > +    out->pixel_aspect.num = mv->pCodecCtx->sample_aspect_ratio.num;
> > +    out->pixel_aspect.den = mv->pCodecCtx->sample_aspect_ratio.den;
>
> out->pixel_aspect= mv->pCodecCtx->sample_aspect_ratio;

Oops, thanks.

Here is attached the fifth revision. I'll let pass the customary 24h
before commit it.

Regards,
Víctor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.libavfilter.movie.5.diff
Type: text/x-patch
Size: 14091 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080130/164c9a45/attachment.bin>


More information about the FFmpeg-soc mailing list