VP8 raw file: GraphViz block diagram (.dot) source

IVF is a simple container format for raw VP8 data, which is an open and royalty-free video compression format, currently developed by Google.

Test .ivf files are available at https://chromium.googlesource.com/webm/vp8-test-vectors

File extension

ivf

KS implementation details

License: CC0-1.0
Minimal Kaitai Struct required: 0.7

References

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

GraphViz block diagram source

vp8_ivf.dot

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

		vp8_ivf__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="magic1_pos">0</TD><TD PORT="magic1_size">4</TD><TD></TD><TD PORT="magic1_type">magic1</TD></TR>
			<TR><TD PORT="version_pos">4</TD><TD PORT="version_size">2</TD><TD>u2le</TD><TD PORT="version_type">version</TD></TR>
			<TR><TD PORT="len_header_pos">6</TD><TD PORT="len_header_size">2</TD><TD>u2le</TD><TD PORT="len_header_type">len_header</TD></TR>
			<TR><TD PORT="codec_pos">8</TD><TD PORT="codec_size">4</TD><TD></TD><TD PORT="codec_type">codec</TD></TR>
			<TR><TD PORT="width_pos">12</TD><TD PORT="width_size">2</TD><TD>u2le</TD><TD PORT="width_type">width</TD></TR>
			<TR><TD PORT="height_pos">14</TD><TD PORT="height_size">2</TD><TD>u2le</TD><TD PORT="height_type">height</TD></TR>
			<TR><TD PORT="framerate_pos">16</TD><TD PORT="framerate_size">4</TD><TD>u4le</TD><TD PORT="framerate_type">framerate</TD></TR>
			<TR><TD PORT="timescale_pos">20</TD><TD PORT="timescale_size">4</TD><TD>u4le</TD><TD PORT="timescale_type">timescale</TD></TR>
			<TR><TD PORT="num_frames_pos">24</TD><TD PORT="num_frames_size">4</TD><TD>u4le</TD><TD PORT="num_frames_type">num_frames</TD></TR>
			<TR><TD PORT="unused_pos">28</TD><TD PORT="unused_size">4</TD><TD>u4le</TD><TD PORT="unused_type">unused</TD></TR>
			<TR><TD PORT="image_data_pos">32</TD><TD PORT="image_data_size">...</TD><TD>Blocks</TD><TD PORT="image_data_type">image_data</TD></TR>
			<TR><TD COLSPAN="4" PORT="image_data__repeat">repeat num_frames times</TD></TR>
		</TABLE>>];
		subgraph cluster__blocks {
			label="Vp8Ivf::Blocks";
			graph[style=dotted];

			blocks__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="entries_pos">0</TD><TD PORT="entries_size">...</TD><TD>Block</TD><TD PORT="entries_type">entries</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__block {
			label="Vp8Ivf::Block";
			graph[style=dotted];

			block__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="len_frame_pos">0</TD><TD PORT="len_frame_size">4</TD><TD>u4le</TD><TD PORT="len_frame_type">len_frame</TD></TR>
				<TR><TD PORT="timestamp_pos">4</TD><TD PORT="timestamp_size">8</TD><TD>u8le</TD><TD PORT="timestamp_type">timestamp</TD></TR>
				<TR><TD PORT="framedata_pos">12</TD><TD PORT="framedata_size">len_frame</TD><TD></TD><TD PORT="framedata_type">framedata</TD></TR>
			</TABLE>>];
		}
	}
	vp8_ivf__seq:image_data_type -> blocks__seq [style=bold];
	vp8_ivf__seq:num_frames_type -> vp8_ivf__seq:image_data__repeat [color="#404040"];
	blocks__seq:entries_type -> block__seq [style=bold];
	block__seq:len_frame_type -> block__seq:framedata_size [color="#404040"];
}