From patchwork Thu Oct 24 12:26:49 2024 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: 35205 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:1c41:b0:48e:c0f8:d0de with SMTP id im1csp651019vqb; Thu, 24 Oct 2024 13:44:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXW8KnMiZae5tEx03US1EDI2dr/xAqMb1yEjQZte08mw8y5kv9+lK49nkg39Ezc+0WiTsLjujQk5uax6QZ7xyDz@gmail.com X-Google-Smtp-Source: AGHT+IHzwGO7WuGD/theU5Pc53Xx3NhssxU1MwCv/bEZCWtD2fdYGAMocznkU7gN5+lHc+9d0x4g X-Received: by 2002:a05:6512:3ca7:b0:538:9e36:7b6a with SMTP id 2adb3069b0e04-53b1a34d04emr7324665e87.32.1729802645395; Thu, 24 Oct 2024 13:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729802645; cv=none; d=google.com; s=arc-20240605; b=WyNf9mblfHfXkxfi8ea2lzP2alyTjoyr+y9K1DGMf7ZvJ7kki6DZRBNktWBcfvHNRh Zbrn9k6q2NUoBsYMK2AFfLajGNHEkIrhqkEzNDSi7UUwoMIjmXzY4BJ+RN1qYW9WJsz0 QYFzPMehBQ53aSKw3e37bisoM+HUvJIXfhvZB/QXNTeLs+dc/JA2GkGg8JZZjww6nmwD Twu5DRzVNKOYhqta+jHNlZjKkfOONvkfhV83v+hiz1FAGa3UofJEFqZG/z7XBLnjEWGH hU2lwIyVndER+xwBR6qllpP7wEFv86murrNsmw3gDVN+81ySlXFGeOMpn9zsFUzf/KUy KyIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:message-id:date:to:from :dkim-signature:delivered-to; bh=BQKTM7XjQbunA8Po2cAcTucmFxQ5W+xWLOhsVBleK90=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=kTEHhZWccUkAG2Yh9gb1DD8wfmshPEUjmCv+KAqObzTJGMJXGFrWF0/3oOcaC5kCie X6tQaCFq0ST+neyN1jqqHNcp+QfJbj9TzcPmfA8NLnKCd+q1CsuDRGni27JBH+w8hPsw iZFJ5yhizgLdCMtonP9sTs31zoIuNFERaCAQI+Sk3MfeKJ2H+7Lichb2kJlC9VyW3LsW jcF71y6F83tVGpp3QcgBAPRzFka0QUH0x/oe3yMHM+cgeSfz+45roYYAvncV7IOJe+vs DqgSDe/1AjWhycwE5WKszml41uqqc2pX9EtpJ83oWsmIf59YY/zwv3bfRsEMGPVk0XEL 6bSg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=GQ9xsn1P; 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; dara=fail header.i=@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 2adb3069b0e04-53a2245a10bsi3481503e87.596.2024.10.24.13.44.04; Thu, 24 Oct 2024 13:44:05 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=GQ9xsn1P; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 861AF68DB4B; Thu, 24 Oct 2024 15:27:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7187B68D549 for ; Thu, 24 Oct 2024 15:27:06 +0300 (EEST) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2fb51e00c05so12327231fa.0 for ; Thu, 24 Oct 2024 05:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729772825; x=1730377625; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ccc2Wm2PwKdNfMoM6ssUliFBhYJuvneISBSUG/ssGUA=; b=GQ9xsn1PqAH+h5spn1QjsI7xsL7xPBi0FcIOMCIPf8gC5PVf0EPzVX9VRyjejAqT8r tbkxBAj4bimcD81rS3UlJIls+XHK/QAuEdR6gh9L0T3wBlIR7lNzGDNh5/8f6BU+3ct4 EIJBjEmmrEovtcoZzHqgmeMGdtuup+DyKjPclZQz3BXTXeKVq/OZBh4zXWUagp87hpdK McafJORAIuQ03woffhjkQ0IV59bg8uJvtcsLHWZSBSwRbS6yDylw2W859iouBMaB0po/ bgMW8q7OcirownJdIQiBqIS0F6FYALbeu1BP+Ld5op1n8K/WXJc8WkYEHWXx78+ZKWIY N+PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729772825; x=1730377625; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ccc2Wm2PwKdNfMoM6ssUliFBhYJuvneISBSUG/ssGUA=; b=PN+f9b3IsJxosKZk82rNFMt7luiuMKA/NBzuuQNF81sxd5lq0kIprLyiLoDOxcFfWh NnM1I7s2MDt+9Am0N+8c9F00X7VWuzE5M1z6jpyGcDqKb4/DX6fsaf4cCpTXjF2aRIdF 9TDXTclKfwwl9ZhALrm6yJIBRKQlgVxOO+SapHR0cPaOgPNmitW3wpAzE6IExW5S4+2A uHQt+zEOJwORENCmtiZPaiIj1DI8T8DNzpvOb/0jU8zy8bZKEj29EVWfVUcm7E8UhSey fmjF8ANn3ThvBZUQGZ5ZezVViQ7vuREzUiNODsljrDkwOQvlRJtyX/eqoP34/Mb+2uYu GISw== X-Gm-Message-State: AOJu0YzT7eKgKzFyIbnaBqHyXegOhpKiOCC4X9w4oIWUiNt2eM+5bb02 TQoq/ODgP8lrB3xj/1ilfSkC7thYYOsCR3Ha43nPGLi0mpvw9CqAaShKfg== X-Received: by 2002:a2e:a554:0:b0:2fa:de13:5c34 with SMTP id 38308e7fff4ca-2fc9d337faamr57583831fa.19.1729772825143; Thu, 24 Oct 2024 05:27:05 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2fb9ad76206sm13817991fa.52.2024.10.24.05.27.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 05:27:04 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Oct 2024 15:26:49 +0300 Message-ID: <20241024122659.676104-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 0/3] Initial 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: /uZgClKy9+iD Changes compared to v3: * General rebase. This enables pushing TTML together with another track (usually video) as part of CMAF Ingest, as defined by the DASH-IF Live Media Ingest Protocol. Currently does not function well with just the subtitle track unless the API user explicitly requests fragmentation with a nullptr packet, as the generic fragmentation decision logic is based on tracks which do not require squashing. Currently does support overlapping subtitles, but the implementation utilizes another packet queue for it, which is probably not optimal. Recommendations on how to improve things are welcome. Jan Jan Ekström (3): tests/fate-run: add support for specifying the final encode muxer in `transcode` avcodec/avpacket: add functionality to prepend to AVPacketLists avformat/movenc: add support for fragmented TTML muxing libavcodec/packet.c | 20 +- libavcodec/packet_internal.h | 2 + libavformat/movenc.c | 9 - libavformat/movenc_ttml.c | 157 ++++++- tests/fate-run.sh | 4 +- tests/fate/mov.mak | 21 + tests/ref/fate/mov-mp4-fragmented-ttml-dfxp | 430 ++++++++++++++++++++ tests/ref/fate/mov-mp4-fragmented-ttml-stpp | 430 ++++++++++++++++++++ 8 files changed, 1054 insertions(+), 19 deletions(-) create mode 100644 tests/ref/fate/mov-mp4-fragmented-ttml-dfxp create mode 100644 tests/ref/fate/mov-mp4-fragmented-ttml-stpp