From patchwork Thu Apr 15 20:16:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26936 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 8C79A44ACE3 for ; Thu, 15 Apr 2021 23:17:31 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6B5BD68A4BE; Thu, 15 Apr 2021 23:17:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR06-AM7-obe.outbound.protection.outlook.com (mail-am7eur06olkn2080.outbound.protection.outlook.com [40.92.16.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A778689EC4 for ; Thu, 15 Apr 2021 23:17:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mI/GHgqr6DvZ0Tj7DyzA9R5yaj+/mXJaOrtyVeX/0WBKrjedVO5XYna1NgthdgSl5ShB2irQ8OuEiLVh7cw8uISZL8HAM0ZW6TsxKMd5mxrx0qdmuKSPekBVG+77iBPnXzBpYRumz28rXHEZQKJ0I5Egnuz53857mkWTVyF7z8H+2NgMyShVC1I5W+1rHj3NtaiLOhanYApEi4y5P2mmQSC/LSNV3rKgUFGRMfl91ByQzYLtwN6YrO8Q0/DlGso7HR6YqwPBxSxjgT9aiySDR+OfvK6JsehgktF7NG+nVdt/0KKfEXyLkkRE+F55HzeuZcTfdJDlccQLVVcUXtjWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=amL6rO4Cn9NdPnsAMXXLNZrGMN8YalUWv+d2dCGVQW0=; b=BiAsM+POclGFgJMe22cl2kPLlrttzT+KcjHHqCrnp97+ud3M3BCps0tReULxCFzTHXtfox7c0mYjBugjgOaqfjnyCU8NL5Fv71Q7l+/8sMd6+/5zLZg73D1ecKtAXX2rQih6TOXMw0dxO2akiwutsM4Py3VA72Iafy8bUiGvWcPku92fFmW5UeEz6TqK0aFmTPxS3oJ3QM1qAFJvhxkIQB27vW/PT596Q2Dy+TFykDrj/kFrKOQVxoewKu1aCOLYTXgKXy7SGpSHQrGbAHSWbKS3EXW6f7s/dslhN2N5Y1xtU6JwC+XnT4JYaP68MHp9ugyFpiS+pm4V+BaGqKXffg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=amL6rO4Cn9NdPnsAMXXLNZrGMN8YalUWv+d2dCGVQW0=; b=ssbubxsd2X87LMlDAgI1vxWSdT8ARLcgoMCy3EvE8dvOjOtUPCYHSojFRu+0y7WUysWhwIIAm3QOxHQKbm8ejub9JrolOuGo2++J0SgECTBJ9fqobQkNMd2j9OSijh2xSRdqkkibhzoSweTjKMtm0DYWvRpC+Wn2jPGv62YGsBxhZ7NbwEhLq9D9bf4TZZIfykDMXtn7AshoJecq/Dh4R37lU8USH6UjwVo8/bZ/DbCCIGD/HbAG7bJwLXQt/U7di2+zvBlJAZA/wsY2I64c/1NcJ3gxHDxKngRIDt3+HSkLG7/2pAWLk4eiWkv++gJ3A23uQeajUrHACHsqlNdYjw== Received: from AM7EUR06FT022.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::49) by AM7EUR06HT164.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16; Thu, 15 Apr 2021 20:17:18 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::53) by AM7EUR06FT022.mail.protection.outlook.com (2a01:111:e400:fc36::388) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16 via Frontend Transport; Thu, 15 Apr 2021 20:17:18 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:D29FD73486126F853FB375C6EE419CE5189DDAB137D70BB3215205BBE090DF07; UpperCasedChecksum:D15BB1D9F635FF0A91B98B07AD17B2D402EBDBF30B7069CDF2E9A50EBE3425DA; SizeAsReceived:8763; Count:48 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::45bb:c44f:2b75:23b7]) by HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::45bb:c44f:2b75:23b7%5]) with mapi id 15.20.4042.018; Thu, 15 Apr 2021 20:17:18 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Apr 2021 22:16:52 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [WXKAEV0Y0ucoD8J70ngoqan/ajuZJyd1] X-ClientProxiedBy: AM4PR0501CA0060.eurprd05.prod.outlook.com (2603:10a6:200:68::28) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210415201659.1810798-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.137.96) by AM4PR0501CA0060.eurprd05.prod.outlook.com (2603:10a6:200:68::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.18 via Frontend Transport; Thu, 15 Apr 2021 20:17:18 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: e8aee6e4-949a-4a51-3133-08d9004b77e1 X-MS-Exchange-SLBlob-MailProps: =?utf-8?q?7FNIAzWC7ToLWAUhajbk7q2oL1FszNoLIS?= =?utf-8?q?3Q7LANnUVmFsldf2R94K3vERNGpEtJZjIYjE1MziSCytmO1Et5X7IDzg5oHQhO/a+?= =?utf-8?q?rm9c0rMifW2VcUSRM0BZRdXIhVzjz1RK+WhJRqf5Nx5VEr+6pbPb6mhJH+lAto1xn?= =?utf-8?q?JZKxbQv73Rip4RrMBO49szKPv8PqEA9SXOrChlW15Glwotaw9bhRNkVGynzLZUaGe?= =?utf-8?q?KG9z8uTJ/L7QTSZQP4e0s4TVZbadCO5s9ebD+7mI/vapwhQ3GXukNMUDJYazBqwSd?= =?utf-8?q?d5lniU4/ViCxkk+LX3fl7zNi1NaDfkb326QurrTehzAMP5dnZ8Fr99i2YbyktCR72?= =?utf-8?q?S1+FzSCBQlxRrX7ohTx4v7qWDQ03vRwtwHFn5BNBusIIi5LiihtdPduP6rTwbRPX9?= =?utf-8?q?oEUtVTZr3OGKEMRr2kvLhvJSMC0p5d+nVg69NH8JWTUQhfpNnRaay/ddSHf5RT9jr?= =?utf-8?q?KWDTfLvNiZjAqKjw7T1u92SY3JZnZB+QAFFTigw1hUr5Y6BDr/KUsjVnoOXEe+YTD?= =?utf-8?q?8RKHI844pTkgEdYHe4Fi+B3DElaLqdXTMoZElpIqjRU5W++merXEfKImOoHF5kf5S?= =?utf-8?q?BMIdVC28/O+xJpFHO8arNM1+X1g1OpZ8oPlBLYrAASUtnMDfToam2jXMY031jMxA9?= =?utf-8?q?Q5c4pqn+ummUNfEv+DMsYxHAvMDZmdAwCIebBFIQRIIgxsDG5UBo+M5haNTMNQPTO?= =?utf-8?q?U4aKicdkMsrjr4H20nYKVn6W4va4NBgNtsmQN/4k1xc7SiFTjCYPUIEcCHuueQRlR?= =?utf-8?q?72HujUp89nBxny7cRHI2oE8HLqFJ59bMssgf5u/Jaheuj9rS4VWy8Sz40ZhE4OLYH?= =?utf-8?q?UzB0rIZZP5EX1xdtoYVZXTDawT0Oow251/BnAMGicnBbZ4tZOHIaE+8VfJoJ+nwLh?= =?utf-8?q?yfp3KHjWzTx+FJcWEvAX7ZZA4jSStJ7nLRrg/tS2KTIZ5G+nmzj26N6OoDDEpORK5?= =?utf-8?q?bPm2fzTW/ktCVeVbf2VC/O5sZ9+zfNXxYBoFCLQ6vLFguw7kse5u4Qw6KaqxLORku?= =?utf-8?q?2e14Qp+D6u710IcSbnUcwzS6w=3D?= X-MS-TrafficTypeDiagnostic: AM7EUR06HT164: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vYWwxIYuUJhnpFpuTJ8hdaXhuLp8ftGilHlGBGuDzOvbGLzvVPPTDkf0e3KRUUVZ3IxD7Ti7uKOrcgCAe45Org2mf2x9T2cEesmtzO5zy5KFCfLBpVYZHJiqPeNS0hg6JTfTe+r4r3QzQ+83gyzwPmHJ8+wN5MuOBh7gKiKNdTOTW/XHJiGG9P2RN3BeoJZnB6IiscSw0Xak+ulkSIBjqcCh08mPBDmXskO2QiFHmoI3fQqgo5tN9wh/ha0AwwvV5wVeXUZsXNn6rYrFeOhzLoSPWLaH2b3QIGMB0M+Y4dWMaMiBQL1tuCOrAUPASHETaKUEuImTp3BWOwAUfuTv3M+YX7Nk1DjA7aRRY7Nn4iV4Cwg3qLccDM/zue6nbMG9bRaeTNkKp6asMeTa+4JKAA== X-MS-Exchange-AntiSpam-MessageData: j77QHWzckL+JCNOdGWoWUeNrfGIcwdTueU/aRcaGwksUqQeb1ZaiwhXGlS1F14zgzX1dMciGrS7QcB/6WPJlYhGoCtE2Cgj4Dsv8ru5uoTMYYMIZ9iQ+4n6EV/H1VTtp0GL72cgQwIKx8KsFjlWzzw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8aee6e4-949a-4a51-3133-08d9004b77e1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2021 20:17:18.5479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT022.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT164 Subject: [FFmpeg-devel] [PATCH 03/10] fate/cover-art: Add test for writing id3v2 tags and apic with AIFF/MP3 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Notice that the order of the APIC tracks is currently wrong. This is a superposition of two bugs: (i) Both muxers write the attached pictures in the order they arrive in the muxer and not in the stream_index order, leading to attached pictures that are copied being written earlier because their timestamp is AV_NOPTS_VALUE, whereas the timestamp of the encoded pictures is 0. (ii) A bug in the id3v2 parsing code reverses the order of the parsed pictures. Signed-off-by: Andreas Rheinhardt --- tests/fate/cover-art.mak | 21 +++++- tests/ref/fate/cover-art-aiff-id3v2-remux | 82 +++++++++++++++++++++++ tests/ref/fate/cover-art-mp3-id3v2-remux | 55 +++++++++++++++ 3 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 tests/ref/fate/cover-art-aiff-id3v2-remux create mode 100644 tests/ref/fate/cover-art-mp3-id3v2-remux diff --git a/tests/fate/cover-art.mak b/tests/fate/cover-art.mak index 721c650b78..c42a4bc499 100644 --- a/tests/fate/cover-art.mak +++ b/tests/fate/cover-art.mak @@ -30,9 +30,26 @@ FATE_COVER_ART-$(CONFIG_WV_DEMUXER) += fate-cover-art-wv fate-cover-art-wv: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/luckynight_cover.wv -an -c:v copy -f rawvideo fate-cover-art-wv: REF = 45333c983c45af54449dff10af144317 +# Tests writing id3v2 tags (some with non-ASCII characters) and apics. +FATE_COVER_ART_REMUX-$(call ALLYES, FILE_PROTOCOL FLAC_DEMUXER MJPEG_DECODER \ + FLAC_DECODER SCALE_FILTER PNG_ENCODER \ + BMP_ENCODER PCM_S16BE_ENCODER AIFF_MUXER \ + AIFF_DEMUXER BMP_DECODER PNG_DECODER \ + FRAMECRC_MUXER PIPE_PROTOCOL) \ + += fate-cover-art-aiff-id3v2-remux +fate-cover-art-aiff-id3v2-remux: CMD = transcode flac $(TARGET_SAMPLES)/cover_art/cover_art.flac aiff "-map 0 -map 0:v -map 0:v -map 0:v -c:a pcm_s16be -c:v:0 copy -filter:v:1 scale -c:v:1 png -filter:v:2 scale -c:v:2 bmp -c:v:3 copy -write_id3v2 1 -metadata:g unknown_key=unknown_value -metadata compilation=foo -metadata:s:v:0 title=first -metadata:s:v:1 title=second -metadata:s:v:1 comment=Illustration -metadata:s:v:2 title=third -metadata:s:v:2 comment=Conductor -metadata:s:v:3 title=fourth -metadata:s:v:3 comment=Composer" "-map 0 -c copy -t 0.1" "" "-show_entries format_tags:stream_tags:stream_disposition=attached_pic:stream=index,codec_name" + +FATE_COVER_ART_REMUX-$(call ALLYES, FILE_PROTOCOL MP3_DEMUXER MJPEG_DECODER \ + SCALE_FILTER PNG_ENCODER BMP_ENCODER \ + MP3_MUXER BMP_DECODER PNG_DECODER \ + FRAMECRC_MUXER PIPE_PROTOCOL) \ + += fate-cover-art-mp3-id3v2-remux +fate-cover-art-mp3-id3v2-remux: CMD = transcode mp3 $(TARGET_SAMPLES)/exif/embedded_small.mp3 mp3 "-map 0 -map 0:v -map 0:v -c:a copy -filter:v:0 scale -filter:v:2 scale -c:v:0 bmp -c:v:1 copy -c:v:2 png -metadata:s:v:0 comment=Band/Orchestra" "-map 0 -c copy -t 0.1" "" "-show_entries stream_tags:stream_disposition=attached_pic:stream=index,codec_name" + FCA_TEMP-$(call ALLYES, RAWVIDEO_MUXER FILE_PROTOCOL) = $(FATE_COVER_ART-yes) FATE_COVER_ART = $(FCA_TEMP-yes) - $(FATE_COVER_ART): CMP = oneline + FATE_SAMPLES_AVCONV += $(FATE_COVER_ART) -fate-cover-art: $(FATE_COVER_ART) +FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_COVER_ART_REMUX-yes) +fate-cover-art: $(FATE_COVER_ART) $(FATE_COVER_ART_REMUX-yes) diff --git a/tests/ref/fate/cover-art-aiff-id3v2-remux b/tests/ref/fate/cover-art-aiff-id3v2-remux new file mode 100644 index 0000000000..207721fc71 --- /dev/null +++ b/tests/ref/fate/cover-art-aiff-id3v2-remux @@ -0,0 +1,82 @@ +d4a9481090a8bab1a3f072a8108a1d6a *tests/data/fate/cover-art-aiff-id3v2-remux.aiff +608914 tests/data/fate/cover-art-aiff-id3v2-remux.aiff +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: pcm_s16be +#sample_rate 0: 44100 +#channel_layout 0: 3 +#channel_layout_name 0: stereo +#tb 1: 1/90000 +#media_type 1: video +#codec_id 1: bmp +#dimensions 1: 350x350 +#sar 1: 0/1 +#tb 2: 1/90000 +#media_type 2: video +#codec_id 2: png +#dimensions 2: 350x350 +#sar 2: 1/1 +#tb 3: 1/90000 +#media_type 3: video +#codec_id 3: mjpeg +#dimensions 3: 350x350 +#sar 3: 1/1 +#tb 4: 1/90000 +#media_type 4: video +#codec_id 4: mjpeg +#dimensions 4: 350x350 +#sar 4: 1/1 +0, 0, 0, 1024, 4096, 0xdac4695d +1, 0, 0, 0, 368254, 0xfa7f4bd8 +2, 0, 0, 0, 184497, 0xc33f8d44 +3, 0, 0, 0, 19650, 0xd5662610 +4, 0, 0, 0, 19650, 0xd5662610 +0, 1024, 1024, 1024, 4096, 0xad05c909 +0, 2048, 2048, 1024, 4096, 0x97e3b8f8 +0, 3072, 3072, 1024, 4096, 0xb08180fa +[STREAM] +index=0 +codec_name=pcm_s16be +DISPOSITION:attached_pic=0 +[/STREAM] +[STREAM] +index=1 +codec_name=bmp +DISPOSITION:attached_pic=1 +TAG:title=third +TAG:comment=Conductor +[/STREAM] +[STREAM] +index=2 +codec_name=png +DISPOSITION:attached_pic=1 +TAG:title=second +TAG:comment=Illustration +[/STREAM] +[STREAM] +index=3 +codec_name=mjpeg +DISPOSITION:attached_pic=1 +TAG:title=fourth +TAG:comment=Composer +[/STREAM] +[STREAM] +index=4 +codec_name=mjpeg +DISPOSITION:attached_pic=1 +TAG:title=first +TAG:comment=Other +[/STREAM] +[FORMAT] +TAG:artist=Мельница +TAG:RATING=0 +TAG:album=Ангелофрения +TAG:title=Дороги +TAG:tracktotal=11 +TAG:totaltracks=11 +TAG:genre=Folk +TAG:date=2012 +TAG:track=2 +TAG:unknown_key=unknown_value +TAG:compilation=foo +[/FORMAT] diff --git a/tests/ref/fate/cover-art-mp3-id3v2-remux b/tests/ref/fate/cover-art-mp3-id3v2-remux new file mode 100644 index 0000000000..a3bc8c7891 --- /dev/null +++ b/tests/ref/fate/cover-art-mp3-id3v2-remux @@ -0,0 +1,55 @@ +c1b55a9a92226cd72d3f53ccd830d127 *tests/data/fate/cover-art-mp3-id3v2-remux.mp3 +399346 tests/data/fate/cover-art-mp3-id3v2-remux.mp3 +#tb 0: 1/14112000 +#media_type 0: audio +#codec_id 0: mp3 +#sample_rate 0: 44100 +#channel_layout 0: 3 +#channel_layout_name 0: stereo +#tb 1: 1/90000 +#media_type 1: video +#codec_id 1: png +#dimensions 1: 263x263 +#sar 1: 1/1 +#tb 2: 1/90000 +#media_type 2: video +#codec_id 2: bmp +#dimensions 2: 263x263 +#sar 2: 0/1 +#tb 3: 1/90000 +#media_type 3: video +#codec_id 3: mjpeg +#dimensions 3: 263x263 +#sar 3: 96/96 +0, -353590, -353590, 368640, 417, 0x15848290, S=1, 10, 0x034e0055 +1, 0, 0, 0, 165671, 0x7c1c8070 +2, 0, 0, 0, 208350, 0x291b44d1 +3, 0, 0, 0, 15760, 0x71d5c418 +0, 15050, 15050, 368640, 418, 0x46f684a4 +0, 383690, 383690, 368640, 418, 0x46f684a4 +0, 752330, 752330, 368640, 418, 0x46f684a4 +0, 1120970, 1120970, 368640, 418, 0x46f684a4 +[STREAM] +index=0 +codec_name=mp3 +DISPOSITION:attached_pic=0 +TAG:encoder=Lavf +[/STREAM] +[STREAM] +index=1 +codec_name=png +DISPOSITION:attached_pic=1 +TAG:comment=Other +[/STREAM] +[STREAM] +index=2 +codec_name=bmp +DISPOSITION:attached_pic=1 +TAG:comment=Band/Orchestra +[/STREAM] +[STREAM] +index=3 +codec_name=mjpeg +DISPOSITION:attached_pic=1 +TAG:comment=Other +[/STREAM]