
With this information we can easily find the end of the mdat atom by scrolling through it (or up from the bottom of the file) to see where the data starts to look random as illustrated in the image below. Notice that the contents of the mdat atom seem quite random when viewed in a hex editor, in contrast the contents of the other atoms in MP4 and MOV files are very structured. Finding the mdat atom can be done by searching the file for the string “mdat” as seen in the above image. For the purposes of this tutorial we won’t delve that deep. The data contained within the mdat atom is comprised of chunks, which are comprised of nal units, which are comprised of slices. The atom which contains the raw frame and audio data can be identified by it’s atom type string, which in this case is mdat (short for media data). The MP4 and MOV (Quicktime) formats utilize a similar structure, the file is broken down into atoms or blocks of data. We know that we’re looking at an MP4 or MOV file when we see the text ftypqt starting on the fifth byte of the file as illustrated in the example below. Editing the file using hex rather than text allows greater flexibility since we’re no longer restricted to text characters (which are each represented by two hex digits).

Hex editors allow us to view and edit the bytes of a file using hexadecimal. If you don’t have a hex editor installed there are some freeware options listed at the bottom of this post. Get started by making a copy of your MOV or MP4 and open the copy in a hex editor - never edit the original file. If a video doesn’t set off any copyright claims you can download it from the YouTube Video Manager in MP4 format.


If the video you want to destroy is not in MP4 or MOV format already an easy way to convert it is to upload it to YouTube, let them convert it, and then download the result. This tutorial will focus on glitching the popular MP4 and MOV formats containing video compressed with the H.264 standard. Since video formats contain audio and timing information in addition to visual information corrupting the wrong section of a video file can quickly render the file unplayable rather than delightfully distorted.

This is owing to the fact that video formats are substantially more complex than image formats. Glitching videos with data corruption can be a tricky process.
