I have videos in different formats like AVI, MOV and MP4. I want to change the format of these videos to MP4 or something else that works in all browsers and apps. Is this possible to do in ImageKit? If yes, then how to change video format?
ImageKit allows you to convert videos in various formats (AVI, MOV, MP4, etc.) into a format compatible with all browsers and applications, ensuring smooth playback across different devices whether you upload them to the ImageKit Media Library or store them on an External Storage that is connected to ImageKit.
ImageKit provides two primary methods to optimize video format delivery:
Automatic Video Format Conversion
ImageKit automatically selects the best video format for each user by analyzing factors such as device capabilities, browser support, and your preferences.
Enabling Automatic Format Conversion
To enable this feature, activate the “Use best format for video delivery” setting in your ImageKit dashboard under the video settings.
Alternatively, you can use the URL-based transformation parameter f-auto
to optimize individual videos dynamically. This works similarly to the global setting but allows you to apply the transformation per video rather than system-wide.
Example URL:
https://ik.imagekit.io/demo/sample-video.mp4?tr=f-auto
In this case, if the original video is in mp4 format and if the requesting browser supports Webm, this feature will automatically deliver the video in Webm format.
Note: WebM is supported by approximately 97% of modern browsers. You can check detailed browser support here.
Learn how to optimize videos for web delivery using ImageKit
Forcing an Output Format
If you prefer to specify the output video format manually, ImageKit allows you to do so using URL-based transformation parameters.
How to Force a Specific Format
By appending the f
parameter to your video’s URL, you can convert a video to a preferred format. This ensures consistent delivery in the desired format, regardless of the user’s browser or device.
Example: Convert a Mp4 video to WebM
- Original mp4 Video:
https://ik.imagekit.io/demo/sample-video.mp4
- WebM Output Using ImageKit:
https://ik.imagekit.io/demo/sample-video.mp4?tr=f-webm
Note: For video transformation and optimization, ImageKit requires a .mp4
or .mov
extension in the URL. If your resource lacks this extension, add /ik-video.mp4
at the end of the URL to enable transformation.
Learn how to transform videos using the ImageKit.io URL-based transformation parameters