From patchwork Mon May 7 10:38:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8831 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp2712620jad; Mon, 7 May 2018 03:41:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZowJ2x23fCdx0GVpQ9hvcR52yG6YYuCQox8eFSRs46c5cA7bu3A6dupLdxfa7neWgxHdD8a X-Received: by 2002:adf:a70c:: with SMTP id c12-v6mr9223402wrd.140.1525689692090; Mon, 07 May 2018 03:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525689692; cv=none; d=google.com; s=arc-20160816; b=YJB1XRIItKB97eJCCgQNpPOuWeVl1xQQ0glwQ7c2SPSsNUZ8jAoZgHV0vnKVPLb+X5 9ACp7UGKCNU863bcgI6TgrkQN5rdFaad//ix9izY7LTRuS8P4qyRSdCYGqsyJAaz8aPq G6QlyYkLbM6gDCexfx9wVQsnHf1YTyrW0Mj7U1NIpfE7h6x3DjwumIvo8YUS8tvVcZC2 kdaMEBtueFFN9Ox6efT9T+b32cXfJe5+dhviqwI7pFdUNrWwGXen18o89A3OkK90ajrv 7IVxpUN5ioMoNsgMBtDwPLAhrGryQGIA3qrdDqe+FCfuVj+cakhA7M6gg75WSelq1hsf VDgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=J33Y0xydpb32fv9YyfV71fYfP1wvleT+qVuhYrWBQO4=; b=fRsygJfJuPIqlW7UFcHQw1FWV3N9wECLAA1CTQ4C0YX8B01ezqheC3QjcD3+VHiD/Z ww64yP2mQY6pt+KaMUJhZh9sEZneyZdHjeH6ej6u7TBYaaL0jB4kXv6TsY+M4PqSJzvu dtdXPAG2RfRMcNM973RwJTbijsw+T0FCld+F3U067WCySpn6BM7037YbLTpk7WBW4X6q 6AeVgQv2b1CnI3XecWrPpts5/E5hNKutrEPgITUkGdYEOZXMYufXQbaejpVWuXaB0Gg3 /cUDO5RlfIcpvTmIV7bnTbAIQaN3or2949g2Xy5Z5sQo/LfomyCJH7H3Ew05SuBjYPWW ve+A== 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 s128-v6si4320686wms.208.2018.05.07.03.41.31; Mon, 07 May 2018 03:41:32 -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 94A3368A64C; Mon, 7 May 2018 13:39:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-1.mx.upcmail.net (vie01a-qmta-pe01-1.mx.upcmail.net [62.179.121.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D474C68A368 for ; Mon, 7 May 2018 13:39:25 +0300 (EEST) Received: from [172.31.218.52] (helo=vie01a-dmta-pe08-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fFdYm-00079F-Bk for ffmpeg-devel@ffmpeg.org; Mon, 07 May 2018 12:40:00 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fFdYl-0001Bs-Ol for ffmpeg-devel@ffmpeg.org; Mon, 07 May 2018 12:39:59 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id jNfs1x01F0S5wYM01NftsM; Mon, 07 May 2018 12:39:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 7 May 2018 12:38:16 +0200 Message-Id: <20180507103817.8320-12-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180507103817.8320-1-michael@niedermayer.cc> References: <20180507103817.8320-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 12/13] avformat/mxfenc: Add Stored F2 Offset / Image Start/End Offset for D10 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavformat/mxfenc.c | 18 ++++++++++++++++++ tests/ref/fate/copy-trac4914 | 2 +- tests/ref/fate/mxf-reel_name | 2 +- tests/ref/fate/time_base | 2 +- tests/ref/lavf/mxf | 6 +++--- tests/ref/lavf/mxf_d10 | 2 +- tests/ref/lavf/mxf_dv25 | 2 +- tests/ref/lavf/mxf_dvcpro50 | 2 +- tests/ref/lavf/mxf_opatom | 2 +- tests/ref/lavf/mxf_opatom_audio | 2 +- 10 files changed, 29 insertions(+), 11 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index d57f5372c6..eda26e1a3f 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -492,6 +492,8 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = { { 0x320B, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0E,0x00,0x00,0x00}}, /* Presentation Y offset */ { 0x3217, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x01,0x03,0x02,0x07,0x00,0x00,0x00}}, /* Display F2 offset */ { 0x320E, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}}, /* Aspect Ratio */ + { 0x3213, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x18,0x01,0x02,0x00,0x00,0x00,0x00}}, /* Image Start Offset */ + { 0x3214, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x18,0x01,0x03,0x00,0x00,0x00,0x00}}, /* Image End Offset */ { 0x3201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* Picture Essence Coding */ { 0x3212, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x03,0x01,0x06,0x00,0x00,0x00}}, /* Field Dominance (Opt) */ { 0x3215, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x05,0x01,0x13,0x00,0x00,0x00,0x00}}, /* Signal Standard */ @@ -1160,6 +1162,8 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke desc_size += 8; if (st->codecpar->color_range != AVCOL_RANGE_UNSPECIFIED) desc_size += 8 * 3; + if (s->oformat == &ff_mxf_d10_muxer) + desc_size += 8 + 8 + 8; mxf_write_generic_desc(s, st, key, desc_size); @@ -1169,6 +1173,20 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke mxf_write_local_tag(pb, 4, 0x3202); avio_wb32(pb, stored_height>>sc->interlaced); + if (s->oformat == &ff_mxf_d10_muxer) { + //Stored F2 Offset + mxf_write_local_tag(pb, 4, 0x3216); + avio_wb32(pb, 0); + + //Image Start Offset + mxf_write_local_tag(pb, 4, 0x3213); + avio_wb32(pb, 0); + + //Image End Offset + mxf_write_local_tag(pb, 4, 0x3214); + avio_wb32(pb, 0); + } + //Sampled width mxf_write_local_tag(pb, 4, 0x3205); avio_wb32(pb, st->codecpar->width); diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914 index 8bd8a23eef..4cadb21adc 100644 --- a/tests/ref/fate/copy-trac4914 +++ b/tests/ref/fate/copy-trac4914 @@ -1,4 +1,4 @@ -0576133def482f672d56369bc945f9d2 *tests/data/fate/copy-trac4914.mxf +ccce4918a1a4682cf431e7bb14b8120d *tests/data/fate/copy-trac4914.mxf 561721 tests/data/fate/copy-trac4914.mxf #tb 0: 1001/30000 #media_type 0: video diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name index 8c3469de61..1a1731e431 100644 --- a/tests/ref/fate/mxf-reel_name +++ b/tests/ref/fate/mxf-reel_name @@ -1 +1 @@ -a1a1e8df772ef28380ce95f12e7e8cb8 +1ab725f1bbf60e4ac127859727735784 diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base index aed683221d..9ba0e92b58 100644 --- a/tests/ref/fate/time_base +++ b/tests/ref/fate/time_base @@ -1 +1 @@ -8149dfa839d55d7f0c127d66ebe86433 +bedb164d507d07714c2a908f4ddb240a diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index c2bc32bcf6..d20bded186 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ -0e342e262c9ad13b3d4758e3666f453e *./tests/data/lavf/lavf.mxf +b445776832c7deba50665282a5987f2c *./tests/data/lavf/lavf.mxf 526393 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab -9d30acfb4cd73cfa6e46a01eea625521 *./tests/data/lavf/lavf.mxf +d130f0a9c7404fe4f2e7c975d8fd6a52 *./tests/data/lavf/lavf.mxf 561721 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0xf21b1b48 -76dfdb299f0ae2ed5094405dcd130d25 *./tests/data/lavf/lavf.mxf +41cd471fe44cd27ec558980c20b71676 *./tests/data/lavf/lavf.mxf 526393 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10 index fae3f40168..51f26c7b85 100644 --- a/tests/ref/lavf/mxf_d10 +++ b/tests/ref/lavf/mxf_d10 @@ -1,3 +1,3 @@ -7bad01ac8e0f223477f89a7443708ca8 *./tests/data/lavf/lavf.mxf_d10 +d92737f65555cceeb61ec6a79dd7a054 *./tests/data/lavf/lavf.mxf_d10 5332013 ./tests/data/lavf/lavf.mxf_d10 ./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488 diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25 index c54b556a4d..f6dc12e09b 100644 --- a/tests/ref/lavf/mxf_dv25 +++ b/tests/ref/lavf/mxf_dv25 @@ -1,3 +1,3 @@ -10abfd24b120f93b79d3da0f0677c449 *./tests/data/lavf/lavf.mxf_dv25 +ac97dec181de5ca64d096bfc38924978 *./tests/data/lavf/lavf.mxf_dv25 3834413 ./tests/data/lavf/lavf.mxf_dv25 ./tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52 diff --git a/tests/ref/lavf/mxf_dvcpro50 b/tests/ref/lavf/mxf_dvcpro50 index cd581528a1..e53ac45fc0 100644 --- a/tests/ref/lavf/mxf_dvcpro50 +++ b/tests/ref/lavf/mxf_dvcpro50 @@ -1,3 +1,3 @@ -a1dc7489ca5fa12e58401ef00b511b0d *./tests/data/lavf/lavf.mxf_dvcpro50 +fd35b5adf7601ef08cda45d0124a284a *./tests/data/lavf/lavf.mxf_dvcpro50 7431213 ./tests/data/lavf/lavf.mxf_dvcpro50 ./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4 diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom index 1a850133b5..5ace27e0fb 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -29023fcae1bcdb40982b0db26ec46a62 *./tests/data/lavf/lavf.mxf_opatom +e4236ef5fb2948ad6b3985f2c48471d8 *./tests/data/lavf/lavf.mxf_opatom 4717625 ./tests/data/lavf/lavf.mxf_opatom ./tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a diff --git a/tests/ref/lavf/mxf_opatom_audio b/tests/ref/lavf/mxf_opatom_audio index b5e0bbe5ed..ab161b0ec6 100644 --- a/tests/ref/lavf/mxf_opatom_audio +++ b/tests/ref/lavf/mxf_opatom_audio @@ -1,3 +1,3 @@ -81103a08d27122534790b33cf90b8125 *./tests/data/lavf/lavf.mxf_opatom_audio +0bb1e7389b51c604ed5dd98d8826a55f *./tests/data/lavf/lavf.mxf_opatom_audio 102969 ./tests/data/lavf/lavf.mxf_opatom_audio ./tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff