Note

Disclaimer. This is design documentation which may differ from its final version.

CMAF Reference

Note

To Move * Microsoft has pulled out of support for DASH, including this spec (John Simmons left the DASH board and continues only on CMAF in CTA-WAVE, Andy Rosen will talk to David Sayed soon about this) * Elemental will not be able to create CMAF output for MediaLive any time soon(they do HSL and Smooth and have a hard time when it comes to DASH, CMAF not started)

The details below were moved from Reference/CMAF.

CMAF files have major brand cmfc in ftyp box. Since CMAF is fragmented mp4 (by definition), the --brand=cmfc parameter only makes sense when generating fragmented files (.ismv, .isma, or .ismt). If the CMAF file extensions are used (.cmfv, .cmfa, or .cmft) the CMAF file brand is implied (and --brand=cmfc may be omitted).

CMAF track files can contain only one track, so it may be necessary to use track filters to package all tracks individually. The process goes like:

mp4split -o audio.cmfa bundle.mp4 --track_type=audio
mp4split -o audio.m3u8 audio.cmfa

mp4split -o video1.cmfv bundle.mp4 --track_id=1
mp4split -o video1.m3u8 video1.cmfv

mp4split -o video2.cmfv bundle.mp4 --track_id=2
mp4split -o video2.m3u8 video2.cmfv

mp4split -o subs.cmft imsc-1-text.ttml
mp4split -o subs.m3u8 subs.cmft

mp4split --package-hls -o master.m3u8 \
                          audio.m3u8 \
                          video1.m3u8 \
                          video2.m3u8 \
                          subs.m3u8

Packaging

Section 7

CMAF file brands are detected and set in ftyp automatically when packaging:

  • Add "cmfc" as major_brand (with minor_version 0).
  • Add file extensions ".cmfv" for video, ".cmfa" for audio and ".cmft" for subtitle tracks.
  • Video profile brands 'cfsd', 'cfhd', 'chdf' (AVC)
  • Video profile brands 'chhd', 'chh1', 'cud8', 'cud1', 'chd1', 'clg1' (HEVC)
  • Video profile brand 'cv10' (DolbyVision)
  • Audio profile brands 'caac' ('caaa' brand makes no sense at this point)
  • Text profile brands 'cwvt', 'im1t', 'im1i', 'ccea'

Note: you should also add the brands cmfs cmff

New brands (TODO):

  • Audio profile brands: multi-channel and cxha (xHE-AAC)
  • Text profiles for IMSC 1.1 (w3c update): im2t, im2i (subs)

Do not duplicate "pssh" boxes in the CMAF headers, but only in the Manifest. The exception is for download-to-own files, where it should be in the init segment.

7.5.13 Edit List Box ('elst')

How to indicate offset when packaging a single audio CMAF track where each media sample’s presentation time does not equal its composition time? (edts with media_time equal to the CMAF track presentation time delay.) (TODO)

7.5.16 Track Fragment Header Box ('tfhd')

The base-data-offset-present = 0 and the default-base-is-moof = 1.

7.5.17 Track Run Box ('trun')

Within a CMAF track, any TrackRunBox that describes any non­sync media samples shall identify sample dependency with the CMAF chunk and CMAF fragment using a combination of the sample_flags and first_sample_flags fields, and default values in the TrackFragmentHeaderBox:

  • sample_is_non_sync_sample shall be 0 for SAP type 1 or 2, and 1 otherwise
  • an empty SyncSampleBox shall be present in the track

(Conversely, absence of SyncSampleBox indicates that all media samples are sync samples, that is: a Adding trick play to a DASH or HLS stream file.)

Section 9-11

  • Check profile compliance audio constraints (<2 channels, <48kHz sampling, ..)
  • Check profile compliance video constraints (>AVC high, <60Hz,..)
  • Check and/or fixup compliance text constraints (namespaces, attributes w3c (TODO))

Correctly set the sample_is_depended_on for disposable pictures. (TODO)

9.2.6 Video media sample dependencies

Within a video CMAF track, any TrackRunBox that describes any non­sync pictures shall identify picture dependencies using a combination of the sample_flags and first_sample_flags fields, or default flags in the corresponding TrackFragmentHeaderBox:

  • sample_is_non_sync_sample shall be 0 for SAP type 1 or 2, and 1 otherwise;
  • sample_depends_on should be 1 or 2 (the value 2 identifies I pictures);
  • sample_is_depended_on should be 2 for disposable pictures.

Section 11

The codecs parameter of the media type of the CMAF Track SHALL contain the value "stpp.ttml.im1t" (and "..im1i"). EXAMPLE 2: "application/mp4;codecs=stpp.ttml.im1t" (and "..im1i") is the media type of an IMSC1 Text (or Image) Track.

TODO on the fly "im1t" <- "cwvt" generation

TODO fix ccea hls signalling

Section 12

Valid CMAF Tracks do not have media time discontinuities resulting from missing samples or Fragments. Gaps in decode time would result in audio video synchronization errors. For recommendations on handling missing media samples and missing CMAF Fragments, see 12.2.1

TODO The most preferred method to handle missing media at ingest, encode, or packaging is to provide substitute media such as a repeated video frame or slate, and silent audio so downloading and decoding can continue in players.

Appendix B.2.3

TODO

  • Should contain SEI messages containing color and dynamic range mastering and rendering information if default values are not encoded, as required in 9.3.5.1.
  • Shall contain a ColourInformationBox ('colr') with colour_type 'nclx', and PixelAspectRatioBox ('pasp') when required per 9.3.5.1.