iPhone Life magazine

Easy Video Optimization Tips for Video Streaming (For Programmers)

For programmers or people with advanced technical knowledge.

Optimizing your videos, assuming they haven't been purchased from the iTunes Store, is of extreme importance if you stream them to iOS devices, particularly to an Apple TV.

In my previous article, I've shown you some ways of finding out whether a video file is optimized. Check out this article on how optimization needs to be done if you run into a non-optimized video, with, for example, the absolutely excellent Subler.


At MacRumors, a user pointed my attention to Apple's own Atom Inspector (download requires a free Apple Developer account).

With the Atom Inspector, or any video atom lister app keeping the order of the atoms, including ISO Viewer, it's even easier to decide whether a video is optimized for streaming or not. Just check out the relative order of the “mdat” and the “moov” top-level entries in the list. If “moov” is before “mdat”, the file is optimized; if it isn't, then, un-optimized.

Below is an example with THIS optimized video (linked from the Closed Captioning bible):

As you can see, “moov” is before “mdat” (I've annotated both); that is, the file is indeed optimized.
Now, let's see an example of a non-optimized video (HERE; main article I used it in):


As you can see, the order is just the opposite (“moov” is after “mdat”) showing the file isn't optimized.

What about ISO Viewer?
Incidentally, the same applies to the multiplatform (Java-based) ISO Viewer (as opposed to Apple's tool), of which I've already talked about in my previous article. Below are the respective screenshots of the two files loaded to ISO Viewer (I also annotated the entries the relative order of which you'll need to check out):

(Optimized)

(Non-optimized)


Other Useful Features of Atom Inspector

Atom Inspector can both edit and, unlike ISO Viewer, save(!) changes in MP4 (MOV etc.) files. However, it doesn't convert the atom/box type for AVC/H.264 (more info HERE; it's the same value that I annotated in the last screenshot of my previous article) to human-friendly names, which makes it harder to edit e.g. AVCLevelIndication. An example shot; in this case, the AVC Decoder Configuration Record is annotated by me:



As you can see, all you can see (and edit) are hex values, not human-readable names. However, using the standard (or the above-mentioned article), it's fairly easy to navigate the file and edit the values you need.

Topics:
Email icon
Want more? Get our weekly newsletter:

Werner Ruotsalainen is an iOS and Java programming lecturer who is well-versed in programming, hacking, operating systems, and programming languages. Werner tries to generate unique articles on subjects not widely discussed. Some of his articles are highly technical and are intended for other programmers and coders.

Werner also is interested in photography and videography. He is a frequent contributor to not only mobile and computing publications, but also photo and video forums. He loves swimming, skiing, going to the gym, and using his iPads. English is one of several languages he speaks.