[FFmpeg-user] Cannot open/transcode MXF OP-Atom files
Carl Eugen Hoyos
cehoyos at ag.or.at
Tue May 1 14:21:57 CEST 2012
Peter B. <pb <at> das-werkstatt.com> writes:
> I've now received the permission to provide my sample MXF file:
> http://download.das-werkstatt.com/pb/mthk/examples/mxf/test_v1.mxf
Inlined follows a patch / hack that allows decoding your sample,
I don't know much about the format, so I don't know how this should
be done correctly.
Carl Eugen
(You will have to apply the first part manually.)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 8da3367..ce8df2f 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -923,6 +923,7 @@ static const MXFCodecUL mxf_picture_essence_container_uls
{ {
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01
}, 14, CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
{ {
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01
}, 14, CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
{ {
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x05,0x00,0x00
}, 14, CODEC_ID_RAWVIDEO }, /* Uncompressed Picture */
+ { {
0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0xFF,0x4B,0x46,0x41,0x41,0x00,0x0D,0x4D,0x4F
}, 16, CODEC_ID_RAWVIDEO },
{ {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
}, 0, CODEC_ID_NONE },
};
@@ -1536,6 +1537,7 @@ static int mxf_parse_structural_metadata
descriptor->vert_subsampling == 1 &&
descriptor->component_depth == 8) {
st->codec->pix_fmt = PIX_FMT_UYVY422;
+ st->codec->height /= 2;
}
}
}
@@ -2110,5 +2112,7 @@ static int mxf_read_packet
return AVERROR_INVALIDDATA;
}
+pos += 0x1a00;
+size -= 0x1a00;
if ((size = next_pos - pos) <= 0) {
av_log(s, AV_LOG_ERROR, "bad size: %i\n", size);
More information about the ffmpeg-user
mailing list