quicktime_mov: GraphViz block diagram (.dot) source

Application

QuickTime, MP4 ISO 14496-14 media

KS implementation details

License: CC0-1.0

This page hosts a formal specification of quicktime_mov using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

GraphViz block diagram source

quicktime_mov.dot

digraph {
	rankdir=LR;
	node [shape=plaintext];
	subgraph cluster__quicktime_mov {
		label="QuicktimeMov";
		graph[style=dotted];

		quicktime_mov__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
			<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
			<TR><TD PORT="atoms_pos">0</TD><TD PORT="atoms_size">...</TD><TD>AtomList</TD><TD PORT="atoms_type">atoms</TD></TR>
		</TABLE>>];
		subgraph cluster__mvhd_body {
			label="QuicktimeMov::MvhdBody";
			graph[style=dotted];

			mvhd_body__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="version_pos">0</TD><TD PORT="version_size">1</TD><TD>u1</TD><TD PORT="version_type">version</TD></TR>
				<TR><TD PORT="flags_pos">1</TD><TD PORT="flags_size">3</TD><TD></TD><TD PORT="flags_type">flags</TD></TR>
				<TR><TD PORT="creation_time_pos">4</TD><TD PORT="creation_time_size">4</TD><TD>u4be</TD><TD PORT="creation_time_type">creation_time</TD></TR>
				<TR><TD PORT="modification_time_pos">8</TD><TD PORT="modification_time_size">4</TD><TD>u4be</TD><TD PORT="modification_time_type">modification_time</TD></TR>
				<TR><TD PORT="time_scale_pos">12</TD><TD PORT="time_scale_size">4</TD><TD>u4be</TD><TD PORT="time_scale_type">time_scale</TD></TR>
				<TR><TD PORT="duration_pos">16</TD><TD PORT="duration_size">4</TD><TD>u4be</TD><TD PORT="duration_type">duration</TD></TR>
				<TR><TD PORT="preferred_rate_pos">20</TD><TD PORT="preferred_rate_size">4</TD><TD>Fixed32</TD><TD PORT="preferred_rate_type">preferred_rate</TD></TR>
				<TR><TD PORT="preferred_volume_pos">24</TD><TD PORT="preferred_volume_size">2</TD><TD>Fixed16</TD><TD PORT="preferred_volume_type">preferred_volume</TD></TR>
				<TR><TD PORT="reserved1_pos">26</TD><TD PORT="reserved1_size">10</TD><TD></TD><TD PORT="reserved1_type">reserved1</TD></TR>
				<TR><TD PORT="matrix_pos">36</TD><TD PORT="matrix_size">36</TD><TD></TD><TD PORT="matrix_type">matrix</TD></TR>
				<TR><TD PORT="preview_time_pos">72</TD><TD PORT="preview_time_size">4</TD><TD>u4be</TD><TD PORT="preview_time_type">preview_time</TD></TR>
				<TR><TD PORT="preview_duration_pos">76</TD><TD PORT="preview_duration_size">4</TD><TD>u4be</TD><TD PORT="preview_duration_type">preview_duration</TD></TR>
				<TR><TD PORT="poster_time_pos">80</TD><TD PORT="poster_time_size">4</TD><TD>u4be</TD><TD PORT="poster_time_type">poster_time</TD></TR>
				<TR><TD PORT="selection_time_pos">84</TD><TD PORT="selection_time_size">4</TD><TD>u4be</TD><TD PORT="selection_time_type">selection_time</TD></TR>
				<TR><TD PORT="selection_duration_pos">88</TD><TD PORT="selection_duration_size">4</TD><TD>u4be</TD><TD PORT="selection_duration_type">selection_duration</TD></TR>
				<TR><TD PORT="current_time_pos">92</TD><TD PORT="current_time_size">4</TD><TD>u4be</TD><TD PORT="current_time_type">current_time</TD></TR>
				<TR><TD PORT="next_track_id_pos">96</TD><TD PORT="next_track_id_size">4</TD><TD>u4be</TD><TD PORT="next_track_id_type">next_track_id</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__ftyp_body {
			label="QuicktimeMov::FtypBody";
			graph[style=dotted];

			ftyp_body__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="major_brand_pos">0</TD><TD PORT="major_brand_size">4</TD><TD>u4be→Brand</TD><TD PORT="major_brand_type">major_brand</TD></TR>
				<TR><TD PORT="minor_version_pos">4</TD><TD PORT="minor_version_size">4</TD><TD></TD><TD PORT="minor_version_type">minor_version</TD></TR>
				<TR><TD PORT="compatible_brands_pos">8</TD><TD PORT="compatible_brands_size">4</TD><TD>u4be→Brand</TD><TD PORT="compatible_brands_type">compatible_brands</TD></TR>
				<TR><TD COLSPAN="4" PORT="compatible_brands__repeat">repeat to end of stream</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__fixed32 {
			label="QuicktimeMov::Fixed32";
			graph[style=dotted];

			fixed32__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="int_part_pos">0</TD><TD PORT="int_part_size">2</TD><TD>s2be</TD><TD PORT="int_part_type">int_part</TD></TR>
				<TR><TD PORT="frac_part_pos">2</TD><TD PORT="frac_part_size">2</TD><TD>u2be</TD><TD PORT="frac_part_type">frac_part</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__fixed16 {
			label="QuicktimeMov::Fixed16";
			graph[style=dotted];

			fixed16__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="int_part_pos">0</TD><TD PORT="int_part_size">1</TD><TD>s1</TD><TD PORT="int_part_type">int_part</TD></TR>
				<TR><TD PORT="frac_part_pos">1</TD><TD PORT="frac_part_size">1</TD><TD>u1</TD><TD PORT="frac_part_type">frac_part</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__atom {
			label="QuicktimeMov::Atom";
			graph[style=dotted];

			atom__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="len32_pos">0</TD><TD PORT="len32_size">4</TD><TD>u4be</TD><TD PORT="len32_type">len32</TD></TR>
				<TR><TD PORT="atom_type_pos">4</TD><TD PORT="atom_type_size">4</TD><TD>u4be→AtomType</TD><TD PORT="atom_type_type">atom_type</TD></TR>
				<TR><TD PORT="len64_pos">8</TD><TD PORT="len64_size">8</TD><TD>u8be</TD><TD PORT="len64_type">len64</TD></TR>
				<TR><TD PORT="body_pos">16</TD><TD PORT="body_size">...</TD><TD>switch (atom_type)</TD><TD PORT="body_type">body</TD></TR>
			</TABLE>>];
			atom__inst__len [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">id</TD><TD BGCOLOR="#E0FFE0">value</TD></TR>
				<TR><TD>len</TD><TD>(len32 == 0 ? (_io.size - 8) : (len32 == 1 ? (len64 - 16) : (len32 - 8)))</TD></TR>
			</TABLE>>];
atom__seq_body_switch [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
	<TR><TD BGCOLOR="#F0F2E4">case</TD><TD BGCOLOR="#F0F2E4">type</TD></TR>
	<TR><TD>:atom_type_stbl</TD><TD PORT="case0">AtomList</TD></TR>
	<TR><TD>:atom_type_moof</TD><TD PORT="case1">AtomList</TD></TR>
	<TR><TD>:atom_type_mvhd</TD><TD PORT="case2">MvhdBody</TD></TR>
	<TR><TD>:atom_type_minf</TD><TD PORT="case3">AtomList</TD></TR>
	<TR><TD>:atom_type_trak</TD><TD PORT="case4">AtomList</TD></TR>
	<TR><TD>:atom_type_traf</TD><TD PORT="case5">AtomList</TD></TR>
	<TR><TD>:atom_type_mdia</TD><TD PORT="case6">AtomList</TD></TR>
	<TR><TD>:atom_type_ftyp</TD><TD PORT="case7">FtypBody</TD></TR>
	<TR><TD>:atom_type_moov</TD><TD PORT="case8">AtomList</TD></TR>
	<TR><TD>:atom_type_tkhd</TD><TD PORT="case9">TkhdBody</TD></TR>
	<TR><TD>:atom_type_dinf</TD><TD PORT="case10">AtomList</TD></TR>
</TABLE>>];
		}
		subgraph cluster__tkhd_body {
			label="QuicktimeMov::TkhdBody";
			graph[style=dotted];

			tkhd_body__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="version_pos">0</TD><TD PORT="version_size">1</TD><TD>u1</TD><TD PORT="version_type">version</TD></TR>
				<TR><TD PORT="flags_pos">1</TD><TD PORT="flags_size">3</TD><TD></TD><TD PORT="flags_type">flags</TD></TR>
				<TR><TD PORT="creation_time_pos">4</TD><TD PORT="creation_time_size">4</TD><TD>u4be</TD><TD PORT="creation_time_type">creation_time</TD></TR>
				<TR><TD PORT="modification_time_pos">8</TD><TD PORT="modification_time_size">4</TD><TD>u4be</TD><TD PORT="modification_time_type">modification_time</TD></TR>
				<TR><TD PORT="track_id_pos">12</TD><TD PORT="track_id_size">4</TD><TD>u4be</TD><TD PORT="track_id_type">track_id</TD></TR>
				<TR><TD PORT="reserved1_pos">16</TD><TD PORT="reserved1_size">4</TD><TD></TD><TD PORT="reserved1_type">reserved1</TD></TR>
				<TR><TD PORT="duration_pos">20</TD><TD PORT="duration_size">4</TD><TD>u4be</TD><TD PORT="duration_type">duration</TD></TR>
				<TR><TD PORT="reserved2_pos">24</TD><TD PORT="reserved2_size">8</TD><TD></TD><TD PORT="reserved2_type">reserved2</TD></TR>
				<TR><TD PORT="layer_pos">32</TD><TD PORT="layer_size">2</TD><TD>u2be</TD><TD PORT="layer_type">layer</TD></TR>
				<TR><TD PORT="alternative_group_pos">34</TD><TD PORT="alternative_group_size">2</TD><TD>u2be</TD><TD PORT="alternative_group_type">alternative_group</TD></TR>
				<TR><TD PORT="volume_pos">36</TD><TD PORT="volume_size">2</TD><TD>u2be</TD><TD PORT="volume_type">volume</TD></TR>
				<TR><TD PORT="reserved3_pos">38</TD><TD PORT="reserved3_size">2</TD><TD>u2be</TD><TD PORT="reserved3_type">reserved3</TD></TR>
				<TR><TD PORT="matrix_pos">40</TD><TD PORT="matrix_size">36</TD><TD></TD><TD PORT="matrix_type">matrix</TD></TR>
				<TR><TD PORT="width_pos">76</TD><TD PORT="width_size">4</TD><TD>Fixed32</TD><TD PORT="width_type">width</TD></TR>
				<TR><TD PORT="height_pos">80</TD><TD PORT="height_size">4</TD><TD>Fixed32</TD><TD PORT="height_type">height</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__atom_list {
			label="QuicktimeMov::AtomList";
			graph[style=dotted];

			atom_list__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="items_pos">0</TD><TD PORT="items_size">...</TD><TD>Atom</TD><TD PORT="items_type">items</TD></TR>
				<TR><TD COLSPAN="4" PORT="items__repeat">repeat to end of stream</TD></TR>
			</TABLE>>];
		}
	}
	quicktime_mov__seq:atoms_type -> atom_list__seq [style=bold];
	mvhd_body__seq:preferred_rate_type -> fixed32__seq [style=bold];
	mvhd_body__seq:preferred_volume_type -> fixed16__seq [style=bold];
	atom__seq:body_type -> atom__seq_body_switch [style=bold];
	atom__seq_body_switch:case0 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case1 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case2 -> mvhd_body__seq [style=bold];
	atom__seq_body_switch:case3 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case4 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case5 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case6 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case7 -> ftyp_body__seq [style=bold];
	atom__seq_body_switch:case8 -> atom_list__seq [style=bold];
	atom__seq_body_switch:case9 -> tkhd_body__seq [style=bold];
	atom__seq_body_switch:case10 -> atom_list__seq [style=bold];
	atom__seq:atom_type_type -> atom__seq:body_type [color="#404040"];
	atom__seq:len32_type -> atom__inst__len [color="#404040"];
	atom__seq:len32_type -> atom__inst__len [color="#404040"];
	atom__seq:len64_type -> atom__inst__len [color="#404040"];
	atom__seq:len32_type -> atom__inst__len [color="#404040"];
	tkhd_body__seq:width_type -> fixed32__seq [style=bold];
	tkhd_body__seq:height_type -> fixed32__seq [style=bold];
	atom_list__seq:items_type -> atom__seq [style=bold];
}