mbox series

[FFmpeg-devel,v3,0/4] Initial region (styling) support for TTML

Message ID 20210426093425.17900-1-jeebjp@gmail.com
Headers show
Series Initial region (styling) support for TTML | expand

Message

Jan Ekström April 26, 2021, 9:34 a.m. UTC
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 .

Changes from v2:
* Noticed that taking a pointer to an already dereferenced style in libavcodec/ttmlenc.c
  is unnecessary and complicates the style-writing function for no real reason.
  Thus, made the function just take in the struct, as opposed to a pointer to a struct.

Will still be pushing this patch set in soon, posting this minor revision of the
patch set just so that it is in the mailing list archives and patchwork's automation
can poke at it.

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       | 264 ++++++++++++++++++++++++++++++++++---
 libavcodec/ttmlenc.h       |   6 +
 libavformat/ttmlenc.c      |  70 +++++++++-
 tests/ref/fate/sub-ttmlenc |  88 +++++++------
 4 files changed, 368 insertions(+), 60 deletions(-)

Comments

Jan Ekström April 26, 2021, 1:48 p.m. UTC | #1
On Mon, Apr 26, 2021 at 12:34 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> 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 .
>
> Changes from v2:
> * Noticed that taking a pointer to an already dereferenced style in libavcodec/ttmlenc.c
>   is unnecessary and complicates the style-writing function for no real reason.
>   Thus, made the function just take in the struct, as opposed to a pointer to a struct.
>
> Will still be pushing this patch set in soon, posting this minor revision of the
> patch set just so that it is in the mailing list archives and patchwork's automation
> can poke at it.
>

Just like locally, the patchwork CI FATE jobs for both x86_64 and PPC64 passed.

Thus applied this set as:
b71184faefce38c8a965c7d0e8552e049ae9e150
464d6ed98d67fe0c3819516e9b0ca5edaf956a0e
3ef5a8ba2b7798ea4e5708c5644fa60dd00bde06
b24488e7277af2a4b77a33fa795b4df5979b0fcd

Thanks to those who reviewed this set,
Jan