From patchwork Fri Jan 22 10:37:30 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: 25068 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 BD1B744A186 for ; Fri, 22 Jan 2021 12:37:44 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A1BB5689E5B; Fri, 22 Jan 2021 12:37:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 68C2C689E5B for ; Fri, 22 Jan 2021 12:37:38 +0200 (EET) Received: by mail-lj1-f173.google.com with SMTP id i17so5986388ljn.1 for ; Fri, 22 Jan 2021 02:37:38 -0800 (PST) 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=rWg9/xjLWIS6BC8cqIec1NLpDwMZrzTiauJjJ21z1O8=; b=kkLLgzkgwCKwfv6EfVLpgZw/nvTWO7C2vidAtGds3Hhg+TiLZTKCzhRyYy1d9/olxL Ip22d5WhRcWwK0PxNLVsdVqoJZKrz3zpiKd/7DJqZYaxJl1httZdPtQBE8ffOn4AKIkV 7Sy4SrSJD8YD4tboBAe3EbyZazXsLNEn92rbpnnOlezv0nL56M0GrQfrjPOzqKjZZ/te +mdsBSEGBYjibaDT3Mv/e5EaQLUKbi//OeD6r1nvafSv7BivWMVgbY3EBrrKNz/uoJbD XiUj7RwUCHxrreLiU/RrF3j0CU5kft4hosw68yBHb1kU9vhyUiRyRv9MLzL19fcXIuzs e+3A== 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=rWg9/xjLWIS6BC8cqIec1NLpDwMZrzTiauJjJ21z1O8=; b=HGMaBLIA7QzvjnjFrnIKBIk8B9DexYikKhI/Lhi74/D3TgIMKd8Wd5JTuAu7u7jIA2 9tzg76amIGAyTW6RdQJLO6XEvP6oKNGwSjwU0RlfbUF/ATCeS6kmi4evo1fMOcavqp4C jhvOSYybiJeINuNvRKHUnvHyP3I2u+8q5Gr8+ofEXusNt9ZyKtxXWotwhnvn7jpog9xX q+RJbeJMznWYPTzN3oUgdwwMYv+LC129dc256MKvE/Hk/GEadMvNxXGYKuns5up3iyHM OyajOMALZ/hmmCi7HlhuEZjsSFoObo5mO15Z5NNobXA6biAH6DpGkAiJqR8zUd0TH7+k M4xg== X-Gm-Message-State: AOAM533u2GTeC11IK5+BpsvQgLZ5+gAH6vuk2j2ZYL2t56VggzgoypkL EorL3uSeiNSzm/qt9a78baL+zGGs8JE= X-Google-Smtp-Source: ABdhPJwwkoCKHf2HHpb55T/5T92TYHDRyFUFCrNSg21t5AmQe5dJxA3TVjiHhZe/cVaAzoNBVAGnQg== X-Received: by 2002:a2e:9847:: with SMTP id e7mr95624ljj.388.1611311857807; Fri, 22 Jan 2021 02:37:37 -0800 (PST) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id g2sm831626lfb.255.2021.01.22.02.37.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 02:37:37 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Jan 2021 12:37:30 +0200 Message-Id: <20210122103734.24420-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 0/4] Initial implementation of TTML encoding/muxing 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" I've intentionally kept this initial version simple (no styling etc) to focus on the basics. As this goes through review, additional features can be added (I had initial PoC for styling implemented some time around previous VDD), and there is another patch set in my queue which would then add support for muxing TTML into MP4. Changes from the second version: - Added the requested character escape modes for attribute values, AV_ESCAPE_MODE_XML_ATT_VALUE_SINGLE_QUOTED and AV_ESCAPE_MODE_XML_ATT_VALUE_DOUBLE_QUOTED as per XML spec, 2.3. - As we no longer have just one XML-related escape mode, make the base one be AV_ESCAPE_MODE_XML_CHAR_DATA according to what it is escaping for. - Utilize AV_ESCAPE_MODE_XML_ATT_VALUE_DOUBLE_QUOTED in ffprobe, as all it seems to write are double quoted attribute values. Jan Jan Ekström (3): avutil/{avstring,bprint}: add XML attribute value escape modes ffprobe: switch to av_bprint_escape for XML escaping {avcodec,avformat}: add TTML encoder and muxer Stefano Sabatini (1): avutil/{avstring,bprint}: add XML escaping from ffprobe to avutil Changelog | 1 + doc/general_contents.texi | 1 + fftools/ffprobe.c | 32 +++---- libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/ttmlenc.c | 179 +++++++++++++++++++++++++++++++++++++ libavcodec/version.h | 4 +- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/ttmlenc.c | 166 ++++++++++++++++++++++++++++++++++ libavformat/version.h | 4 +- libavutil/avstring.h | 9 +- libavutil/bprint.c | 41 +++++++++ tests/fate/subtitles.mak | 3 + tests/ref/fate/sub-ttmlenc | 122 +++++++++++++++++++++++++ tools/ffescape.c | 9 +- 16 files changed, 544 insertions(+), 31 deletions(-) create mode 100644 libavcodec/ttmlenc.c create mode 100644 libavformat/ttmlenc.c create mode 100644 tests/ref/fate/sub-ttmlenc