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

Jan Ekström jeebjp at gmail.com
Mon Aug 16 15:26:10 EEST 2021


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 v3:

* avformat/ttmlenc: added const to the function argument codecpar, and switched
                    included header from avformat.h to specifically
                    libavcodec/codec_par.h according to comments from Andreas.
* avformat/movenc_ttml: applied recommendation from Andreas to deduplicate
                        AVFormatContext cleanup.

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             | 179 ++++++++++++++++++++++++++++++-
 libavformat/movenc.h             |   5 +
 libavformat/movenc_ttml.c        | 171 +++++++++++++++++++++++++++++
 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, 521 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

-- 
2.31.1



More information about the ffmpeg-devel mailing list