[FFmpeg-devel,v3,0/5] Support for stream dispositions in MP4

Message ID 20210920150048.8790-1-jeebjp@gmail.com
Headers show


Jan Ekström Sept. 20, 2021, 3 p.m. UTC
Compared to v2:
* aviobuf changes to make a function useful in MP4 null-delimited string
  parsing into AVBPrint.
** Extended read_line_to_bprint to be a more generic read_string_to_bprint.
** Added a maximum length argument to read_string_to_bprint.
** Added a new function ff_read_string_to_bprint_overwrite.

* Switched from buffers with hard-coded sizes in avformat/mov to AVBPrint based
  parsing with ff_read_string_to_bprint_overwrite.

* Minor changes to the actual primary changes of the patch set:
** avformat/isom: "KindWritingModeCMAF | KindWritingModeUnifiedOrigin" now
                  has spaces between the bitmasks for better readability.
** avformat/{isom,movenc}: add and utilize KindWritingModeNB for the maximum
                           value limit in the AVOption definition.

First patch implements the CMAF specified way of flagging what in FFmpeg
are are called stream dispositions. Other identifiers such as HTML media track
kinds are allowed, but if there is a DASH identifier for something, it should
be utilized in stead.

Second patch is a compatibility patch for one of the vendors that supports this
feature. If this is considered a too bad of a hack, we can drop it from being
upstreamed, but at least I wanted to bring it up :) . The compatibility mode
is not the default, so it should also not proliferate such behavior.

Best regards,

Jan Ekström (5):
  avformat/aviobuf: add a full string reading mode to
  avformat/{aviobuf,avio_internal}: add
  avformat/{aviobuf,avio_internal}: add max_len argument to
  avformat/{isom,mov,movenc}: add support for CMAF DASH roles
  avformat/{isom,movenc}: add kind box compatibility mode for Unified

 libavformat/avio_internal.h                   | 19 ++++
 libavformat/aviobuf.c                         | 40 ++++++--
 libavformat/isom.c                            | 32 +++++++
 libavformat/isom.h                            | 19 ++++
 libavformat/mov.c                             | 91 +++++++++++++++++++
 libavformat/movenc.c                          | 57 ++++++++++++
 libavformat/movenc.h                          |  2 +
 tests/fate/mov.mak                            | 17 ++++
 .../ref/fate/mov-mp4-disposition-mpegts-remux | 81 +++++++++++++++++
 ...p4-disposition-unified-origin-mpegts-remux | 81 +++++++++++++++++
 10 files changed, 432 insertions(+), 7 deletions(-)
 create mode 100644 tests/ref/fate/mov-mp4-disposition-mpegts-remux
 create mode 100644 tests/ref/fate/mov-mp4-disposition-unified-origin-mpegts-remux