MP4

Introduction

The Atom/Box

struct atom {
  uint32_t  size ;
  uint32_t  type ;  
  uint32_t  data[] ;
} ;
Code Listing #: MP4 Generic Atom/Box structure (C syntax).
size:
A special case is when the value of size is 1. In that case, the first 8 bytes of data is a 64-bit unsigned integer in network byte order with the real length of the atom.
type:
data:

'data'

struct dataAtom {
  uint32_t        size ;
  uint32_t        type ;
  uint32_t        verFlags ;
  const uint32_t  _rsvd ;
  union {
    uint8_t       b[] ;
    uint16_t      w[] ;
    uint32_t      l[] ;
  } data ;
} ;
Code Listing #: (C syntax).
size:
type:
Always 'data' (0x65617461)
verFlags:
The eight (8) most significant bits contain the version of the 'data' Atom. Currently 0x00.
The twenty-four (24) least significant bits contain the flags.
_rsvd:
data:
Table #:
Flags Mneonic
0x000000 BINARY
0x000001 TEXT
0x00000D FILE
0x000015 BYTE

'ftyp' Atom

struct ftyp_atom {
  uint32_t  size ;
  uint32_t  type ;  
  uint32_t  brandMajor ;
  uint32_t  brandVersion ;
  uint32_t  brandCompatible[] ;
} ;
Code listing #: 'ftyp' Atom/Box format (C syntax).

'moov' Atom

'udta' Atom

'meta' Atom

'hdlr' Atom
'ilst' Atom
Table #: Subatoms of the 'udta' atom.
FourCC Description Format Schema.Org
'disk' Disc number BINARY position
'pcst' Podcast name inSeries.name
'purl' Podcast URL inSeries.url
'trkn' Track number BINARY position
'tvsh' (TV) Show name. inSeries.name
'©alb' Name of Album TEXT inAlbum.name
'©arg' Name of arranger TEXT
'©ark' Keyword(s) for arranger TEXT
'©ART' Name of Artist TEXT byArtist.name
'©cok' Keyword(s) for composer TEXT composer.keywords
'©com'
'©wrt'
Name of composer TEXT composer.name
'©cpy' Copyright statement TEXT license
'©day' Date the movie content was created TEXT dateCreated
'©dir' Name of movie’s director TEXT director.name
'©ed�' � = 1–9. Edit dates and descriptions TEXT
'©fmt' Indication of movie format (computer-generated, digitized, and so on) TEXT
'©gen' Genre TEXT genre
'©inf' Information about the movie TEXT description
'©isr' ISRC code TEXT isrc
'©lab' Name of record label TEXT recordLabel.name
'©lal' URL of record label TEXT recordLabel.url
'©mak' Name of file creator or maker TEXT creator.name
'©mal' URL of file creator or maker TEXT creator.url
'©nak' Title keyword(s) of the content TEXT
'©nam' Title of the content TEXT name
'©pdk' Keyword(s) for producer TEXT producer.keyword
'©phg' Recording copyright statement, normally preceded by the symbol P TEXT license
'©prd' Name of producer TEXT producer.name
'©prf' Names of performers TEXT byArtist.name,
creator.name
'©prk' Keyword(s) of main artist and performer TEXT byArtist.keywords
'©prl' URL of main artist and performer TEXT byArtist.url,
creator.url
'©req' Special hardware and software requirements TEXT
'©snk' Subtitle keyword(s) TEXT
'©snm' Subtitle name TEXT
'©src' Credits for those who provided movie source content TEXT
'©swf' Songwriter (Lyricist) name TEXT
'©swk' Songwriter (Lyricist) keyword(s) TEXT
'©swr' Name and version number of the software (or hardware) that generated this movie
'©wrt' Name of movie’s writer TEXT

References and Further Reading

Unsorted

ffmpeg -i {$input}.mp4 -c copy -hls_time 10.0000 -hls_playlist_type vod -hls_flags single_file -hls_segment_type fmp4 -hls_segment_filename {$output}.mp4 {$output}.m3u8