From patchwork Tue Dec 14 15:27:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 32495 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp7118248iog; Tue, 14 Dec 2021 07:28:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRoW+DHwXsMgUt+vCLwmyFbTK47wIEylMKV2ZATgm7oAGIO9p/nfD1wilN2D9mmtkXNyoY X-Received: by 2002:a05:6402:4301:: with SMTP id m1mr8821542edc.54.1639495699957; Tue, 14 Dec 2021 07:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639495699; cv=none; d=google.com; s=arc-20160816; b=SuYDDSQrcAH/JWPafWob13rGJA8l/sUb6Oyc4Hp05GhTur8sEeTPSf6xPZsmV/jIiw 9iTkJMUbcyhXz7QUj1wW7BKss3I4nyy2t6g8+vD6c9a/jISb1hZpKKFpovid3KZ6cRRU me7csAbzYyK9RIgkkhxJWzQvOk3bZrY5XYIa/AfstE7XJ5E+7qvV+dkLzQenw6zous+p 6aei3a0PpFHzQwhVMWQzpamRycfkQ7uiQANHHZKpcty0lWMAiw1nEUXg7nG0ckLo7cmN TYKexcO9lZ7joXiFgg7eobJ2q7KSbgCkdv9+2cQN86BxAFrzidFJ0hy1qPkXw0JHVspE kR6Q== 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=SXY6rncFAmQObwT9r262n1bZZa7lGv+YvpbyqluAveY=; b=CM9+BAH7bPt+CYsCyePBrLAIR71B07De0O9tqtq04lPp3+tmPzNO5q7odjoYe5gfBc 4/A6xj3DUnmlK98FLCGIYaAZoCFXcYQGspbxvtp/nNKFZGD+ZT+b9HqQyDW+MH1boILu DoDoeIy2jh/PZ6XV8jLAUPDL9UbW62l0Yr5uVWH7wQ21piai++3q4of2tiW6mqUTu4Pt 54MXFGAQyt03IKjO1zLTNouIdOquQRAxDZHJ+4dcITrDNph5iqBYsngUxuk3O6mzozp4 lzEPUXiNPKKfLqaS3ocmghwFWcUDu+FSzpgxMXC1ftzyYmsfot60+qE0QgfqGymgBAUI W2bw== 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 sh34si258490ejc.642.2021.12.14.07.28.19; Tue, 14 Dec 2021 07:28:19 -0800 (PST) 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 909BE68AFAA; Tue, 14 Dec 2021 17:28:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from srv-infra-2.infra.inf.glb.tvvideoms.com (www.inf.tvvideoms.com [213.205.126.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0281668AF8F for ; Tue, 14 Dec 2021 17:28:00 +0200 (EET) Received: from cji.paris (unknown [172.16.3.159]) by srv-infra-2.infra.inf.glb.tvvideoms.com (Postfix) with ESMTP id 16750415DC; Tue, 14 Dec 2021 15:28:00 +0000 (UTC) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Dec 2021 16:27:42 +0100 Message-Id: <20211214152743.57273-1-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/mxfenc: fix DNxHD GC container_ul 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: Nicolas Gaullier Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: vuoR4z17dot3 Signed-off-by: Nicolas Gaullier --- libavformat/mxfenc.c | 2 +- tests/ref/lavf/mxf_opatom | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index fcd9afda2a..512baa45d3 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -181,7 +181,7 @@ static const MXFContainerEssenceEntry mxf_essence_container_uls[] = { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x02,0x00,0x00,0x00 }, mxf_write_cdci_desc }, // DNxHD - { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x11,0x01,0x00 }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x11,0x01,0x00 }, { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x01,0x00,0x00 }, mxf_write_cdci_desc }, diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom index 61e755550b..b818f26c36 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -5d235c127ace64b1f4fe6c79a7ca8be6 *tests/data/lavf/lavf.mxf_opatom +e558e50a94d88762e07ab8149aced7b9 *tests/data/lavf/lavf.mxf_opatom 4717625 tests/data/lavf/lavf.mxf_opatom tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a From patchwork Tue Dec 14 15:27:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 32494 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp7118088iog; Tue, 14 Dec 2021 07:28:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiV/0K5xqGB0HIGQu9foS3iWlJ1R5jojLn33vdcTIEtiLRLOPw/HWjfyTiCW41gOWXVs/D X-Received: by 2002:a17:907:1b21:: with SMTP id mp33mr6318441ejc.580.1639495691140; Tue, 14 Dec 2021 07:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639495691; cv=none; d=google.com; s=arc-20160816; b=XyExG51K2Gcd/EShnKCw5T3Y13gW3Apdl0bkwhz81Fz2KjQuhsmDBJ5o/IF9MlVXzD AVKZX4e74h4+azi3RpsW5FO/8Y86kyKTHRVFg1eye3rgU7OZsbsg/nVHzZAgoO5D4EY1 GW4Ji2z1+YfulUPgfyxyYcEIGHZAHsu2MCbCOWstwRfTVH4V4zbL2HKItaDd+kxsJO9K X4bcgAEDrD82CGFgwPYEbkm7kYD5E+vTSXKap2/C6/0cGIqiymGp6zC1dVLUumyRTH5Z ByZ29JE67HzyKNst+kAhODu14rimJICbghVUXu3AEjAZTaow0rZbqQgcklDxfwrrMLXm JANA== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=j/Ku14zR6Oduro7wRfRV1E91t2cpt26Mc67gmjkarxs=; b=oQj0TkutKVWBmfY7zZy+HsRhfcys0gyEnkZoyHOwD4hPXkfGmmCo7DpVF489D2WuU7 smj7f0ghKJ/GqiP/ELpdUBPjqUtA6r2a0VdAOTrLUEfsJK628d7SYFK1AsOE5Th5RaNc cXRnr7XXuYWKbmhp1JvenldWNJ2p+8eVFLhXDs0rdUqTNicYBsdazcMLkSRuLBapIfTG gNfkUqo+6cSXpbkOE0y3Xaey/ZBPOS/c6g6krYXhTQ+R9UQguGheEI4qebhgJM5BtWWf 09I8chmgE4ioCl+9ulxNGoKyA/A+ITeqC/gow8snZQEhkTrYNWmE+4x424Sa+DLgY1a2 8DYA== 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 z23si175688edi.571.2021.12.14.07.28.10; Tue, 14 Dec 2021 07:28:11 -0800 (PST) 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 76B9068AF9F; Tue, 14 Dec 2021 17:28:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from srv-infra-2.infra.inf.glb.tvvideoms.com (www.inf.tvvideoms.com [213.205.126.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 048A568AF94 for ; Tue, 14 Dec 2021 17:28:00 +0200 (EET) Received: from cji.paris (unknown [172.16.3.159]) by srv-infra-2.infra.inf.glb.tvvideoms.com (Postfix) with ESMTP id 47DC04187D; Tue, 14 Dec 2021 15:28:00 +0000 (UTC) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Dec 2021 16:27:43 +0100 Message-Id: <20211214152743.57273-2-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211214152743.57273-1-nicolas.gaullier@cji.paris> References: <20211214152743.57273-1-nicolas.gaullier@cji.paris> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/mxfenc: fix DNxHD GC element_type 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: Nicolas Gaullier Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zU/WBNofdTLk The values for the essence element type were updated in the spec from 0x05/0x06 (ST2019-4 2008) to 0x0C/0x0D (ST2019-4 2009). Fixes ticket #6380. Thanks-to: Philip de Nier Thanks-to: Matthieu Bouron Signed-off-by: Nicolas Gaullier --- libavformat/mxfenc.c | 9 ++++++++- tests/ref/lavf/mxf_opatom | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 512baa45d3..bae41a774d 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -32,6 +32,7 @@ * SMPTE 379M MXF Generic Container * SMPTE 381M Mapping MPEG Streams into the MXF Generic Container * SMPTE 422M Mapping JPEG 2000 Codestreams into the MXF Generic Container + * SMPTE ST2019-4 (2009 or later) Mapping VC-3 Coding Units into the MXF Generic Container * SMPTE RP210: SMPTE Metadata Dictionary * SMPTE RP224: Registry of SMPTE Universal Labels */ @@ -182,7 +183,7 @@ static const MXFContainerEssenceEntry mxf_essence_container_uls[] = { mxf_write_cdci_desc }, // DNxHD { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x11,0x01,0x00 }, - { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, + { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x0C,0x00 }, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x71,0x01,0x00,0x00 }, mxf_write_cdci_desc }, // JPEG2000 @@ -2674,6 +2675,12 @@ static int mxf_init(AVFormatContext *s) memcpy(sc->track_essence_element_key, mxf_essence_container_uls[sc->index].element_ul, 15); sc->track_essence_element_key[15] = present[sc->index]; + if (s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) { + // clip-wrapping requires 0x0D per ST2019-4:2009 or 0x06 per previous version ST2019-4:2008 + // we choose to use 0x06 instead 0x0D to be compatible with AVID systems + // and produce mxf files with the most relevant flavour for opatom + sc->track_essence_element_key[14] = 0x06; + } PRINT_KEY(s, "track essence element key", sc->track_essence_element_key); if (!present[sc->index]) diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom index b818f26c36..e34cf2559e 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -e558e50a94d88762e07ab8149aced7b9 *tests/data/lavf/lavf.mxf_opatom +aab6397829bd90f0c77a3f9fde53bb9c *tests/data/lavf/lavf.mxf_opatom 4717625 tests/data/lavf/lavf.mxf_opatom tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a