From patchwork Sat Jan 30 07:13:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 25270 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1E52B44B321 for ; Sat, 30 Jan 2021 09:19:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E6E5F68A778; Sat, 30 Jan 2021 09:19:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0EADB689A8B for ; Sat, 30 Jan 2021 09:19:42 +0200 (EET) Received: by mail-pg1-f182.google.com with SMTP id o63so8138620pgo.6 for ; Fri, 29 Jan 2021 23:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WeQ5DBCfCfPf1AbMPArpvVecSpjsag2ZR5Km69qLCHw=; b=gJsoXLpsAimRon0rKQo1/PDysqyagtSoWfigbo9gq6Es1cAGzCC9TF6xtdUae6TCo0 7cHHjwvu9IpQdO3mLnf1RolLJF2dAjieoG41g6Zgd7HsHjEdDDdogxZdEBMiq1OruZcN l/RfPmvxmkpyri8OWf1q6DQ6KzNbenVxk/y4hbQx26mD3NPLtA46GSf1GYU7HfsDwFnJ rnMSE6xxqt3ZQ0gMJUULtBtgxOIqra1msuXf1eBLo7oblGwG5/5rQq/2OmJdl0zL2n/p lZJ8pB9Ph7/10Nh4HG7nQpLqYHbSd6hFulGToOWmjDi1KcFeQ6P6IpmHGi1inJeYKDD2 Mo5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WeQ5DBCfCfPf1AbMPArpvVecSpjsag2ZR5Km69qLCHw=; b=DYdI2jzFqBenZ07Eh+qL7rP/aJ8b0fr77CiE+Tx39jdapdaxoDVQFnxdM5Unn33aJ5 +cDNRkeuwzPBSiD2tecN8+c1vbbq14FHAjChxdvkd8eiH0txKsjYEk9yJI5520mrgJBR FwqNQcfkmVbkGk1Y1TvEE7XGaGnY5frEdT9z9/X9C4jaG2Ijer6Y3cGt1ibfUoEbybvW JZdI6LbN0sei+zQvrssK5mveul8DNg2UWqMBbkcdqmTyKYUTGeuRi6PHAnYQbfxuJFZN z8yv9nRKD8fSc4RMARTbLBSvsYaH+8bge22Vnr9XxO6iHoK71ostijkR5lST7A3gH3fF 0vmA== X-Gm-Message-State: AOAM531SZsDGY3ssd5MhaM+JWjX35Z2rrZTgpaq4dCa7ZITY51onFw+s EMLUcGIH3Ug4eXRpinsLHuxoPNJL5ts= X-Google-Smtp-Source: ABdhPJy/Gia84bBkLoBR8Nd8c83kf9n33Imt8e+pWCX82g93rXDczxrqjLQ/vhulNcBZ8lR5YD/u3g== X-Received: by 2002:a63:a804:: with SMTP id o4mr8060660pgf.67.1611990824658; Fri, 29 Jan 2021 23:13:44 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id k141sm11504545pfd.9.2021.01.29.23.13.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jan 2021 23:13:43 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sat, 30 Jan 2021 15:13:39 +0800 Message-Id: <1611990820-10877-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1610168848-17933-3-git-send-email-lance.lmwang@gmail.com> References: <1610168848-17933-3-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v5 1/2] avformat/mxf: add platform local tag 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Please check the string of platform with below command: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf ./ffmpeg -i out.mxf .... application_platform: Lavf58.65.101 (linux) Signed-off-by: Limin Wang --- configure | 1 + libavformat/mxfenc.c | 4 ++++ tests/ref/fate/copy-trac4914 | 2 +- tests/ref/fate/mxf-d10-user-comments | 2 +- tests/ref/fate/mxf-opatom-user-comments | 2 +- tests/ref/fate/mxf-reel_name | 2 +- tests/ref/fate/mxf-user-comments | 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 +- 14 files changed, 19 insertions(+), 14 deletions(-) diff --git a/configure b/configure index df298b4..a092a6b 100755 --- a/configure +++ b/configure @@ -7579,6 +7579,7 @@ cat > $TMPH <priv_data; @@ -726,6 +727,7 @@ static void mxf_write_identification(AVFormatContext *s) const char *company = "FFmpeg"; const char *product = s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer"; const char *version; + const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFROM_IDENT; int length; mxf_write_metadata_key(pb, 0x013000); @@ -735,6 +737,7 @@ static void mxf_write_identification(AVFormatContext *s) "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION); length = 100 +mxf_utf16_local_tag_length(company) + mxf_utf16_local_tag_length(product) + + mxf_utf16_local_tag_length(platform) + mxf_utf16_local_tag_length(version); klv_encode_ber_length(pb, length); @@ -753,6 +756,7 @@ static void mxf_write_identification(AVFormatContext *s) store_version(s); mxf_write_local_tag_utf16(pb, 0x3C04, version); // Version String + mxf_write_local_tag_utf16(pb, 0x3C08, platform); // Platform // write product uid mxf_write_local_tag(pb, 16, 0x3C05); diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914 index e8f8afb..743dc8c 100644 --- a/tests/ref/fate/copy-trac4914 +++ b/tests/ref/fate/copy-trac4914 @@ -1,4 +1,4 @@ -5d58a32f21b78169d925845f783054e6 *tests/data/fate/copy-trac4914.mxf +f5150fb82c1bb5a90906fce93dcc3f76 *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-d10-user-comments b/tests/ref/fate/mxf-d10-user-comments index 3b9d9d2..c35add0 100644 --- a/tests/ref/fate/mxf-d10-user-comments +++ b/tests/ref/fate/mxf-d10-user-comments @@ -1 +1 @@ -fe9b43f5b6e7737fe2670b660fd3d860 +7bb9f39e8e05724525154de17f0235d8 diff --git a/tests/ref/fate/mxf-opatom-user-comments b/tests/ref/fate/mxf-opatom-user-comments index be57eb4..ec4fdff 100644 --- a/tests/ref/fate/mxf-opatom-user-comments +++ b/tests/ref/fate/mxf-opatom-user-comments @@ -1 +1 @@ -9b3d7201c37c5783702774e46e0da141 +8475bebf3448a972ae89ba59309fd7d6 diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name index acda8fe..d50f0f6 100644 --- a/tests/ref/fate/mxf-reel_name +++ b/tests/ref/fate/mxf-reel_name @@ -1 +1 @@ -422d6ed4821e7bbecbcdecc553abc6e4 +ce49a0361d3f79106e1952d387eace51 diff --git a/tests/ref/fate/mxf-user-comments b/tests/ref/fate/mxf-user-comments index 3b77db9..5fcdc58 100644 --- a/tests/ref/fate/mxf-user-comments +++ b/tests/ref/fate/mxf-user-comments @@ -1 +1 @@ -c77b632dbcdacd6466e1ec794917556e +956f653cd75e1a319569caec9df81b4f diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base index d3c9795..28815d0 100644 --- a/tests/ref/fate/time_base +++ b/tests/ref/fate/time_base @@ -1 +1 @@ -e5c9da6972b6f6e7b15bcbbf20a9dbd1 +78ac0348027b75d73acb8bea14e67a59 diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index 1b1fe1a..21bf2be 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ -1703da2e9f0ca49a5f0bcbcc6944c9c0 *tests/data/lavf/lavf.mxf +8938d5c4a396ff1b24d10d4f917ae1c9 *tests/data/lavf/lavf.mxf 526393 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x8dddfaab -b44c4f138f1a87256211c3112dd52c87 *tests/data/lavf/lavf.mxf +93ea2cfdf5dda7fffdc0d2fdcfb6a9a4 *tests/data/lavf/lavf.mxf 561721 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x96ff1b48 -9ede3c95054c30eb815fbe598a1f097b *tests/data/lavf/lavf.mxf +87bdf844ae34bcc758e44419e80177a0 *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 19e6f20..47ef244 100644 --- a/tests/ref/lavf/mxf_d10 +++ b/tests/ref/lavf/mxf_d10 @@ -1,3 +1,3 @@ -c72f1f3d6ce555f96946c421f705f880 *tests/data/lavf/lavf.mxf_d10 +7f16902e28718c2a92bc082400a1c6ee *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 2951538..92509cf 100644 --- a/tests/ref/lavf/mxf_dv25 +++ b/tests/ref/lavf/mxf_dv25 @@ -1,3 +1,3 @@ -5048796729fba47e9614a177c370e850 *tests/data/lavf/lavf.mxf_dv25 +106e33eb1634595623f0334e92204b65 *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 9df2fc9..2d569b0 100644 --- a/tests/ref/lavf/mxf_dvcpro50 +++ b/tests/ref/lavf/mxf_dvcpro50 @@ -1,3 +1,3 @@ -7023122fc4bcd5c12de6a33cc78ce9b8 *tests/data/lavf/lavf.mxf_dvcpro50 +3d5a303c22666996700f0e8f6e4cb938 *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 bff36e0..61e7555 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -8a4c5680b0955d4e2abecfb1c37a56d4 *tests/data/lavf/lavf.mxf_opatom +5d235c127ace64b1f4fe6c79a7ca8be6 *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 5c65a37..97362e7 100644 --- a/tests/ref/lavf/mxf_opatom_audio +++ b/tests/ref/lavf/mxf_opatom_audio @@ -1,3 +1,3 @@ -697f4eb4a472909945222d7750145f80 *tests/data/lavf/lavf.mxf_opatom_audio +c356a3fdd49a1e015961678e837c12bb *tests/data/lavf/lavf.mxf_opatom_audio 102969 tests/data/lavf/lavf.mxf_opatom_audio tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff From patchwork Sat Jan 30 07:13:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 25271 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9C8D5442D62 for ; Sat, 30 Jan 2021 09:40:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6BCF5689AB4; Sat, 30 Jan 2021 09:40:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D1B56881A1 for ; Sat, 30 Jan 2021 09:39:55 +0200 (EET) Received: by mail-il1-f178.google.com with SMTP id z18so10394769ile.9 for ; Fri, 29 Jan 2021 23:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ek8NlrU9bHsIj/pX9punP5oyrZndmGyfajYMfwncNOE=; b=MmDapO0PZ2y8pA0tv3OsqGSYFCwG1t2OgY9898iL3NL3jfEaVkk2kNBF3wWJuSntAV 4krE/peXAQEVu7W1Ft0yi3ExFz2aQXTRGXqr8Se/q52c6OTGzirwflTcO5zDzBzOtlsy FL+5lKNFkXu8aULg2i9PpMcTMByeyd0kbKIcLdEAPnAoNrZKRJu+XMLpkAGZ4BZLXAPI tejZAJ22tTdAvibdHrokJ8k1kqI7QXcjXsu4ehOv08ZcQKoPmMi6y3pOnRJdcVJK4cpB 5FtpH5xcp20du3xtYigZXjJ+nbhGJssRRYC8X+jmjJS/sm0JZkuHvTb3+njgyY4xYCEQ TThQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ek8NlrU9bHsIj/pX9punP5oyrZndmGyfajYMfwncNOE=; b=gwBIaYI06HDTNyPa8dcecI10JryjFszHv3WsRdCdfQTuTkjXKtmeedwG1I/8eXrxre +G8tb7XX5tE2FTsIm7dh32KILZDUjxwfezupxI7xqCBSN87AFv0f4xOaJpyXFk6CuCCZ DDTpb4rVzXm7Gxg8Jb5NeEVAZq/s6WkcubbWPIlqzWqkaEKnWvzU6YZBFN0BYon/FYXZ OKpXQC3PBAw8HXi2DiTvF4ZboLehm0BesE0v2Vyj9wW9bV0r4MmTPcBti23vGxZGaPUN jNBOjZ2TvqWxttlt7yUf8Ix9/b1qGpFEGz0TTMtRsmJjwh0RpjZnL5phh180M19AtqP1 7qFA== X-Gm-Message-State: AOAM533iK0U8sXfQGOfliqDYWzZ2BHJOZcKC2MnhduVgVfZUOsqIgrSd +3FOU1TXTgZ99r8uZgLNnyAcu/Fmfdo= X-Google-Smtp-Source: ABdhPJxdA7Oo/Yl/VcCiUOV2b7l56KaWzJHKK5JBy+6TtHaKoE4lX2mugYKmTzErlQ/kWCbt3gI4IA== X-Received: by 2002:a63:3e0c:: with SMTP id l12mr8010958pga.165.1611990826327; Fri, 29 Jan 2021 23:13:46 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id k141sm11504545pfd.9.2021.01.29.23.13.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jan 2021 23:13:45 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sat, 30 Jan 2021 15:13:40 +0800 Message-Id: <1611990820-10877-2-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1611990820-10877-1-git-send-email-lance.lmwang@gmail.com> References: <1610168848-17933-3-git-send-email-lance.lmwang@gmail.com> <1611990820-10877-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v5 2/2] avformat/mxfenc: prefer to use the configured metadta 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang The metadata company_name, product_name, product_version from input file will be deleted to avoid overwriting information Please to test with below command: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf and ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy \ -metadata company_name="xxx" \ -metadata product_name="xxx" \ -metadata product_version="xxx" \ out.mxf Signed-off-by: Limin Wang --- fftools/ffmpeg_opt.c | 3 +++ libavformat/mxfenc.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index bf2eb26..07308cc 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2641,6 +2641,9 @@ loop_end: if(o->recording_time != INT64_MAX) av_dict_set(&oc->metadata, "duration", NULL, 0); av_dict_set(&oc->metadata, "creation_time", NULL, 0); + av_dict_set(&oc->metadata, "company_name", NULL, 0); + av_dict_set(&oc->metadata, "product_name", NULL, 0); + av_dict_set(&oc->metadata, "product_version", NULL, 0); } if (!o->metadata_streams_manual) for (i = of->ost_index; i < nb_output_streams; i++) { diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 2cf443f..d69bc9a 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -724,9 +724,13 @@ static void mxf_write_identification(AVFormatContext *s) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; - const char *company = "FFmpeg"; - const char *product = s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer"; - const char *version; + AVDictionaryEntry *com_entry = av_dict_get(s->metadata, "company_name", NULL, 0); + AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0); + AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0); + const char *company = com_entry ? com_entry->value : "FFmpeg"; + const char *product = product_entry ? product_entry->value : s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer"; + const char *version = NULL; + const char *product_version = version_entry ? version_entry->value : AV_STRINGIFY(LIBAVFORMAT_VERSION); const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFROM_IDENT; int length; @@ -734,7 +738,7 @@ static void mxf_write_identification(AVFormatContext *s) PRINT_KEY(s, "identification key", pb->buf_ptr - 16); version = s->flags & AVFMT_FLAG_BITEXACT ? - "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION); + "0.0.0" : product_version; length = 100 +mxf_utf16_local_tag_length(company) + mxf_utf16_local_tag_length(product) + mxf_utf16_local_tag_length(platform) +