URL-based parameters to manipulate videos in real-time.
URL-endpoint transformation video path
These transformation parameters
w-300,h-300can be added in the URL as path params or as query parameters.
- Input video upto
300MBin size is supported for transformations. This limit can be adjusted based on your pricing plan.
- Video transformation happens asynchronously. ImageKit internally polls at a fixed interval of 5 seconds up to 3 times by default, i.e., 15 seconds. If the asset is not prepared by this time, ImageKit gives a 302 and serves the original video. You can change the polling attempt count setting from the dashboard to change this behavior.
Video polling attemts
Within a few seconds, optimized transformations are generated and stored in our caches. From that point onwards, we will serve the actual transformed video.
The following table lists the codecs that ImageKit supports in input for resizing and optimization.
Every new video transformation that has never been done before will contribute toward video processing units using the below definition. Subsequent views of the same video transformation only count towards bandwidth.
Video processing units used depends on output video duration and resolution:
- 1 second of SD video output = 1 unit
- 1 second of HD video output = 2 units
- 1 second of 4K video output = 4 units
- 1 second of 8K video output = 8 units
- 1 second of 16K video output = 16 units
- Adaptive bitrate streaming - This operation is equal to processing a 30 seconds SD resolution video. In addition, all generated representations are charged based on requested resolutions.
- Get thumbnail - This operation is equal to processing a 30 seconds SD resolution video.
We define resolutions in terms of total pixel count as the following.
Here are a few recommendations you should follow while using video API in a live environment.
Whether a video is optimized or transformed, a new video(s) is generated and saved internally by ImageKit. This process could take a few seconds, depending on the video duration, output format, and transformation parameters. Therefore, you should eagerly generate the transformation before using the video URL in a live environment to ensure it works as expected. It guarantees that all necessary transformations are prepared and ready to be served. This avoids unnecessary data transfer costs on your origin. You can listen to video webhook events to get updates on asset transformations.
ImageKit prepares a
mp4variant of the video to serve optimized video to your users. In a few cases, for specific input videos, the encoding could permanently fail for one or both formats. In this case, you will always get
200. Using such a URL in a live environment would result in repeated transformation attempts. This will unnecessarily increase origin data transfer at your end. To ensure that the video is ready in both formats, always fetch the same URL in both Chrome and Safari.