From patchwork Tue Mar 30 08:23:42 2021 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: 26651 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 2A59044B212 for ; Tue, 30 Mar 2021 11:47:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1B93688128; Tue, 30 Mar 2021 11:47:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 904E46800C9 for ; Tue, 30 Mar 2021 11:47:38 +0300 (EEST) Received: by mail-lf1-f54.google.com with SMTP id d12so1523740lfv.11 for ; Tue, 30 Mar 2021 01:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=LhVRbbWRgO0E6oDKsJoVNM5fstJ+YvVTDVkRWWibAgE=; b=QH0SReIJzOXK/SAmFHLu709NT2udWG9d1ctf8lo9XsuHMDFOnN8ncxrwcr2azR4c0A Nfc6Tyv+gWRai9YQEBwwemCOQjPnNq/HA6KjyqTRCG2f8YnMPEBqDsShj28hJjZXrbrF Jb1W2uTMJBC14lfHlKIbqcAeJkwWbG9kuQBTD6IPbIdKI/T7b67LXKEBschmdMYkXR92 vvByaKoPjsHoGMsPkatkCjWcmIMULXZK/G0291HNLx79FMkmu6EdCpLRluYF/V7sIQ9L QfArdjw/R1By9cOp1SBX32u9akM+NHBNacpq234tbu5g8Crj210DGXHH2oYegSwfjlG8 voog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=LhVRbbWRgO0E6oDKsJoVNM5fstJ+YvVTDVkRWWibAgE=; b=lhtVC0LSUWxpX9XYajnyCM7v0wGsEdyrTRcoGuGCcgUNtHcIYlLr+cvW/MeuVDTjeN nXlo/hdVMHl7+wcVSKODNNZl1/9WLwBNKqikSEFvW8Eb17OrbkIymkBpGZmwvQc+yADS PQtV4NZ/ZKyAYxFW1mLBxWERuArYgykDDoItX5d+krA6P2TkSKGWOGEruVNquNV28zcp VyJzPV5C7iNdqH6cj9q94kA5PAYKIcrKAwqn4jJTa/l+Miei2Z+6tgJNBDj1rMc0wIIn X8LyGUCnFY2KZP/UiS/LKxH1NClbJWvhcB2M7Bo4sGIeOxAYXrYiU/K5r8XEywV+JycT AZBA== X-Gm-Message-State: AOAM533VpV5BKI+QOVYil0ym5MLWb3wYoBc3rMYqWdUgkjxQvlX8+aZo /6VS1rQqt9tt7y7YNWwxq9D7klg5FEQ= X-Google-Smtp-Source: ABdhPJz1QTlECL/sX997q5Lpx12AXVqHYisGz+3tseorJR1sqekmwUpgJxvB2aRCzmHCdRTKFAC1vw== X-Received: by 2002:a2e:988a:: with SMTP id b10mr20782486ljj.341.1617092629589; Tue, 30 Mar 2021 01:23:49 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id d34sm2089414lfv.102.2021.03.30.01.23.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:23:49 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Mar 2021 11:23:42 +0300 Message-Id: <20210330082346.8404-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/4] Initial region (styling) support for TTML 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Now sets alignment, font size, font family and the region's position and size according to the ASS styles passed to the encoder. Regions are relatively important in TTML, since the spec-defined default region is in raster location (similar to the default with HTML) - it starts from the top left corner and covers the whole screen. Mapping of the ASS script resolution to the cell resolution and using cells as sizing metric is not perfect, but while TTML does have a pixel based reference sizing by means of setting an extent to the root tt element, it is specifically disallowed in the EBU-TT profile, as well as apparently generally frowned upon as opposed to defining the cell resolution. In general, mapping to cell resolution seems to give "close enough" results, though. FATE test output still passes https://github.com/skynav/ttt/ validation, and visually the result can be verified against such renderers as http://sandflow.com/imsc1_1/index.html . Jan Jan Ekström (4): avcodec/ttmlenc: split header writing into its own function avformat/ttmlenc: enable writing out additional header values avcodec/ttmlenc: add initial support for regions and styles avcodec/ttmlenc: add support for region positioning and sizing libavcodec/ttmlenc.c | 311 ++++++++++++++++++++++++++++++++++--- libavcodec/ttmlenc.h | 6 + libavformat/ttmlenc.c | 78 +++++++++- tests/ref/fate/sub-ttmlenc | 88 ++++++----- 4 files changed, 423 insertions(+), 60 deletions(-)