[FFmpeg-devel] [PATCH v3 2/2] libavformat/mxfenc: add missing dnxhr mxfcontainer essence ULs

Paul B Mahol onemda at gmail.com
Sat Sep 8 18:42:53 EEST 2018


On 9/8/18, Tomas Haerdin <tjoppen at acc.umu.se> wrote:
> fre 2018-09-07 klockan 16:40 +0200 skrev Carl Eugen Hoyos:
>> > 2018-09-07 10:54 GMT+02:00, Tomas Haerdin <tjoppen at acc.umu.se>:
>> > fre 2018-09-07 klockan 01:03 -0700 skrev Jason Stevens:
>> > > Add missing dnxhr mxf container essence ULs to the mxf encoder.
>> > > set proper mxf frame size for dnxhr using libavformat/dnxhd's get
>> > > dnxhr
>> > > size function.
>> > >
>> > > This fixes dnxhr mxf files being quarantined by Avid Media Composer.
>> > >
>> > > > Signed-off-by: Jason Stevens <jay at wizardofthenet.com>
>> > >
>> > > ---
>> > >  libavformat/mxfenc.c | 53
>> > > +++++++++++++++++++++++++++++++++++++++++++-
>> > >  1 file changed, 52 insertions(+), 1 deletion(-)
>> > >
>> > > @@ -1959,7 +1989,11 @@ AVPacket *pkt)
>> > >      header_cid = pkt->data + 0x28;
>> > >      cid = header_cid[0] << 24 | header_cid[1] << 16 | header_cid[2]
>> > > << 8
>> > > > header_cid[3];
>> > >
>> > > -    if ((frame_size = avpriv_dnxhd_get_frame_size(cid)) < 0)
>> > > +    if ((frame_size = avpriv_dnxhd_get_frame_size(cid)) ==
>> > > DNXHD_VARIABLE) {
>> > > +        frame_size = avpriv_dnxhd_get_hr_frame_size(cid,
>> > > st->codecpar->width, st->codecpar->height);
>> > > +    }
>> > > +
>> > > +    if (frame_size < 0)
>> > >          return -1;
>> > >      if ((sc->interlaced = avpriv_dnxhd_get_interlaced(cid)) < 0)
>> > >          return AVERROR_INVALIDDATA;
>> > > @@ -1998,6 +2032,23 @@ AVPacket *pkt)
>> > >      case 1253:
>> > >          sc->index = INDEX_DNXHD_720p_8bit_LOW;
>> > >          break;
>> > > +    case 1274:
>> > > +        sc->index = INDEX_DNXHR_LB;
>> > > +        break;
>> > > +    case 1273:
>> > > +        sc->index = INDEX_DNXHR_SQ;
>> > > +        break;
>> > > +    case 1272:
>> > > +        sc->index = INDEX_DNXHR_HQ;
>> > > +        break;
>> > > +    case 1271:
>> > > +        sc->index = INDEX_DNXHR_HQX;
>> > > +        sc->component_depth = 10;
>> > > +        break;
>> > > +    case 1270:
>> > > +        sc->index = INDEX_DNXHR_444;
>> > > +        sc->component_depth = 10;
>> > > +        break;
>> >
>> > Is there some spec one can reference to for these magic constants?
>>
>> Which magic constants?
>
> The "case" values. Not that I'm suggesting adding #defines for them or
> anything, just a comment for where one might look up potential future
> values

In specification.


More information about the ffmpeg-devel mailing list