Optimize video file size and compression

Narakeet can help you save money and time on bandwidth cost and processing for different use cases, by automatically optimizing video compression and file size for common use cases, such as sharing on YouTube or self-hosting. This guide explains how to use automatic optimizations.

What use cases are supported?

Narakeet provides presets for 3 common use cases: offline use, online sharing, and self-hosting. They impact the size of the file, the speed of the processing and the quality of the output. They also impact where the moov atom is stored with metadata.

Offline use

Videos optimized for offline use will use very little compression, and have the largest file size of all three options. This will ensure that you can post-process them in video editing tools, include into professionally recorded movies or distribute or play offline and get the best results. The moov atom is stored at the end. Use this option if bandwidth costs are not an issue, and you do not need to stream the file directly to viewers.

Online sharing

Videos optimized for online sharing retain very high quality, with slightly more compression than offline-optimized videos. The intended use case is uploading to YouTube, Vimeo, Instagram and similar social sharing platforms, that will usually transcode the video into different formats and resolutions for streaming. The moov atom is stored at the start. This will save you some time when uploading videos to YouTube, and speed up processing.

YouTube recommends placing moov at the start for faster processing, but this is not a hard requirement. You can still upload videos to YouTube with the moov atom at the end, it will just cause slightly longer initial processing time.

Self-hosting

Videos optimized for self-hosting are smallest in file size, to save you on bandwidth hosting costs. The indented use case is including directly in HTML5 video element on your web site, or adding the videos to a mobile application.

Videos optimizes for self-hosting are more compressed than the other use cases. To a human eye, there will be no visible difference in quality between this and the other options, but the video is not intended to be transcoded or reprocessed in other tools. The moov atom is at the start, allowing for faster startup time when hosting videos on your site.

How to set the optimization target for videos made from slides?

To set the optimization target in Presentation to Video projects, click the “Edit Settings” button after uploading the presentation, then scroll down to the “Optimize” option.

Select your intended use case, then click “Create Video”.

How to set the optimization target in scripted video?

To set the optimization target in Markdown to Video projects, use the target header. For up-to-date information on valid options, see the Target header formatting reference. For example, the header below creates a 720p resolution video optimized for self-hosting.

---
size: 720p
target: self-hosted
---

This video is optimized for self-hosting

What is the MOOV atom and why is it important?

An MP4 file contains a variety of data types, and these data types are stored in structures called “atoms” or “boxes.” One of these crucial atoms is the moov atom, which contains metadata needed to decode and play back the video. This metadata includes information like the timescale, duration, display dimensions, and references to the media tracks.

The moov atom can be placed at the start or at the end of the MP4 file.

When the atom is placed at the start (Fast Start or Web-optimized), the player can immediately access the necessary metadata to decode the video. Placing the moov atom at the beginning is useful for streaming and progressive download scenarios because players can start video playback without having to download the entire file first. This is helpful for online streaming platforms as they can start processing the video while you are uploading it, for videos hosted on websites, and any scenario where you want the viewer to start watching the video as soon as possible without waiting for the entire file to download. The downside is that the initial video creation takes longer, as the entire video needs to be created and saved before the metadata is calculated, then the file needs to be updated. This results in faster start times but longer creation times.

When the moov atom is placed at the end, initial video creation and processing is faster. When encoding a video, the size of the moov atom isn’t known until encoding completes. So, writing it at the end of the file is more straightforward. Editing and recording software usually places the moov atom at the end for this reason. The disadvantage is that the video cannot be processed until it is completely uploaded or downloaded. This can introduce a noticeable delay in start time for the viewer. Some browsers are smart enough to try loading the end of the file first if it is served from a web server that supports byte range requests, but generally there will be a longer delay at the start for online playing when the moov atom is at the end.