[FFmpeg-devel] [PATCH 7/10] GXF Encoder Fixes and HD support (patch broken up)

Reuben Martin reuben.m
Wed Oct 27 16:44:49 CEST 2010


Yo, back on Friday, October 15, 2010 Reuben Martin was all like:
> Yo, back on Thursday, October 14, 2010 Baptiste Coudurier was all like:
> > Hi,
> > 
> > On 10/13/2010 10:09 PM, Reuben Martin wrote:
> > > Yo, back on Thursday, October 07, 2010 Reuben Martin was all like:
> > >
> >  > [...]
> > >
> > > Here's the patch split out into two parts:
> > >
> > > 07.1 refactors the code that writes the aux info and adds the DVCAM tag if yuv420p format is used.
> > >
> > > 07.2 adds support for setting 16:9 aspect ratio flags.
> > >
> > >
> > > 07.1 is rather small and trivial, so I assume it won't be much trouble to apply. For that reason I made 07.2 to apply after applying 07.1. I can re-send 07.2 as an independant patch if that is a problem.
> > >
> > > Will change some stuff on the HD patch after these are applied.
> > >
> > > -Reuben
> > >
> > > 07.1-gxf__dvcam_aux.patch
> > >
> > >
> > > diff -U 3 -H -d -r -N -- ffmpeg-old/libavformat/gxfenc.c ffmpeg-dvcam/libavformat/gxfenc.c
> > > --- ffmpeg-old/libavformat/gxfenc.c	2010-10-07 17:28:19.000000000 -0500
> > > +++ ffmpeg-dvcam/libavformat/gxfenc.c	2010-10-13 23:41:52.077000076 -0500
> > > @@ -212,7 +212,7 @@
> > >   {
> > >       ByteIOContext *pb = s->pb;
> > >       int64_t pos;
> > > -    int mpeg = sc->track_type == 4 || sc->track_type == 9;
> > > +    int64_t track_aux_data = 0;
> > >
> > >       /* track description section */
> > >       put_byte(pb, sc->media_type + 0x80);
> > > @@ -228,24 +228,40 @@
> > >       put_be16(pb, sc->media_info);
> > >       put_byte(pb, 0);
> > >
> > > -    if (!mpeg) {
> > > -        /* auxiliary information */
> > > -        put_byte(pb, TRACK_AUX);
> > > -        put_byte(pb, 8);
> > > -        if (sc->track_type == 3)
> > > +    switch (sc->track_type) {
> > > +        case 3:     /* timecode */
> > > +            put_byte(pb, TRACK_AUX);
> > > +            put_byte(pb, 8);
> > >               gxf_write_timecode_auxiliary(pb, sc);
> > > -        else
> > > +            break;
> > > +        case 4:     /* MPEG2 */
> > > +        case 9:     /* MPEG1 */
> > > +            gxf_write_mpeg_auxiliary(pb, s->streams[index]);
> > > +            break;
> > > +        case 5:     /* DV25 */
> > > +            put_byte(pb, TRACK_AUX);
> > > +            put_byte(pb, 8);
> > > +            if (s->streams[index]->codec->pix_fmt == PIX_FMT_YUV420P)
> > > +                track_aux_data |= 0x01; /* DVCAM */
> > > +            put_le64(pb, track_aux_data);
> > > +            break;
> > > +        case 6:     /* DV50 */
> > > +            put_byte(pb, TRACK_AUX);
> > > +            put_byte(pb, 8);
> > > +            put_le64(pb, 0);        /* 4:3 */
> > 
> > You can merge both DV cases DV50 cannot be 420 anyway.
> 
> I had those separated since the apect ratio bit for one is 0x01 while the other is 0x10. Done.
> 
> > 
> >  > [...]
> >  >
> > >           case 5:     /* DV25 */
> > >               put_byte(pb, TRACK_AUX);
> > >               put_byte(pb, 8);
> > > +            if (sc->aspect_ratio)
> > > +                track_aux_data |= 0x10; /* 16:9 */
> > >               if (s->streams[index]->codec->pix_fmt == PIX_FMT_YUV420P)
> > >                   track_aux_data |= 0x01; /* DVCAM */
> > >               put_le64(pb, track_aux_data);
> > 
> > You must mark the flag that specify that aux contains valid information.
> 
> Done.
> 
> > 
> > > [...]
> > >
> > > @@ -509,11 +521,17 @@
> > >
> > >   static int gxf_write_umf_media_dv(ByteIOContext *pb, GXFStreamContext *sc)
> > >   {
> > > -    int i;
> > > -
> > > -    for (i = 0; i<  8; i++) {
> > > -        put_be32(pb, 0);
> > > -    }
> > > +    if (sc->aspect_ratio)
> > > +        put_le32(pb, 0x0080); /* 16:9 */
> > > +    else
> > > +        put_le32(pb, 0x0040); /* 4:3 */
> > > +    put_le32(pb, 0);
> > > +    put_le32(pb, 0);
> > > +    put_le32(pb, 0);
> > > +    put_le32(pb, 0);
> > > +    put_le32(pb, 0);
> > > +    put_le32(pb, 0);
> > > +    put_le32(pb, 0);
> > 
> > Can you please add the 420 case in UMF as well ?
> 
> Bleh. So much duplicate info. :P Done.
> 
> > 
> > Thanks for the patches.
> > 
> > 
> 

Pong.



More information about the ffmpeg-devel mailing list