[FFmpeg-devel] [PATCH] libavformat/mxfdec.c: read project_name metadata

Mark Reid mindmark at gmail.com
Sat Jan 10 03:23:52 CET 2015


On Tue, Jan 6, 2015 at 10:24 AM, Clément Bœsch <u at pkh.me> wrote:

> On Tue, Jan 06, 2015 at 10:06:13AM -0800, Mark Reid wrote:
> > On Mon, Jan 5, 2015 at 11:26 PM, Clément Bœsch <u at pkh.me> wrote:
> >
> > > On Mon, Jan 05, 2015 at 04:53:05PM -0800, Mark Reid wrote:
> > > > Hi,
> > > > MXF files generated by Media Composer or LibMXF can contain a
> > > > project name property in the Preface. Lots of existing samples have
> them.
> > > >
> > > >
> http://samples.ffmpeg.org/MXF/issue2160/PW0805A0V01.4C5B5636.EFA330.mxf
> > > > project_name    : DNX145 PW Test
> > > >
> > > >
> > >
> http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3450/WriteAvidMXFgenerated/5502_0010_v1.mxf
> > > > project_name    : Rombus
> > > >
> > > >
> > >
> http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3100/1sec_mxf_test_Video5270C795.mxf
> > > > project_name    : NVB_DOOD
> > > >
> > > > i can also provide more samples if needed.
> > > >
> > > > ---
> > > >  libavformat/mxfdec.c | 15 +++++++++++++++
> > > >  1 file changed, 15 insertions(+)
> > > >
> > > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > > > index 4715169..23d9c73 100644
> > > > --- a/libavformat/mxfdec.c
> > > > +++ b/libavformat/mxfdec.c
> > > > @@ -279,6 +279,7 @@ static const uint8_t mxf_encrypted_triplet_key[]
> > >        = { 0x06,0x0e,0x2b,0x
> > > >  static const uint8_t mxf_encrypted_essence_container[]     = {
> > >
> 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00
> > > };
> > > >  static const uint8_t mxf_random_index_pack_key[]           = {
> > >
> 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x11,0x01,0x00
> > > };
> > > >  static const uint8_t mxf_sony_mpeg4_extradata[]            = {
> > >
> 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00
> > > };
> > > > +static const uint8_t mxf_avid_project_name[]               = {
> > >
> 0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf
> > > };
> > > >
> > > >  #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
> > > >
> > > > @@ -2087,6 +2088,19 @@ static int
> mxf_read_identification_metadata(void
> > > *arg, AVIOContext *pb, int tag,
> > > >      return 0;
> > > >  }
> > > >
> > > > +static int mxf_read_preface_metadata(void *arg, AVIOContext *pb, int
> > > tag, int size, UID uid, int64_t klv_offset)
> > > > +{
> > > > +    MXFContext *mxf = arg;
> > > > +    AVFormatContext *s = mxf->fc;
> > > > +    int ret;
> > > > +    char *str = NULL;
> > > > +
> > > > +    if (tag >= 0x8000 && (IS_KLV_KEY(uid, mxf_avid_project_name))) {
> > > > +        SET_STR_METADATA(pb, "project_name", str);
> > > > +    }
> > > > +    return 0;
> > > > +}
> > > > +
> > >
> > > Would it make sense to use "title"? (That's the internal metadata name
> we
> > > use to re-map automatically in a bunch of other formats).
> > >
> > >
> > In that context, I think it would make more sense for
> > "material_package_name" to be renamed to "title" instead.
>
> In that case, you can ignore my comment.
>
> > I could do that in another patch?
> >
>
> No real opinion, except that changing an existing key might break stuff so
> I wouldn't suggest that.
>
>
okay, hold off on doing a patch for that.


More information about the ffmpeg-devel mailing list