diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 2b682fa6acf2a..8ef39a95cc31c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -366,6 +366,7 @@ enum CodecID { CODEC_ID_BINTEXT, CODEC_ID_XBIN, CODEC_ID_IDF, + CODEC_ID_S436M, CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it diff --git a/libavformat/mxf.c b/libavformat/mxf.c index b39a9b64cc055..266bca9267b55 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -52,6 +52,7 @@ const MXFCodecUL ff_mxf_codec_uls[] = { { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x02,0x03,0x02,0x01,0x00 }, 15, CODEC_ID_AC3 }, { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x02,0x03,0x02,0x05,0x00 }, 15, CODEC_ID_MP2 }, /* MP2 or MP3 */ //{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x02,0x03,0x02,0x1C,0x00 }, 15, CODEC_ID_DOLBY_E }, /* Dolby-E */ + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x09,0x0D,0x01,0x03,0x01,0x02,0x0E,0x00,0x00 }, 14, CODEC_ID_S436M }, /* SMPTE 436M MXF Mappings for VBI Lines and Ancillary Data Packets */ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_ID_NONE }, }; diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 92d93f3b37c62..2ea62c3199d10 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -753,6 +753,7 @@ static const MXFCodecUL mxf_essence_container_uls[] = { { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14, CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14, CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14, CODEC_ID_PCM_S16LE }, /* D-10 Mapping 50Mbps PAL Extended Template */ + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x09,0x0D,0x01,0x03,0x01,0x02,0x0E,0x00,0x00 }, 14, CODEC_ID_S436M }, /* SMPTE 436M MXF Mappings for VBI Lines and Ancillary Data Packets */ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_ID_NONE }, }; @@ -928,6 +929,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) } else if (st->codec->codec_id == CODEC_ID_MP2) { st->need_parsing = AVSTREAM_PARSE_FULL; } + } else if (st->codec->codec_type == AVMEDIA_TYPE_DATA) { + container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); + if (st->codec->codec_id == CODEC_ID_NONE) + st->codec->codec_id = container_ul->id; } if (st->codec->codec_type != AVMEDIA_TYPE_DATA && (*essence_container_ul)[15] > 0x01) { av_log(mxf->fc, AV_LOG_WARNING, "only frame wrapped mappings are correctly supported\n");