From patchwork Tue Dec 12 07:32:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 45085 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3428821pzf; Mon, 11 Dec 2023 23:33:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZgE71P/Vs+WslBxxlWVPrbi2ocS5Q32+hHTJLVdzZQwGjAIQJ6M7m3f22thJGGs7cF8Yf X-Received: by 2002:a05:6512:1110:b0:50b:f53d:e460 with SMTP id l16-20020a056512111000b0050bf53de460mr1639190lfg.135.1702366390590; Mon, 11 Dec 2023 23:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702366390; cv=none; d=google.com; s=arc-20160816; b=oq9V17hkioP+mIkp9jJHerPUcjGaowNJNE86oMoLDw3fpfkdDclpOGI9xnsGW9N1En ZkwZoOIJ+fObFiF5DGxa84t9y1DbilTegu4LgqtVhYg+TqlrjvNDCeoVL+1VYoPCv4hI NXLsNlHYEv+Nhc01Ge5YysOuag+VpYcpG+t5v+1lbVcxoBpQLwgZbOKZO2upHUtwe9pu rZx/5d19Nt4Hh+pnDnujiTAlVi2Z+DH/oDdP0SMxGpthjV+jdAqWXkFNSC2hHBCa+ynF dVoEK1G3x58KqS0l93SpZPE1RTBRYy7STf2InLV5INrxXRbRX/oe74+0k241YF7d8+WL 5ekg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=RUcYBpNLNgiXiLA165ROlM2NOTcZB5izBvPHIdDkTA4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=S4HImQO6wjhuRwedKAv6ke37DWYSZrCSnvIbKAndgVDTStewaNmEIehE2xTXNomGFd l+huO8iZx6JXTzvgTf2qiQhYFz/cUOtyG7CYDg8gmYue/riNFGwIkq7Q69elumg9ujbZ H7Lz7PhKpLOpbzJwfOfVIaNBTuns32TqBnah6qqtwYtXJdKvH2QL/6ZwDGP90klxzNbe o1KjsSaXvc2RJ/dae4PaYUfMbkMxkRuz3NX2iKo4sZjBp3D7sZsXYcc8CMcKmOj52Sk+ e5Nj1V0aDAIAp8MAD4iB7FYuAu3o26LFLDYDrMH8BTaVQWnoJMk2dCVMJWbSjStX2RDS V78g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=TqEk6LnL; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z2-20020a05640240c200b00550db2b31ebsi3251873edb.294.2023.12.11.23.33.09; Mon, 11 Dec 2023 23:33:10 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=TqEk6LnL; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEE2B68D04C; Tue, 12 Dec 2023 09:32:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC5FF68D176 for ; Tue, 12 Dec 2023 09:32:49 +0200 (EET) Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2cb20b965dbso50920391fa.1 for ; Mon, 11 Dec 2023 23:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702366369; x=1702971169; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=IM+ann0ldiG6q/Ae6Ihf69Lf8RxE0kSDnLumt1DFH/0=; b=TqEk6LnL1y2c7C8NoxBDChZS2izEwpqraXM5RlroS7fgrHvOkMsOee1mi01q3xFUyH v5uz3qEZqvBiWv33ABy7GSjviCyZBdn58l02gTBu+7UpVAE5zqIvcJpRpLFoU2wKJW1p hodSOxCkrfSW7J054e5M1UAH+/s2y0yDg2iXeYKiasuyDXNg/WVsxsUZuhqswIz5skwg 1zbo5FgeKIS0kmoPOl+eOb5h+1IFvY1B4z3Clc0606NRQvp64P3qwJ7MiX2bzeBWjgMP MT2KBpDznjXWQSSBAR1GFwuZCCbwFEtnmdxhyTvhnTGXNyn85GjlqKk59Rpgx0xBt9Xl MNyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702366369; x=1702971169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IM+ann0ldiG6q/Ae6Ihf69Lf8RxE0kSDnLumt1DFH/0=; b=E8+NDINlpWDbOr52vtucU1IUWMUSRUkDukjNUyjv1mI4+EpP2ZuG+NyU9x/Ym6akMO xWZ+sp9p+H2KpeWlTnqQku5wHZchHgg/Y2KZGav9lcJX68HFBFk2w+fj60qJvp04EHp2 3d19Xlvj+Oo1Drn1kcg8ufm1X9ZK7qXMhIBuWUov1T7/QaSge2szJspm71Vwf+vWeqXa T5pgLK8McGoRuQB3ZoClDr9ZSLdVrooQ8yfvo/eaj0BELmawIDjTKX01GyEEjNlCvmPt h2K0U/sRtyCBp54gK3H5MRepLTs+LdGUNGXiPPtammCxq489k1kTPuvUCB9TdQv9Sd5y PxjQ== X-Gm-Message-State: AOJu0YwsPDFcTX7uuH6eTZww+vbQ9tisT6gtmtbveW2nDwplUT+Bpoxt 1FS0ie9tzYcNOViDUfIoKAZCtUBJcw4= X-Received: by 2002:a2e:818f:0:b0:2c9:fece:5be0 with SMTP id e15-20020a2e818f000000b002c9fece5be0mr1136600ljg.144.1702366368736; Mon, 11 Dec 2023 23:32:48 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id a18-20020a2e9812000000b002c9f3ba5c22sm1458045ljj.118.2023.12.11.23.32.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:32:48 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Dec 2023 09:32:25 +0200 Message-ID: <20231212073242.10967-2-jeebjp@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231212073242.10967-1-jeebjp@gmail.com> References: <20231212073242.10967-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/3] tests/fate-run: add support for specifying the final encode muxer in `transcode` 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dMC+jECYe8gp From: Jan Ekström This allows for direct dumping of the packets' contents (useful for text based formats), while getting the timestamps/sizes etc from ffprobe. If used via TRANSCODE, the actually utilized muxer should be added within the last argument as an additional dependency, as that is not done automatically. Signed-off-by: Jan Ekström --- tests/fate-run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 8efb1586b8..73c4d16f21 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -257,7 +257,9 @@ transcode(){ additional_input=$7 final_decode=$8 enc_opt_in=$9 + final_encode_muxer="${10}" test -z "$additional_input" || additional_input="$DEC_OPTS $additional_input" + test -z "$final_encode_muxer" && final_encode_muxer="framecrc" encfile="${outdir}/${test}.${enc_fmt}" test $keep -ge 1 || cleanfiles="$cleanfiles $encfile" tsrcfile=$(target_path $srcfile) @@ -267,7 +269,7 @@ transcode(){ do_md5sum $encfile echo $(wc -c $encfile) ffmpeg $DEC_OPTS $final_decode -i $tencfile $ENC_OPTS $FLAGS $final_encode \ - -f framecrc - || return + -f $final_encode_muxer - || return test -z $ffprobe_opts || \ run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || return } From patchwork Tue Dec 12 07:32:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 45086 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3428876pzf; Mon, 11 Dec 2023 23:33:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxVYpxO4SyCo3VJi1KxKJ01Uoou/5lHvj7uDdawKZSVjmN+a4eGADIoCHMyZ2vralvcx+3 X-Received: by 2002:a50:c099:0:b0:54c:c31d:a808 with SMTP id k25-20020a50c099000000b0054cc31da808mr7098725edf.0.1702366397918; Mon, 11 Dec 2023 23:33:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702366397; cv=none; d=google.com; s=arc-20160816; b=IrjQ/PKzfzwIbBxfR07mpw0eAO/ZT41ZWMyyaJWVrs1BW0mjbfbHqd2I2pv8TxOJrm trHHwFK4fUFei1qvwy95+hNtRt7hPIUVF6v/LoVBks1cFj7CcWQrILzHI8CLISrUOt3I 9bnQodSZmV91L+LSn7U7wLb4Ju7WZXIj44rhdY1eF8GNEyMbivz+bmS8JIRmfZStYmdY DvYJHkFciMpVLr1qBhaEKsbfG5wqDDtsO+reRssSQTwbzntFJrOxItfijsMV1kRivf0P h6H3Y8j0p50sB8/GfgR7TO0h0MKg7HJMQjPU7fwaxbNfknS53l5ecLd+MVFAt6rhp130 fENQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=ztWxAcNGEHkuI5I2kddernxXRHKziADilkz3yisMyxw=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=NHCbC9albNtkLIfLLWynqM/FRa/2BBFBXq88f+9C7BIAD8FIwPJtXxmZ/frSBY3XeJ E1KwjC3qGCIBRxWxGaTHb5sIZGkNcVsIgMLGKsdVtG1nHb18JKYgGRCq5QBecZEtdsAt 8AzGIh+3rMNV2Sb/HdCR2Pno6VJcTGj6IyroBlL3e4QOHXMur62w3/8FNDSY7+tz7U/V 7JFtuWjFiWAmyfJEfnalJJrcCWjHYNn0fQrAgN8oWmjcU1hZzTGK+EQ/TDo3w85AumUA ILXXElAnp3MQdbmUE6S1wNzu4EjP0I88fwFp3b56e25Jk1qk0CfXopvlaNMWqBq3xugw OJLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ibQXRm17; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bo22-20020a0564020b3600b0054d4f45e134si4209321edb.686.2023.12.11.23.33.17; Mon, 11 Dec 2023 23:33:17 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ibQXRm17; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D5A5068D1C0; Tue, 12 Dec 2023 09:32:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE2AC68D176 for ; Tue, 12 Dec 2023 09:32:49 +0200 (EET) Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2ca208940b3so67115651fa.1 for ; Mon, 11 Dec 2023 23:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702366369; x=1702971169; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EO+mleLRg0ZanvEtH0RaIM6nWTMxmSRawrAwrWYmU8k=; b=ibQXRm17/CbabFYMORZo+jqnF0F/RKSc2A7qLpKKVg3EwQTn0+WaZrZmgcoul+Jh3B xRPnXeul5YKifzG+b1vyPElKoiwEx9rO0II59W5sU9B5IL3IMkGF/B5rkynFGLZkhgWH /EettXjPgTVj10Kz1/zhLTX3fYVmpME7mrpqoudm8uMXRDtNCaEPsdQDbKXxEHvIPM6V oGeFn+emC/yZDCzbFlGQWcPaqoe9OlC5OaZkO2k79eUoiYUDzQf6j46mYlEvqpsaLhDx rFfM0yaLx+6Fec7Dw1j+nWzvt3T6HfVgwpOm40v5Tb7XrIaiGihDfDFFl6kToiJPYRX6 zpAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702366369; x=1702971169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EO+mleLRg0ZanvEtH0RaIM6nWTMxmSRawrAwrWYmU8k=; b=PNLT3hvz7C1LcyK6sGskMmXzuGpNFNeCWgUcfGjXEmwYCOX9QBCNGCFhaABQb1oaeU yhuDzpEDFaPysAyNvtfVLCG8CBo8PUIURbqmvjcgVoLMPkYPZr2jsGSBFTLfDvFzaC50 MpYJx84RCXyOs0hhpdlI/K6+KOT4cRdTujAMZvvjBi3prj0v7exvcVX+WcGVnozDBE+I TFTwr8g3W38y4eNB3CQGRR65AFFXMeDEezl2UvvSHqBIEz5HFYlzXl/hoeUy5QSRT39A hRV/5cDg9D69HAOAw8VBho1t9m9UDWiBwegHYtpNnzmneK6Z1q5Ia6UWyWPYW/dgIvdn Rmyw== X-Gm-Message-State: AOJu0YzG4ZtsBF3lxnL001BnQ5SfE8Lz1NNPMwkEEO+whG/4w6OFsXOu zeJ9/gcE2+b+TsDQijEsUAoleo4/yqg= X-Received: by 2002:a2e:a4aa:0:b0:2cc:2640:b740 with SMTP id g10-20020a2ea4aa000000b002cc2640b740mr814310ljm.101.1702366369169; Mon, 11 Dec 2023 23:32:49 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id a18-20020a2e9812000000b002c9f3ba5c22sm1458045ljj.118.2023.12.11.23.32.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:32:48 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Dec 2023 09:32:26 +0200 Message-ID: <20231212073242.10967-3-jeebjp@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231212073242.10967-1-jeebjp@gmail.com> References: <20231212073242.10967-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 2/3] avcodec/avpacket: add functionality to prepend to AVPacketLists 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: gIFT6NhU4si9 From: Jan Ekström Signed-off-by: Jan Ekström --- libavcodec/avpacket.c | 20 +++++++++++++++----- libavcodec/packet_internal.h | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index e29725c2d2..e223ab63ef 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -540,6 +540,7 @@ int avpriv_packet_list_put(PacketList *packet_buffer, int flags) { PacketListEntry *pktl = av_malloc(sizeof(*pktl)); + unsigned int update_end_point = 1; int ret; if (!pktl) @@ -563,13 +564,22 @@ int avpriv_packet_list_put(PacketList *packet_buffer, pktl->next = NULL; - if (packet_buffer->head) - packet_buffer->tail->next = pktl; - else + if (packet_buffer->head) { + if (flags & FF_PACKETLIST_FLAG_PREPEND) { + pktl->next = packet_buffer->head; + packet_buffer->head = pktl; + update_end_point = 0; + } else { + packet_buffer->tail->next = pktl; + } + } else packet_buffer->head = pktl; - /* Add the packet in the buffered packet list. */ - packet_buffer->tail = pktl; + if (update_end_point) { + /* Add the packet in the buffered packet list. */ + packet_buffer->tail = pktl; + } + return 0; } diff --git a/libavcodec/packet_internal.h b/libavcodec/packet_internal.h index 52fa6d9be9..9c0f4fead5 100644 --- a/libavcodec/packet_internal.h +++ b/libavcodec/packet_internal.h @@ -34,6 +34,8 @@ typedef struct PacketList { PacketListEntry *head, *tail; } PacketList; +#define FF_PACKETLIST_FLAG_PREPEND (1 << 0) /**< Prepend created AVPacketList instead of appending */ + /** * Append an AVPacket to the list. * From patchwork Tue Dec 12 07:32:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 45087 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3428954pzf; Mon, 11 Dec 2023 23:33:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqFrIMwoLVg+BChBaZykjpyK7Lz2mggHxLTHiVF746IFyEa4f4EuHq4qOo50Ular71nxXP X-Received: by 2002:a17:906:2209:b0:a19:a19a:ea96 with SMTP id s9-20020a170906220900b00a19a19aea96mr2615255ejs.79.1702366407718; Mon, 11 Dec 2023 23:33:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702366407; cv=none; d=google.com; s=arc-20160816; b=fyQKZkfvZhWETwXSMKBPzu9Fjn6tIzl5sfcm+XOHVRWdNyoHlqvlcYStNOJSiiKEMS KjK+UBPWrXY4pkUYRS1AD6X44IlsUs+oOL7qXvjmsJ7hLGP2mxed7+hg+V7lhn1Ecbvx PNuqBaGDs1x8tlLSVby8x1wnXJWajw3Ta1ZYjTIwN1Su7+9MlzRy71+Tdqh8BIyTNm8k ILkH89JP9NMozFD5S5w2vkDvlcPkvXz8NOCzF1EU9tOThRsRHTR0fxXUMWLxRRUav8yN oidFjpdmNfVlaMxhq06nC6bzdhm4T1GUn+yKtV/w+zk5U6PW9epq4sHykj92f4OordBC vGGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=CWz4oZRdvE9fZRVzS/4Zz+sUmLlWkkOXTjuxrRBHPAk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=gKRtDUoi8JVHHLyDeWb2sadhDjMX0RAbHH+/ThiDgOdKZf+rPz4jCKdvK4TCy4xdaL m8LhrwOto0w7fZRgYJ9xnpuBfa0WThlYCgVzCrUQGIX6nw+H0I6wEwHGsVEB5q1EeNEU yMUb4lh8A5uo+rUttr6ipucPQGtdBSqeo3hs1Jx5/QI7yoOLHgcu8K/O1kGO0CAlCfMc LT9fPBGv5EwYRMlForaZ+xDb6yLll08/8W2nSQ4hN0XWD2f+aE4SYfNDMFtaZi9xZm/k WVvsyWMjgUOP1Y9v01QPmfSBHzryzMoTfg7N6AjObsFCqt5H+0jf2Y4IfK2lgfIOFLXu 3iPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=VRUsJMYA; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bw8-20020a170906c1c800b00a1df3a98421si4131393ejb.42.2023.12.11.23.33.27; Mon, 11 Dec 2023 23:33:27 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=VRUsJMYA; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0FB7868D1D2; Tue, 12 Dec 2023 09:33:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D1F0468D193 for ; Tue, 12 Dec 2023 09:32:50 +0200 (EET) Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2c9fbb846b7so61495071fa.2 for ; Mon, 11 Dec 2023 23:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702366370; x=1702971170; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=M4afAjFbNNKrTOfECMOAkOGg4TxiXs6eHjQCPskl5wc=; b=VRUsJMYAuhXjM27o5s4Q8QAiENo8MiSGFk7rwPuGrn1TJJCS8TMCOC5xubmudGMUx4 vHjgHoOVxW9qLgraOl49AbU8VQXKqRYC6Fq+MC3nPGG2ImuCiOMeN7Ea79M+kVigOXwo rgDdkOtWP0aZocvSkZi0com8WZ4f1T+pJlHD0L/paEkBF2gv9e4BunxZ0BVm8nPzlpqA 36Nf/51oVmD0uQWI5B5KocduxK6C/lo8uKkviKXEyKi8VrwmOKvF/Kc0xSOZlqPX992t AZKxZ8y7Lu740RAVaK5SO30Z23muArBe6lMXw66SB0sqZ9cR6sm3tPVTPbxRWon4AovC IGHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702366370; x=1702971170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M4afAjFbNNKrTOfECMOAkOGg4TxiXs6eHjQCPskl5wc=; b=M2gJh+c1sVMsmmHIk526rPLWze2z3yCcnwYJPx7gvX6tHbtVN20er7Oj7YiWVCDMKy 8K1kR7MOjAFtOxWYki/RqYVrA13vDzwR0Y20qHjKfW2btB4ZBUwDSzwD3Sr43+BT1VZL 9lo7wHedlT1FYeAqqac+ybS1kOIcTbrNCukx6KjMDUMHsBlcVXGfZZjPVdivYXLzk0Pn ifw+bXW2JYKx7ZzVCeqcfP0Jl2u7hMm3zbXxHdBZLk4I5OsRL3FdzNw2AwoUUVLptG6e OcxkU3lm5n0QXdDfITAHeor4fp80/oUOw+OL/8TLkM6Pju5joRQMVHFGYVZ1avWV5LuB aUsw== X-Gm-Message-State: AOJu0Yw3m4oh1xljB1UwniUV3oHQXEEaED/1b1p9BLVCy5jAnJf4OoZG iEzEDrri9PdtORqGk9Harmo4y2buN2U= X-Received: by 2002:a05:651c:1247:b0:2cb:2a2c:55b5 with SMTP id h7-20020a05651c124700b002cb2a2c55b5mr1699311ljh.10.1702366369727; Mon, 11 Dec 2023 23:32:49 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id a18-20020a2e9812000000b002c9f3ba5c22sm1458045ljj.118.2023.12.11.23.32.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:32:49 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Dec 2023 09:32:27 +0200 Message-ID: <20231212073242.10967-4-jeebjp@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231212073242.10967-1-jeebjp@gmail.com> References: <20231212073242.10967-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/3] avformat/movenc: add support for fragmented TTML muxing 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: QF/Tmqxr50zj From: Jan Ekström Attempts to base the fragmentation timing on other streams as most receivers expect media fragments to be more or less aligned. Currently does not support fragmentation on subtitle track only, as the subtitle packet queue timings would have to be checked in addition to the current fragmentation timing logic. Signed-off-by: Jan Ekström --- libavformat/movenc.c | 9 - libavformat/movenc_ttml.c | 157 ++++++- tests/fate/mov.mak | 21 + tests/ref/fate/mov-mp4-fragmented-ttml-dfxp | 430 ++++++++++++++++++++ tests/ref/fate/mov-mp4-fragmented-ttml-stpp | 430 ++++++++++++++++++++ 5 files changed, 1034 insertions(+), 13 deletions(-) create mode 100644 tests/ref/fate/mov-mp4-fragmented-ttml-dfxp create mode 100644 tests/ref/fate/mov-mp4-fragmented-ttml-stpp diff --git a/libavformat/movenc.c b/libavformat/movenc.c index e39f1ac987..0b0006fd93 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -7324,15 +7324,6 @@ static int mov_init(AVFormatContext *s) track->squash_fragment_samples_to_one = ff_is_ttml_stream_paragraph_based(track->par); - if (mov->flags & FF_MOV_FLAG_FRAGMENT && - track->squash_fragment_samples_to_one) { - av_log(s, AV_LOG_ERROR, - "Fragmentation is not currently supported for " - "TTML in MP4/ISMV (track synchronization between " - "subtitles and other media is not yet implemented)!\n"); - return AVERROR_PATCHWELCOME; - } - if (track->mode != MODE_ISM && track->par->codec_tag == MOV_ISMV_TTML_TAG && s->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { diff --git a/libavformat/movenc_ttml.c b/libavformat/movenc_ttml.c index 6deae49657..2aefb0b6c3 100644 --- a/libavformat/movenc_ttml.c +++ b/libavformat/movenc_ttml.c @@ -54,6 +54,50 @@ static int mov_init_ttml_writer(MOVTrack *track, AVFormatContext **out_ctx) return 0; } +static void mov_calculate_start_and_end_of_other_tracks( + AVFormatContext *s, MOVTrack *track, int64_t *start_pts, int64_t *end_pts) +{ + MOVMuxContext *mov = s->priv_data; + + // Initialize at the end of the previous document/fragment, which is NOPTS + // until the first fragment is created. + int64_t max_track_end_dts = *start_pts = track->end_pts; + + for (unsigned int i = 0; i < s->nb_streams; i++) { + MOVTrack *other_track = &mov->tracks[i]; + + // Skip our own track, any other track that needs squashing, + // or any track which still has its start_dts at NOPTS or + // any track that did not yet get any packets. + if (track == other_track || + other_track->squash_fragment_samples_to_one || + other_track->start_dts == AV_NOPTS_VALUE || + !other_track->entry) { + continue; + } + + { + int64_t picked_start = av_rescale_q_rnd(other_track->cluster[0].dts + other_track->cluster[0].cts, + other_track->st->time_base, + track->st->time_base, + AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); + int64_t picked_end = av_rescale_q_rnd(other_track->end_pts, + other_track->st->time_base, + track->st->time_base, + AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); + + if (*start_pts == AV_NOPTS_VALUE) + *start_pts = picked_start; + else if (picked_start >= track->end_pts) + *start_pts = FFMIN(*start_pts, picked_start); + + max_track_end_dts = FFMAX(max_track_end_dts, picked_end); + } + } + + *end_pts = max_track_end_dts; +} + static int mov_write_ttml_document_from_queue(AVFormatContext *s, AVFormatContext *ttml_ctx, MOVTrack *track, @@ -65,13 +109,85 @@ static int mov_write_ttml_document_from_queue(AVFormatContext *s, int64_t start_ts = track->start_dts == AV_NOPTS_VALUE ? 0 : (track->start_dts + track->track_duration); int64_t end_ts = start_ts; + unsigned int time_limited = 0; + PacketList back_to_queue_list = { 0 }; + + if (*out_start_ts != AV_NOPTS_VALUE) { + // we have non-nopts values here, thus we have been given a time range + time_limited = 1; + start_ts = *out_start_ts; + end_ts = *out_start_ts + *out_duration; + } if ((ret = avformat_write_header(ttml_ctx, NULL)) < 0) { return ret; } while (!avpriv_packet_list_get(&track->squashed_packet_queue, pkt)) { - end_ts = FFMAX(end_ts, pkt->pts + pkt->duration); + int64_t pts_before = pkt->pts; + int64_t duration_before = pkt->duration; + + if (time_limited) { + // special cases first: + if (pkt->pts + pkt->duration < start_ts) { + // too late for our fragment, unfortunately + // unref and proceed to next packet in queue. + av_log(s, AV_LOG_WARNING, + "Very late TTML packet in queue, dropping packet with " + "pts: %"PRId64", duration: %"PRId64"\n", + pkt->pts, pkt->duration); + av_packet_unref(pkt); + continue; + } else if (pkt->pts >= end_ts) { + // starts after this fragment, put back to original queue + ret = avpriv_packet_list_put(&track->squashed_packet_queue, + pkt, av_packet_ref, + FF_PACKETLIST_FLAG_PREPEND); + if (ret < 0) + goto cleanup; + + break; + } + + // limit packet pts to start_ts + if (pkt->pts < start_ts) { + pkt->duration -= start_ts - pkt->pts; + pkt->pts = start_ts; + } + + if (pkt->pts + pkt->duration > end_ts) { + // goes over our current fragment, create duplicate and + // put it back to list after iteration has finished in + // order to handle multiple subtitles at the same time. + int64_t offset = end_ts - pkt->pts; + + ret = avpriv_packet_list_put(&back_to_queue_list, + pkt, av_packet_ref, + FF_PACKETLIST_FLAG_PREPEND); + if (ret < 0) + goto cleanup; + + back_to_queue_list.head->pkt.pts = + back_to_queue_list.head->pkt.dts = + back_to_queue_list.head->pkt.pts + offset; + back_to_queue_list.head->pkt.duration -= offset; + + // and for our normal packet we just set duration to offset + pkt->duration = offset; + } + } else { + end_ts = FFMAX(end_ts, pkt->pts + pkt->duration); + } + + av_log(s, AV_LOG_TRACE, + "TTML packet writeout: pts: %"PRId64" (%"PRId64"), " + "duration: %"PRId64"\n", + pkt->pts, pkt->pts - start_ts, pkt->duration); + if (pkt->pts != pts_before || pkt->duration != duration_before) { + av_log(s, AV_LOG_TRACE, + "Adjustments: pts: %"PRId64", duration: %"PRId64"\n", + pkt->pts - pts_before, pkt->duration - duration_before); + } // in case of the 'dfxp' muxing mode, each written document is offset // to its containing sample's beginning. @@ -100,15 +216,30 @@ static int mov_write_ttml_document_from_queue(AVFormatContext *s, ret = 0; cleanup: + while (!avpriv_packet_list_get(&back_to_queue_list, pkt)) { + ret = avpriv_packet_list_put(&track->squashed_packet_queue, + pkt, av_packet_ref, + FF_PACKETLIST_FLAG_PREPEND); + + // unrelated to whether we succeed or not, we unref the packet + // received from the temporary list. + av_packet_unref(pkt); + + if (ret < 0) { + avpriv_packet_list_free(&back_to_queue_list); + break; + } + } return ret; } int ff_mov_generate_squashed_ttml_packet(AVFormatContext *s, MOVTrack *track, AVPacket *pkt) { + MOVMuxContext *mov = s->priv_data; AVFormatContext *ttml_ctx = NULL; // values for the generated AVPacket - int64_t start_ts = 0; + int64_t start_ts = AV_NOPTS_VALUE; int64_t duration = 0; int ret = AVERROR_BUG; @@ -119,12 +250,30 @@ int ff_mov_generate_squashed_ttml_packet(AVFormatContext *s, goto cleanup; } + if (mov->flags & FF_MOV_FLAG_FRAGMENT) { + int64_t calculated_start = AV_NOPTS_VALUE; + int64_t calculated_end = AV_NOPTS_VALUE; + + mov_calculate_start_and_end_of_other_tracks(s, track, &calculated_start, &calculated_end); + + if (calculated_start != AV_NOPTS_VALUE) { + start_ts = calculated_start; + duration = calculated_end - calculated_start; + av_log(s, AV_LOG_VERBOSE, + "Calculated subtitle fragment start: %"PRId64", " + "duration: %"PRId64"\n", + start_ts, duration); + } + } + if (!track->squashed_packet_queue.head) { // empty queue, write minimal empty document with zero duration avio_write(ttml_ctx->pb, empty_ttml_document, sizeof(empty_ttml_document) - 1); - start_ts = 0; - duration = 0; + if (start_ts == AV_NOPTS_VALUE) { + start_ts = 0; + duration = 0; + } goto generate_packet; } diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index c8e85fd54b..9b3a85cb18 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -143,6 +143,27 @@ FATE_MOV_FFMPEG_FFPROBE-$(call TRANSCODE, TTML SUBRIP, MP4 MOV, SRT_DEMUXER TTML fate-mov-mp4-ttml-stpp: CMD = transcode srt $(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt mp4 "-map 0:s -c:s ttml -time_base:s 1:1000" "-map 0 -c copy" "-of json -show_entries packet:stream=index,codec_type,codec_tag_string,codec_tag,codec_name,time_base,start_time,duration_ts,duration,nb_frames,nb_read_packets:stream_tags" fate-mov-mp4-ttml-dfxp: CMD = transcode srt $(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt mp4 "-map 0:s -c:s ttml -time_base:s 1:1000 -tag:s dfxp -strict unofficial" "-map 0 -c copy" "-of json -show_entries packet:stream=index,codec_type,codec_tag_string,codec_tag,codec_name,time_base,start_time,duration_ts,duration,nb_frames,nb_read_packets:stream_tags" +FATE_MOV_FFMPEG_FFPROBE-$(call TRANSCODE, TTML SUBRIP, MP4 MOV, LAVFI_INDEV SMPTEHDBARS_FILTER SRT_DEMUXER MPEG2VIDEO_ENCODER TTML_MUXER RAWVIDEO_MUXER) += fate-mov-mp4-fragmented-ttml-stpp +fate-mov-mp4-fragmented-ttml-stpp: CMD = transcode srt $(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt mp4 \ + "-map 1:v -map 0:s \ + -c:v mpeg2video -b:v 2M -g 48 -sc_threshold 1000000000 \ + -c:s ttml -time_base:s 1:1000 \ + -movflags +cmaf" \ + "-map 0:s -c copy" \ + "-select_streams s -of csv -show_packets -show_data_hash crc32" \ + "-f lavfi -i smptehdbars=duration=24.5245:size=320x180:rate=24000/1001,format=yuv420p" \ + "" "" "data" + +FATE_MOV_FFMPEG_FFPROBE-$(call TRANSCODE, TTML SUBRIP, ISMV MOV, LAVFI_INDEV SMPTEHDBARS_FILTER SRT_DEMUXER MPEG2VIDEO_ENCODER TTML_MUXER RAWVIDEO_MUXER) += fate-mov-mp4-fragmented-ttml-dfxp +fate-mov-mp4-fragmented-ttml-dfxp: CMD = transcode srt $(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt ismv \ + "-map 1:v -map 0:s \ + -c:v mpeg2video -b:v 2M -g 48 -sc_threshold 1000000000 \ + -c:s ttml -tag:s dfxp -time_base:s 1:1000" \ + "-map 0:s -c copy" \ + "-select_streams s -of csv -show_packets -show_data_hash crc32" \ + "-f lavfi -i smptehdbars=duration=24.5245:size=320x180:rate=24000/1001,format=yuv420p" \ + "" "" "data" + # FIXME: Uncomment these two tests once the test files are uploaded to the fate # server. # avif demuxing - still image with 1 item. diff --git a/tests/ref/fate/mov-mp4-fragmented-ttml-dfxp b/tests/ref/fate/mov-mp4-fragmented-ttml-dfxp new file mode 100644 index 0000000000..8dbb1d4d7b --- /dev/null +++ b/tests/ref/fate/mov-mp4-fragmented-ttml-dfxp @@ -0,0 +1,430 @@ +a66a4ee35d00af1304847d4897aa2615 *tests/data/fate/mov-mp4-fragmented-ttml-dfxp.ismv +189404 tests/data/fate/mov-mp4-fragmented-ttml-dfxp.ismv + + + + + + + + +
+

Don't show this text it may be used to insert hidden data

+

SubRip subtitles capability tester 1.3o by ale5000
Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others
This text should be blue
This text should be red
This text should be black
If you see this with the normal font, the player don't (fully) support font face

+
+ +
+ + + + + + + + +
+

SubRip subtitles capability tester 1.3o by ale5000
Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others
This text should be blue
This text should be red
This text should be black
If you see this with the normal font, the player don't (fully) support font face

+
+ +
+ + + + + + + + +
+

SubRip subtitles capability tester 1.3o by ale5000
Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others
This text should be blue
This text should be red
This text should be black
If you see this with the normal font, the player don't (fully) support font face

+

Hidden

+

This text should be small
This text should be normal
This text should be big

+
+ +
+ + + + + + + + +
+

This text should be small
This text should be normal
This text should be big

+

This should be an E with an accent: È
日本語
This text should be bold, italics and underline
This text should be small and green
This text should be small and red
This text should be big and brown

+
+ +
+ + + + + + + + +
+

This should be an E with an accent: È
日本語
This text should be bold, italics and underline
This text should be small and green
This text should be small and red
This text should be big and brown

+
+ +
+ + + + + + + + +
+

This should be an E with an accent: È
日本語
This text should be bold, italics and underline
This text should be small and green
This text should be small and red
This text should be big and brown

+

This line should be bold
This line should be italics
This line should be underline
This line should be strikethrough
Both lines
should be underline

+
+ +
+ + + + + + + + +
+

This line should be bold
This line should be italics
This line should be underline
This line should be strikethrough
Both lines
should be underline

+
+ +
+ + + + + + + + +
+

This line should be bold
This line should be italics
This line should be underline
This line should be strikethrough
Both lines
should be underline

+

>
It would be a good thing to
hide invalid html tags that are closed and show the text in them
but show un-closed invalid html tags
Show not opened tags
<

+
+ +
+ + + + + + + + +
+

>
It would be a good thing to
hide invalid html tags that are closed and show the text in them
but show un-closed invalid html tags
Show not opened tags
<

+

and also
hide invalid html tags with parameters that are closed and show the text in them
but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined

+
+ +
+ + + + + + + + +
+

and also
hide invalid html tags with parameters that are closed and show the text in them
but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined

+
+ +
+ + + + + + + + +
+

and also
hide invalid html tags with parameters that are closed and show the text in them
but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined

+

This text should be in the normal position...

+

This text should NOT be in the normal position

+
+ +
+ + + + + + + + +
+

This text should NOT be in the normal position

+

Implementation is the same of the ASS tag
This text should be at the
top and horizontally centered

+

This text should be at the
middle and horizontally centered

+

This text should be at the
bottom and horizontally centered

+
+ +
+ + + + + + + + +
+

Implementation is the same of the ASS tag
This text should be at the
top and horizontally centered

+

This text should be at the
middle and horizontally centered

+

This text should be at the
bottom and horizontally centered

+

This text should be at the
top and horizontally at the left

+

This text should be at the
middle and horizontally at the left
(The second position must be ignored)

+

This text should be at the
bottom and horizontally at the left

+
+ +
+packet,subtitle,1,0,0.000000,0,0.000000,N/A,N/A,1172,14746,K__,CRC32:bde7afa1 +packet,subtitle,1,20020000,2.002000,20020000,2.002000,N/A,N/A,1015,29540,K__,CRC32:c1cb78f2 +packet,subtitle,1,40040000,4.004000,40040000,4.004000,N/A,N/A,1305,44177,K__,CRC32:267b17fe +packet,subtitle,1,60060000,6.006000,60060000,6.006000,N/A,N/A,1111,59104,K__,CRC32:d6aaf284 +packet,subtitle,1,80080000,8.008000,80080000,8.008000,N/A,N/A,927,73837,K__,CRC32:0ee24ad7 +packet,subtitle,1,100100000,10.010000,100100000,10.010000,N/A,N/A,1194,88386,K__,CRC32:a9816515 +packet,subtitle,1,120120000,12.012000,120120000,12.012000,N/A,N/A,874,103202,K__,CRC32:c47ebb4e +packet,subtitle,1,140140000,14.014000,140140000,14.014000,N/A,N/A,1154,117698,K__,CRC32:09b26179 +packet,subtitle,1,160160000,16.016000,160160000,16.016000,N/A,N/A,1240,132474,K__,CRC32:d7e3067e +packet,subtitle,1,180180000,18.018000,180180000,18.018000,N/A,N/A,960,147336,K__,CRC32:d2d99797 +packet,subtitle,1,200200000,20.020000,200200000,20.020000,N/A,N/A,1251,161918,K__,CRC32:1857892c +packet,subtitle,1,220220000,22.022000,220220000,22.022000,N/A,N/A,1285,176791,K__,CRC32:76bd9787 +packet,subtitle,1,240240000,24.024000,240240000,24.024000,N/A,N/A,1676,187162,K__,CRC32:b519ec6f diff --git a/tests/ref/fate/mov-mp4-fragmented-ttml-stpp b/tests/ref/fate/mov-mp4-fragmented-ttml-stpp new file mode 100644 index 0000000000..1ff0cf0474 --- /dev/null +++ b/tests/ref/fate/mov-mp4-fragmented-ttml-stpp @@ -0,0 +1,430 @@ +0b04302a9d3712fda440aa19df59a561 *tests/data/fate/mov-mp4-fragmented-ttml-stpp.mp4 +183872 tests/data/fate/mov-mp4-fragmented-ttml-stpp.mp4 + + + + + + + + +
+

Don't show this text it may be used to insert hidden data

+

SubRip subtitles capability tester 1.3o by ale5000
Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others
This text should be blue
This text should be red
This text should be black
If you see this with the normal font, the player don't (fully) support font face

+
+ +
+ + + + + + + + +
+

SubRip subtitles capability tester 1.3o by ale5000
Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others
This text should be blue
This text should be red
This text should be black
If you see this with the normal font, the player don't (fully) support font face

+
+ +
+ + + + + + + + +
+

SubRip subtitles capability tester 1.3o by ale5000
Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others
This text should be blue
This text should be red
This text should be black
If you see this with the normal font, the player don't (fully) support font face

+

Hidden

+

This text should be small
This text should be normal
This text should be big

+
+ +
+ + + + + + + + +
+

This text should be small
This text should be normal
This text should be big

+

This should be an E with an accent: È
日本語
This text should be bold, italics and underline
This text should be small and green
This text should be small and red
This text should be big and brown

+
+ +
+ + + + + + + + +
+

This should be an E with an accent: È
日本語
This text should be bold, italics and underline
This text should be small and green
This text should be small and red
This text should be big and brown

+
+ +
+ + + + + + + + +
+

This should be an E with an accent: È
日本語
This text should be bold, italics and underline
This text should be small and green
This text should be small and red
This text should be big and brown

+

This line should be bold
This line should be italics
This line should be underline
This line should be strikethrough
Both lines
should be underline

+
+ +
+ + + + + + + + +
+

This line should be bold
This line should be italics
This line should be underline
This line should be strikethrough
Both lines
should be underline

+
+ +
+ + + + + + + + +
+

This line should be bold
This line should be italics
This line should be underline
This line should be strikethrough
Both lines
should be underline

+

>
It would be a good thing to
hide invalid html tags that are closed and show the text in them
but show un-closed invalid html tags
Show not opened tags
<

+
+ +
+ + + + + + + + +
+

>
It would be a good thing to
hide invalid html tags that are closed and show the text in them
but show un-closed invalid html tags
Show not opened tags
<

+

and also
hide invalid html tags with parameters that are closed and show the text in them
but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined

+
+ +
+ + + + + + + + +
+

and also
hide invalid html tags with parameters that are closed and show the text in them
but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined

+
+ +
+ + + + + + + + +
+

and also
hide invalid html tags with parameters that are closed and show the text in them
but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined

+

This text should be in the normal position...

+

This text should NOT be in the normal position

+
+ +
+ + + + + + + + +
+

This text should NOT be in the normal position

+

Implementation is the same of the ASS tag
This text should be at the
top and horizontally centered

+

This text should be at the
middle and horizontally centered

+

This text should be at the
bottom and horizontally centered

+
+ +
+ + + + + + + + +
+

Implementation is the same of the ASS tag
This text should be at the
top and horizontally centered

+

This text should be at the
middle and horizontally centered

+

This text should be at the
bottom and horizontally centered

+

This text should be at the
top and horizontally at the left

+

This text should be at the
middle and horizontally at the left
(The second position must be ignored)

+

This text should be at the
bottom and horizontally at the left

+
+ +
+packet,subtitle,1,0,0.000000,0,0.000000,N/A,N/A,1172,14302,K__,CRC32:bde7afa1 +packet,subtitle,1,2002,2.002000,2002,2.002000,N/A,N/A,1015,28648,K__,CRC32:bd3bd4bc +packet,subtitle,1,4004,4.004000,4004,4.004000,N/A,N/A,1305,42837,K__,CRC32:c8ff5017 +packet,subtitle,1,6006,6.006000,6006,6.006000,N/A,N/A,1111,57316,K__,CRC32:f0b10da6 +packet,subtitle,1,8008,8.008000,8008,8.008000,N/A,N/A,927,71601,K__,CRC32:55a7bb1b +packet,subtitle,1,10010,10.010000,10010,10.010000,N/A,N/A,1194,85702,K__,CRC32:03dc4753 +packet,subtitle,1,12012,12.012000,12012,12.012000,N/A,N/A,874,100070,K__,CRC32:c7a092d4 +packet,subtitle,1,14014,14.014000,14014,14.014000,N/A,N/A,1154,114118,K__,CRC32:b476fe9c +packet,subtitle,1,16016,16.016000,16016,16.016000,N/A,N/A,1240,128446,K__,CRC32:912e694c +packet,subtitle,1,18018,18.018000,18018,18.018000,N/A,N/A,960,142860,K__,CRC32:bba73912 +packet,subtitle,1,20020,20.020000,20020,20.020000,N/A,N/A,1251,156994,K__,CRC32:4c7b87d8 +packet,subtitle,1,22022,22.022000,22022,22.022000,N/A,N/A,1285,171419,K__,CRC32:c0368927 +packet,subtitle,1,24024,24.024000,24024,24.024000,N/A,N/A,1676,181630,K__,CRC32:812a103f