From patchwork Wed Aug 4 11:51:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KREBS Michael X-Patchwork-Id: 29235 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp3303784ioh; Wed, 4 Aug 2021 04:52:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyGnBW28CzFD4Jj7QJTBLqi195olcNDzLNzGj+QJyHIJT1zYveQ94tUSOQ320hQjz4/qjN X-Received: by 2002:a17:906:3b53:: with SMTP id h19mr25115801ejf.211.1628077944181; Wed, 04 Aug 2021 04:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628077944; cv=none; d=google.com; s=arc-20160816; b=CQCtBB6RqJWmren37u6lmgTliKhUDHfn1HCdZvJ0fTw7sawdRQaI7m787K8h+j5zKA OkuY34e18W+5O92BffTFNw97MyIPtq55nx2G3m4evHrEFwmTwULy7h+n2dhn5iAB/XQO U0DXhnP8/oHujdKjM64gx0ANsETEpcpYn3+q8V/IRvITxZg6pfHZQH/fvH9ziaHysMpX Y52isYg8Kg6ASMHcOyAN9H2iwPa4akUkKX9A4kynhtEQkyZdLiN560Dlxx4ExTJSf55j H9zv7jB+JbP4e/qV+nK7jnI8rVx/GckKnVJYzgsmad4XlWU0ZLCl2KHZTYPzGD5VqWZp JRcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=KNyVCrzL8J4rWYr0c74PEnknjeCIBQh+/xy88Gk0K4E=; b=YXqBMwnKNH+phE3V2bXqQzhQF/niedn+PE4lYlZBnQr76bk+F9QwjfZuFMkyK+Z/4S SEctCPil3FQKelhLtygFlspRxc3UrlcdVEpAndN0g2n1pGrdsvbp19FTbq0yaSbkppbu gUffbtlKMPquK0Rr8nGggQ0UqQZ0wEAEon52fwnhWCnNVk17JMFAs9NaWn25WJBkcVPG 3b2jTvq4dP80jzXob654Gp3UlzwQClDhoZag3vp9kDC9LvmJDpsPGvG/n9wn8VBgJDuW UXxXLkDaA9ZVVjcFLUfpMId3fDNkcUXM9TFcf50SduG1VcSpqczCo/VlrnF77QjZoK19 RePg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id jz20si1925618ejb.263.2021.08.04.04.52.23; Wed, 04 Aug 2021 04:52:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 485D0689DC8; Wed, 4 Aug 2021 14:52:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.hemeria-group.com (mail.hemeria-group.com [151.80.188.104]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 18E9B680C5A for ; Wed, 4 Aug 2021 14:52:12 +0300 (EEST) Received: from hemeria-enregistreur-1.HEMERIA.local (109.190.10.190) by S268944.EX268944.lan (2001:41d0:129:b800::9750:bc68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P521) id 15.1.2242.12; Wed, 4 Aug 2021 13:52:10 +0200 From: Michael Krebs To: Date: Wed, 4 Aug 2021 13:51:57 +0200 Message-ID: <20210804115157.15840-1-michael.krebs@hemeria-group.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [109.190.10.190] X-ClientProxiedBy: S268944.EX268944.lan (2001:41d0:129:b800::9750:bc68) To S268944.EX268944.lan (2001:41d0:129:b800::9750:bc68) Subject: [FFmpeg-devel] [PATCH] mxf : allow using codecs RAWVIDEO and V210 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Michael Krebs Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZgThErwAbJol --- libavformat/mxf.c | 17 ++++ libavformat/mxf.h | 1 + libavformat/mxfenc.c | 181 +++++++++++++++++++++++++++++++++---------- 3 files changed, 156 insertions(+), 43 deletions(-) diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 36d662b58c..677d69e3ab 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -81,6 +81,8 @@ const MXFCodecUL ff_mxf_codec_uls[] = { const MXFCodecUL ff_mxf_pixel_format_uls[] = { { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16, AV_PIX_FMT_UYVY422 }, { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x02 }, 16, AV_PIX_FMT_YUYV422 }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x03 }, 16, AV_PIX_FMT_YUV422P }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x03,0x01,0x02 }, 16, AV_PIX_FMT_YUV420P }, { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_PIX_FMT_NONE }, }; @@ -183,6 +185,21 @@ int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat * return -1; } +int ff_mxf_find_pixel_layout(const char** pixel_layout, const enum AVPixelFormat pix_fmt) +{ + int x; + *pixel_layout = NULL; + + for(x = 0; x < num_pixel_layouts; x++) { + if(ff_mxf_pixel_layouts[x].pix_fmt == pix_fmt) { + *pixel_layout = ff_mxf_pixel_layouts[x].data; + return 0; + } + } + + return -1; +} + /** * See SMPTE 326M-2000 Section 7.2 Content package rate * MXFContentPackageRate->rate is bits b5..b0. diff --git a/libavformat/mxf.h b/libavformat/mxf.h index fe9c52732c..fa4a4eb0d2 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -114,6 +114,7 @@ extern const MXFCodecUL ff_mxf_color_trc_uls[]; extern const MXFCodecUL ff_mxf_color_space_uls[]; int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt); +int ff_mxf_find_pixel_layout(const char** pixel_layout, const enum AVPixelFormat pix_fmt); int ff_mxf_get_content_package_rate(AVRational time_base); diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 5ec619675b..a2ec7b89d7 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -127,6 +127,8 @@ enum ULIndex { INDEX_H264, INDEX_S436M, INDEX_PRORES, + INDEX_RAWVIDEO, + INDEX_V210 }; static const struct { @@ -141,6 +143,8 @@ static const struct { { AV_CODEC_ID_JPEG2000, INDEX_JPEG2000 }, { AV_CODEC_ID_H264, INDEX_H264 }, { AV_CODEC_ID_PRORES, INDEX_PRORES }, + { AV_CODEC_ID_RAWVIDEO, INDEX_RAWVIDEO }, + { AV_CODEC_ID_V210, INDEX_V210 }, { AV_CODEC_ID_NONE } }; @@ -148,6 +152,7 @@ static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st); static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st); static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st); static void mxf_write_h264_desc(AVFormatContext *s, AVStream *st); +static void mxf_write_cdci_or_rgba_desc(AVFormatContext *s, AVStream *st); static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st); static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st); static void mxf_write_s436m_anc_desc(AVFormatContext *s, AVStream *st); @@ -205,6 +210,16 @@ static const MXFContainerEssenceEntry mxf_essence_container_uls[] = { { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x17,0x00 }, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00 }, mxf_write_cdci_desc }, + // RawVideo + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, // MXF-GC Uncompressed Pictures + { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, // GC Picture Essence + { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x01,0x7F,0x00,0x00,0x00 }, // Uncompressed + mxf_write_cdci_or_rgba_desc }, + // V210 + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, // MXF-GC Uncompressed Pictures + { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, // GC Picture Essence + { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x01 }, // V210 + mxf_write_cdci_desc }, { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, @@ -346,6 +361,8 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = { { 0x3304, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x03,0x03,0x00,0x00,0x00}}, /* Black Ref level */ { 0x3305, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x03,0x04,0x00,0x00,0x00}}, /* White Ref level */ { 0x3306, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x05,0x03,0x05,0x00,0x00,0x00}}, /* Color Range */ + // RGBA Picture Essence Descriptor + { 0x3401, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x05,0x03,0x06,0x00,0x00,0x00}}, /* Pixel Layout */ // Generic Sound Essence Descriptor { 0x3D02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x01,0x04,0x00,0x00,0x00}}, /* Locked/Unlocked */ { 0x3D03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}}, /* Audio sampling rate */ @@ -1047,7 +1064,7 @@ static void mxf_write_multi_descriptor(AVFormatContext *s) mxf_write_uuid(pb, SubDescriptor, i); } -static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UID key) +static int64_t mxf_write_file_desc(AVFormatContext *s, AVStream *st, const UID key) { MXFContext *mxf = s->priv_data; MXFStreamContext *sc = st->priv_data; @@ -1090,6 +1107,7 @@ static const UID mxf_mpegvideo_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53, static const UID mxf_wav_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }; static const UID mxf_aes3_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 }; static const UID mxf_cdci_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x28,0x00 }; +static const UID mxf_rgba_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x29,0x00 }; static const UID mxf_generic_sound_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x42,0x00 }; static const UID mxf_avc_subdescriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x6E,0x00 }; @@ -1104,7 +1122,7 @@ static inline uint32_t rescale_mastering_luma(AVRational q) return av_rescale(q.num, FF_MXF_MASTERING_LUMA_DEN, q.den); } -static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID key) +static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UID key) { MXFStreamContext *sc = st->priv_data; AVIOContext *pb = s->pb; @@ -1115,7 +1133,7 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID const MXFCodecUL *color_primaries_ul; const MXFCodecUL *color_trc_ul; const MXFCodecUL *color_space_ul; - int64_t pos = mxf_write_generic_desc(s, st, key); + int64_t pos = mxf_write_file_desc(s, st, key); uint8_t *side_data; color_primaries_ul = mxf_get_codec_ul_by_id(ff_mxf_color_primaries_uls, st->codecpar->color_primaries); @@ -1131,6 +1149,8 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID if (!stored_width) stored_width = (st->codecpar->width+15)/16*16; + // TODO: V210 ==> Stored Width shall be a multiple of 48. + mxf_write_local_tag(s, 4, 0x3203); avio_wb32(pb, stored_width); @@ -1194,43 +1214,6 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID avio_wb32(pb, -((st->codecpar->height - display_height)&1)); } - // component depth - mxf_write_local_tag(s, 4, 0x3301); - avio_wb32(pb, sc->component_depth); - - // horizontal subsampling - mxf_write_local_tag(s, 4, 0x3302); - avio_wb32(pb, sc->h_chroma_sub_sample); - - // vertical subsampling - mxf_write_local_tag(s, 4, 0x3308); - avio_wb32(pb, sc->v_chroma_sub_sample); - - // color siting - mxf_write_local_tag(s, 1, 0x3303); - avio_w8(pb, sc->color_siting); - - // Padding Bits - mxf_write_local_tag(s, 2, 0x3307); - avio_wb16(pb, 0); - - if (st->codecpar->color_range != AVCOL_RANGE_UNSPECIFIED) { - int black = 0, - white = (1<component_depth) - 1, - color = (1<component_depth); - if (st->codecpar->color_range == AVCOL_RANGE_MPEG) { - black = 1 << (sc->component_depth - 4); - white = 235 << (sc->component_depth - 8); - color = (14 << (sc->component_depth - 4)) + 1; - } - mxf_write_local_tag(s, 4, 0x3304); - avio_wb32(pb, black); - mxf_write_local_tag(s, 4, 0x3305); - avio_wb32(pb, white); - mxf_write_local_tag(s, 4, 0x3306); - avio_wb32(pb, color); - } - if (sc->signal_standard) { mxf_write_local_tag(s, 1, 0x3215); avio_w8(pb, sc->signal_standard); @@ -1256,7 +1239,6 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID f1 *= 2; } - mxf_write_local_tag(s, 16, 0x320D); avio_wb32(pb, 2); avio_wb32(pb, 4); @@ -1328,6 +1310,52 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID return pos; } +static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID key) +{ + MXFStreamContext *sc = st->priv_data; + AVIOContext *pb = s->pb; + int64_t pos = mxf_write_generic_desc(s, st, key); + + // component depth + mxf_write_local_tag(s, 4, 0x3301); + avio_wb32(pb, sc->component_depth); + + // horizontal subsampling + mxf_write_local_tag(s, 4, 0x3302); + avio_wb32(pb, sc->h_chroma_sub_sample); + + // vertical subsampling + mxf_write_local_tag(s, 4, 0x3308); + avio_wb32(pb, sc->v_chroma_sub_sample); + + // color siting + mxf_write_local_tag(s, 1, 0x3303); + avio_w8(pb, sc->color_siting); + + // Padding Bits + mxf_write_local_tag(s, 2, 0x3307); + avio_wb16(pb, 0); + + if (st->codecpar->color_range != AVCOL_RANGE_UNSPECIFIED) { + int black = 0, + white = (1<component_depth) - 1, + color = (1<component_depth); + if (st->codecpar->color_range == AVCOL_RANGE_MPEG) { + black = 1 << (sc->component_depth - 4); + white = 235 << (sc->component_depth - 8); + color = (14 << (sc->component_depth - 4)) + 1; + } + mxf_write_local_tag(s, 4, 0x3304); + avio_wb32(pb, black); + mxf_write_local_tag(s, 4, 0x3305); + avio_wb32(pb, white); + mxf_write_local_tag(s, 4, 0x3306); + avio_wb32(pb, color); + } + + return pos; +} + static void mxf_update_klv_size(AVIOContext *pb, int64_t pos) { int64_t cur_pos = avio_tell(pb); @@ -1361,6 +1389,32 @@ static void mxf_write_avc_subdesc(AVFormatContext *s, AVStream *st) mxf_update_klv_size(s->pb, pos); } +static void mxf_write_cdci_or_rgba_desc(AVFormatContext *s, AVStream *st) +{ + AVIOContext *pb = s->pb; + const char* pixelLayoutData = NULL; + int64_t pos; + + if(ff_mxf_find_pixel_layout(&pixelLayoutData, st->codecpar->format) >= 0) + { + pos = mxf_write_generic_desc(s, st, mxf_rgba_descriptor_key); + + // pixel layout + mxf_write_local_tag(s, 16, 0x3401); + avio_write(pb, pixelLayoutData, 16); + + mxf_update_klv_size(s->pb, pos); + return; + } + + pos = mxf_write_cdci_common(s, st, mxf_cdci_descriptor_key); + mxf_update_klv_size(s->pb, pos); + + if (st->codecpar->codec_id == AV_CODEC_ID_H264) { + mxf_write_avc_subdesc(s, st); + } +} + static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st) { int64_t pos = mxf_write_cdci_common(s, st, mxf_cdci_descriptor_key); @@ -1385,7 +1439,7 @@ static void mxf_write_h264_desc(AVFormatContext *s, AVStream *st) static void mxf_write_s436m_anc_desc(AVFormatContext *s, AVStream *st) { - int64_t pos = mxf_write_generic_desc(s, st, mxf_s436m_anc_descriptor_key); + int64_t pos = mxf_write_file_desc(s, st, mxf_s436m_anc_descriptor_key); mxf_update_klv_size(s->pb, pos); } @@ -1432,7 +1486,7 @@ static int64_t mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, AVIOContext *pb = s->pb; MXFContext *mxf = s->priv_data; int show_warnings = !mxf->footer_partition_offset; - int64_t pos = mxf_write_generic_desc(s, st, key); + int64_t pos = mxf_write_file_desc(s, st, key); if (s->oformat == &ff_mxf_opatom_muxer) { mxf_write_local_tag(s, 8, 0x3002); @@ -2348,6 +2402,42 @@ static int mxf_parse_h264_frame(AVFormatContext *s, AVStream *st, return 1; } +static int mxf_parse_raw_frame(AVFormatContext *s, AVStream *st, + AVPacket *pkt, MXFIndexEntry *e) +{ + MXFContext *mxf = s->priv_data; + MXFStreamContext *sc = st->priv_data; + const MXFCodecUL* uls = ff_mxf_pixel_format_uls; + const char* pixelLayoutData = NULL; + int format; + + if (mxf->header_written) + return 1; + + format = st->codecpar->format; + + if(ff_mxf_find_pixel_layout(&pixelLayoutData, format) < 0) + { + while (uls->uid[0]) { + if (format == uls->id) { + sc->codec_ul = &uls->uid; + break; + } + uls++; + } + + if (!uls->uid[0]) + { + av_log(s, AV_LOG_ERROR, "no codec ul available for pixel format %s\n", av_get_pix_fmt_name(format)); + return 0; + } + } + + sc->frame_size = pkt->size; + + return 1; +} + static const UID mxf_mpeg2_codec_uls[] = { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x01,0x10,0x00 }, // MP-ML I-Frame { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x01,0x11,0x00 }, // MP-ML Long GOP @@ -2929,6 +3019,11 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_ERROR, "could not get h264 profile\n"); return -1; } + } else if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) { + if (!mxf_parse_raw_frame(s, st, pkt, &ie)) { + av_log(s, AV_LOG_ERROR, "could not get raw profile\n"); + return -1; + } } if (mxf->cbr_index) {