[FFmpeg-devel] [PATCH 1/1] libavformat/mxfenc: add missing dnxhr mxf container essence ULs
jay at wizardofthenet.com
jay at wizardofthenet.com
Sun Aug 26 10:20:28 EEST 2018
Baptiste you are right that DNxHR is variable frame size (0) from avpriv_dnxhd_get_frame_size and that it breaks the index.
is there a reason not to use the pkt->size as frame_size since DNxHR is a constant frame_size for a given resolution and quality profile?
-----Original Message-----
From: "Baptiste Coudurier" <baptiste.coudurier at gmail.com>
Sent: Saturday, August 25, 2018 11:35am
To: "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org>
Cc: "Jason Stevens" <jay at wizardofthenet.com>
Subject: Re: [FFmpeg-devel] [PATCH 1/1] libavformat/mxfenc: add missing dnxhr mxf container essence ULs
On Sat, Aug 25, 2018 at 5:02 AM, Tomas Härdin <tjoppen at acc.umu.se> wrote:
> lör 2018-08-25 klockan 02:00 -0700 skrev jay at wizardofthenet.com:
> > > From: Jason Stevens <jay at wizardofthenet.com>
> >
> > ---
> > libavformat/mxfenc.c | 47 ++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 47 insertions(+)
> >
> > diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> > index 7f629dbe53..cf58c8b834 100644
> > --- a/libavformat/mxfenc.c
> > +++ b/libavformat/mxfenc.c
> > @@ -146,6 +146,11 @@ enum ULIndex {
> > INDEX_DNXHD_720p_8bit_HIGH,
> > INDEX_DNXHD_720p_8bit_MEDIUM,
> > INDEX_DNXHD_720p_8bit_LOW,
> > + INDEX_DNXHR_LB,
> > + INDEX_DNXHR_SQ,
> > + INDEX_DNXHR_HQ,
> > + INDEX_DNXHR_HQX,
> > + INDEX_DNXHR_444,
> > INDEX_JPEG2000,
> > INDEX_H264,
> > };
> > @@ -345,6 +350,31 @@ static const MXFContainerEssenceEntry
> mxf_essence_container_uls[] = {
> > { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x05,0x00
> },
> > { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x13,0x00,0x00
> },
> > mxf_write_cdci_desc },
> > + // DNxHR LB - CID 1274
> > + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x05,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x28,0x00,0x00
> },
> > + mxf_write_cdci_desc },
> > + // DNxHR SQ - CID 1273
> > + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x05,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x27,0x00,0x00
> },
> > + mxf_write_cdci_desc },
> > + // DNxHR HQ - CID 1272
> > + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x05,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x26,0x00,0x00
> },
> > + mxf_write_cdci_desc },
> > + // DNxHR HQX - CID 1271
> > + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x05,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x25,0x00,0x00
> },
> > + mxf_write_cdci_desc },
> > + // DNxHR 444 - CID 1270
> > + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x05,0x00
> },
> > + { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x24,0x00,0x00
> },
> > + mxf_write_cdci_desc },
> > // JPEG2000
> > { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0c,0x01,0x00
> },
> > { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x08,0x00
> },
> > @@ -1998,6 +2028,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;
> > default:
> > return -1;
> > }
>
> Don't have any idea about DNxHR, else the code looks OK enough.
I think DNxHR is variable frame size, and in the code frame_size will be 0
and that will cause issues in the index table later,
creating broken files.
--
Baptiste
More information about the ffmpeg-devel
mailing list