With multiple video formats to choose from, it often becomes a difficult task to ensure that the videos on a website are delivered in the right format. Also, it is not easy to encode videos in different codecs. ImageKit's automatic format conversion solves this problem.
Format Optimization is the process of delivering the best video format to the end-user while taking into account various factors such as requesting device capabilities, browser support for certain video formats, and your preferences. Ensuring the right format helps you reduce the size of the video and subsequently the playback time.
Today, the most common video codec is H.264. A typical
.mp4 video is usually encoded using H.264 encoder. Almost every device in existence supports this protocol and it’s common for use with online video. However, there are several other codecs available, including MPEG-2, HEVC, VP9, Quicktime, and WMV.
VP9 is an open and royalty-free video coding format developed by Google. It provides excellent compression and is supported by major browsers.
ImageKit chooses between H.264 and VP9 codec and delivers the video in the appropriate format automatically based on browser support.
The video URL remains the same, but the file is modified. This behavior is transparent for your users. The end result is a small video file and a faster playback time.
Automatic format optimization is on by default. You can enable or disable automatic format conversion from the ImageKit dashboard.
Select settings from the left main menu. Inside Videos, under optimization, toggle "Use best format for video delivery" option to enable or disable this feature.
If you disabled automatic format conversion in the global settings, you can still choose to use this feature for a particular request using
f-orig parameter to deliver video in the original input format.
You can use the
f parameter to override the format for a particular video request. The format that you specify in the
f parameter will take precedence over any global settings.
f-mp4 parameter e.g.
f-webm parameter e.g.