mbox series

[FFmpeg-devel,v2,0/2] TTML in MP4, part 1

Message ID 20210719114045.44039-1-jeebjp@gmail.com
Headers show
Series TTML in MP4, part 1 | expand

Message

Jan Ekström July 19, 2021, 11:40 a.m. UTC
To keep it simpler this first part includes only non-fragmented use
cases if the built-in sample squashing is utilized. Contains the basic
mapping code as well as the function that writes out the squashed documents.

Works with both subtitle-only output as well as with other streams.

In a separate patch set I will add additional complexity on top
by introducing fragmentation matching based on the other streams in
the mux (since most things that ingest fragmented MP4 with subtitles
want the fragment time ranges to match between the video/audio streams
and subtitles in the mux).

Changes from v1:

* Misc. small changes according to review from Martin.
* Removed the {start,end}_ts variables for the packet queue, they are not
  required for the functionality that is being added currently and simplify
  the code.
* Track start/end calculation based on other tracks was removed. This will
  become required when fragmentation support is added (as the fragmentation
  will have to be matched against A/V tracks), but for now a track should only
  be interested of its own state.

Jan

Jan Ekström (2):
  avformat/ttml: split TTML paragraph based or not check into header
  avformat/movenc: add support for TTML muxing

 libavformat/Makefile             |   2 +-
 libavformat/isom.h               |   3 +
 libavformat/movenc.c             | 167 +++++++++++++++++++++++++-
 libavformat/movenc.h             |   5 +
 libavformat/movenc_ttml.c        | 195 +++++++++++++++++++++++++++++++
 libavformat/movenc_ttml.h        |  31 +++++
 libavformat/ttmlenc.c            |   9 +-
 libavformat/ttmlenc.h            |  39 +++++++
 tests/fate/subtitles.mak         |   4 +
 tests/ref/fate/sub-ttml-mp4-dfxp |  44 +++++++
 tests/ref/fate/sub-ttml-mp4-stpp |  44 +++++++
 11 files changed, 533 insertions(+), 10 deletions(-)
 create mode 100644 libavformat/movenc_ttml.c
 create mode 100644 libavformat/movenc_ttml.h
 create mode 100644 libavformat/ttmlenc.h
 create mode 100644 tests/ref/fate/sub-ttml-mp4-dfxp
 create mode 100644 tests/ref/fate/sub-ttml-mp4-stpp