[FFmpeg-soc] libavfilter: movie source filter

Michael Niedermayer michaelni at gmx.at
Tue Jan 29 23:19:44 CET 2008


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 ...


[...]
> +    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


[...]

> +                // 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()



[...]
> +    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;


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080129/51c69a1a/attachment.pgp>


More information about the FFmpeg-soc mailing list