Image & Video APIs

Why isn't the video duration shown during first playback of a transformed video?

Last updated: Apr-01-2026

Why this happens

When you apply a transformation to a video on the fly (for example, format conversion, cropping, resizing, or adding overlays), Cloudinary generates the transformed video in real time. The server streams the output progressively as it processes, rather than waiting for the entire video to be generated first.

Because the video is being created on the fly, the total file size and duration aren't known in advance. Without this metadata, the video player can't display the total duration or render an accurate seek bar. Instead, the elapsed time increments without a total length indicator.

This behavior occurs when a specific transformation is requested before Cloudinary has finished generating and caching that derived asset. Once the transformed video has been fully generated and cached, later requests for that same transformation usually include the full metadata and the duration displays normally.

Note
This is expected behavior for progressive playback of on-the-fly transformed videos and isn't a bug. You'll typically see it when the player relies on metadata from the delivered file, including direct playback in the Cloudinary Video Player, standard HTML5 <video> elements, and similar players.

How to fix it

If displaying the video duration from the start of playback is important for your use case, pre-generate the transformation instead of relying on on-the-fly processing.

Use eager transformations on upload

You can specify transformations to generate immediately when the video is uploaded, using eager transformations. This ensures the transformed version is fully processed and cached before anyone requests it.

For large videos, use the eager_async parameter to process the transformation in the background without blocking the upload response. For example:

See Eager asynchronous transformations for details.

Use the explicit method for existing assets

For videos that are already uploaded, use the explicit method to trigger transformation generation asynchronously:

Once the eager transformation completes, subsequent requests for that transformation URL serve the fully processed video with duration metadata.

Use notifications to know when processing is complete

You can use eager notification URLs to receive a webhook when the transformation finishes generating. This lets your application know exactly when the transformed video is ready to be served with full metadata.

When to expect this behavior

This issue occurs specifically when all of the following conditions are met:

  • The video has a transformation applied in the delivery URL (e.g., format conversion, resize, crop, overlay).
  • The specific transformation has not been generated before (it's not cached).
  • The video is being delivered as an on-the-fly generated progressive file.

It doesn't occur when:

  • The video is delivered without transformations (the original upload).
  • The transformation has already been generated and cached (second play onward, or after using eager transformations).
  • The video is delivered using adaptive bitrate streaming (HLS/MPEG-DASH). These protocols use manifest files that contain duration metadata, so the player doesn't depend on the video file being fully generated.

Related topics

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars