Re: [FFmpeg-devel] [PATCH]lavf/mxf: Map codec_tag for Avid files if everything else fails
On 22/07/15 11:10, Carl Eugen Hoyos wrote: Tomas Härdin tomas.hardin at codemill.se writes: New patch attached. Looks alright. You can reindent in a separate patch if you like. Merged by Michael with the reindentation. There is still a cropping issue for the given sample: Am I correct that the generic descriptors 0x3208 and 0x3209 should be used as display size with 0x320B as vertical offset (and 0x320A as horizontal offset)? That is my understanding. [..] -- Tim. Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxf: Map codec_tag for Avid files if everything else fails
Tomas Härdin tomas.hardin at codemill.se writes: New patch attached. Looks alright. You can reindent in a separate patch if you like. Merged by Michael with the reindentation. There is still a cropping issue for the given sample: Am I correct that the generic descriptors 0x3208 and 0x3209 should be used as display size with 0x320B as vertical offset (and 0x320A as horizontal offset)? Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxf: Map codec_tag for Avid files if everything else fails
On Fri, 2015-07-17 at 12:36 +0200, Carl Eugen Hoyos wrote: On Saturday 11 July 2015 04:13:52 pm Tomas Härdin wrote: Just a quick review since I have to bounce: +const MXFCodecUL ff_mxf_codec_tag_uls[] = { Haven't we moved this to mxf.c already? Or rather, don't we have a whole bunch of very similar tables already? The new table is (together with others) in mxf.c, none of the existing tables maps to codec_tag. AVup cannot be decoded without codec_tag because we currently treat it as rawvideo. Alright [...] Messy bracing. Something like putting a check on codec_tag after setting it, inside braces like before. Hard to explain and I don't have time to type it out but: if (st-codec-pix_fmt == AV_PIX_FMT_NONE) { codec_tag = ... if (!codec_tag) { do the old thing } } New patch attached. Looks alright. You can reindent in a separate patch if you like. Sorry for taking a few days with replying, thought I'd already sorted it /Tomas signature.asc Description: This is a digitally signed message part ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxf: Map codec_tag for Avid files if everything else fails
On Saturday 11 July 2015 04:13:52 pm Tomas Härdin wrote: Just a quick review since I have to bounce: +const MXFCodecUL ff_mxf_codec_tag_uls[] = { Haven't we moved this to mxf.c already? Or rather, don't we have a whole bunch of very similar tables already? The new table is (together with others) in mxf.c, none of the existing tables maps to codec_tag. AVup cannot be decoded without codec_tag because we currently treat it as rawvideo. [...] Messy bracing. Something like putting a check on codec_tag after setting it, inside braces like before. Hard to explain and I don't have time to type it out but: if (st-codec-pix_fmt == AV_PIX_FMT_NONE) { codec_tag = ... if (!codec_tag) { do the old thing } } New patch attached. Thank you, Carl Eugen diff --git a/libavformat/mxf.c b/libavformat/mxf.c index ecfb8a2..dc712bb 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -69,6 +69,11 @@ const MXFCodecUL ff_mxf_pixel_format_uls[] = { { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,AV_PIX_FMT_NONE }, }; +const MXFCodecUL ff_mxf_codec_tag_uls[] = { +{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x03,0x01,0x01,0x03,0x01,0x00 }, 15, MKTAG('A', 'V', 'u', 'p') }, /* Avid 1:1 */ +{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, 0 }, +}; + static const struct { enum AVPixelFormat pix_fmt; const char data[16]; diff --git a/libavformat/mxf.h b/libavformat/mxf.h index 1763063..f3db1f9 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -78,6 +78,7 @@ typedef struct { extern const MXFCodecUL ff_mxf_data_definition_uls[]; extern const MXFCodecUL ff_mxf_codec_uls[]; extern const MXFCodecUL ff_mxf_pixel_format_uls[]; +extern const MXFCodecUL ff_mxf_codec_tag_uls[]; int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt); const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base); diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index b3c25b7..6fd7d49 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2031,6 +2031,9 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) descriptor-essence_codec_ul); st-codec-pix_fmt = (enum AVPixelFormat)pix_fmt_ul-id; if (st-codec-pix_fmt == AV_PIX_FMT_NONE) { +st-codec-codec_tag = mxf_get_codec_ul(ff_mxf_codec_tag_uls, + descriptor-essence_codec_ul)-id; +if (!st-codec-codec_tag) { /* support files created before RP224v10 by defaulting to UYVY422 if subsampling is 4:2:2 and component depth is 8-bit */ if (descriptor-horiz_subsampling == 2 @@ -2038,6 +2041,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) descriptor-component_depth == 8) { st-codec-pix_fmt = AV_PIX_FMT_UYVY422; } +} } } } ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxf: Map codec_tag for Avid files if everything else fails
On Fri, 2015-07-10 at 20:11 +0200, Carl Eugen Hoyos wrote: Hi! Attached patch allows decoding of the sample provided on ffmpeg-user: http://ffmpeg.org/pipermail/ffmpeg-user/2015-July/027472.html Better suggestions welcome, Carl Eugen Just a quick review since I have to bounce: +const MXFCodecUL ff_mxf_codec_tag_uls[] = { Haven't we moved this to mxf.c already? Or rather, don't we have a whole bunch of very similar tables already? st-codec-pix_fmt = (enum AVPixelFormat)pix_fmt_ul-id; -if (st-codec-pix_fmt == AV_PIX_FMT_NONE) { +if (st-codec-pix_fmt == AV_PIX_FMT_NONE) +st-codec-codec_tag = mxf_get_codec_ul(ff_mxf_codec_tag_uls, + descriptor-essence_codec_ul)-id; +if (st-codec-pix_fmt == AV_PIX_FMT_NONE !st-codec-codec_tag) { /* support files created before RP224v10 by defaulting to UYVY422 if subsampling is 4:2:2 and component depth is 8-bit */ if (descriptor-horiz_subsampling == 2 Messy bracing. Something like putting a check on codec_tag after setting it, inside braces like before. Hard to explain and I don't have time to type it out but: if (st-codec-pix_fmt == AV_PIX_FMT_NONE) { codec_tag = ... if (!codec_tag) { do the old thing } } Gotta go! /Tomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH]lavf/mxf: Map codec_tag for Avid files if everything else fails
Hi! Attached patch allows decoding of the sample provided on ffmpeg-user: http://ffmpeg.org/pipermail/ffmpeg-user/2015-July/027472.html Better suggestions welcome, Carl Eugen diff --git a/libavformat/mxf.c b/libavformat/mxf.c index ecfb8a2..dc712bb 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -69,6 +69,11 @@ const MXFCodecUL ff_mxf_pixel_format_uls[] = { { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,AV_PIX_FMT_NONE }, }; +const MXFCodecUL ff_mxf_codec_tag_uls[] = { +{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x03,0x01,0x01,0x03,0x01,0x00 }, 15, MKTAG('A', 'V', 'u', 'p') }, /* Avid 1:1 */ +{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, 0 }, +}; + static const struct { enum AVPixelFormat pix_fmt; const char data[16]; diff --git a/libavformat/mxf.h b/libavformat/mxf.h index 1763063..f3db1f9 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -78,6 +78,7 @@ typedef struct { extern const MXFCodecUL ff_mxf_data_definition_uls[]; extern const MXFCodecUL ff_mxf_codec_uls[]; extern const MXFCodecUL ff_mxf_pixel_format_uls[]; +extern const MXFCodecUL ff_mxf_codec_tag_uls[]; int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt); const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base); diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index b3c25b7..897e02a 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2030,7 +2030,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls, descriptor-essence_codec_ul); st-codec-pix_fmt = (enum AVPixelFormat)pix_fmt_ul-id; -if (st-codec-pix_fmt == AV_PIX_FMT_NONE) { +if (st-codec-pix_fmt == AV_PIX_FMT_NONE) +st-codec-codec_tag = mxf_get_codec_ul(ff_mxf_codec_tag_uls, + descriptor-essence_codec_ul)-id; +if (st-codec-pix_fmt == AV_PIX_FMT_NONE !st-codec-codec_tag) { /* support files created before RP224v10 by defaulting to UYVY422 if subsampling is 4:2:2 and component depth is 8-bit */ if (descriptor-horiz_subsampling == 2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel