Asset API > Video API

Video API

DatoCMS natively supports video encoding and streaming, thanks to the integration with Mux, the fastest and most advanced cloud encoding platform for on-demand streaming video.

Every video you upload to your DatoCMS project will be instantly available for streaming. We can ingest almost every available codec, including those for broadcast and professional applications like H.264, H.265, VP9, and Apple ProRes.

Thanks to HLS Adaptive Bitrate (ABR) streaming, every viewer will always download the right video size for their device and connection speed from the nearest CDN node.

Prefer using YouTube streaming instead?

No problem! We also support integrations with embedded videos from YouTube/Vimeo/Facebook as a special field type you can add to your models and blocks.

Uploading videos

You can upload videos in the same way you upload regular assets. Through the interface, you can access some metadata related to the video, and you'll have the ability to preview it instantly:

You can add a video to your models using the Single Asset or Asset Gallery fields.

What gets exposed via API

From your application, you can obtain everything you need to generate a video player through the API, as well as any thumbnails and other metadata. Take a look at the documentation of our Content Delivery API for all the details.

DatoCMS also offers <VideoPlayer /> components for React, Vue, and Svelte, making it easy to display a fully-featured video with captions, multiple audio tracks, and timeline hover previews using data retrieved from the API.

Subtitles, closed captions, additional audio tracks

With every video you upload, you can make your content more accessible and reach a global audience with subtitles, closed captions, and extra audio tracks.

After you've uploaded a video, and it's been processed correctly (i.e. you see the thumbnail and can play the preview), head over to the "Additional audio tracks and subtitles" section to upload both alternate audio tracks (in M4A, MP3, or WAV format) and subtitles (in SRT or VTT format).

Auto-generated captions

We offer the option to automatically generate closed captions for your video directly from its audio using speech recognition and machine learning. All you need to provide is the language of your video and the description to display in the player.

The transcription quality is usually pretty good, but since it's machine-generated, we recommend double-checking the results, particularly when used with suboptimal audio recordings.

If you want to make adjustments, you can download the generated subtitles in .vtt format by clicking on the icon next to the subtitles name, make your changes, and then re-upload the file.

Feature limited to recently added videos

The option to automatically generate captions is only available for videos uploaded in the last 7 days.

Stream videos in 4K

Available only on Enterprise plans

As of today, 4K video streaming is only available upon request for Enterprise plans. If you want it enabled for your account, you'll need to reach out to our team.

If you upload a video with a resolution that exceeds 1080p, and have the "4K Video Streaming" feature enabled on your plan, the video player will be able to serve higher resolution streaming for your viewers (2K/1440p or 4k/2160p). The video player selects the best video resolution based both on the density of the screen and the actual size of the player in the page, so it will only serve these higher resolutions when supported.

In case you want to limit this case, you can stop providing streaming for a video above a certain resolution by using a max_resolution query parameter to the regular Playback URL. This modifies the resolution options available for the player to select from:

https://stream.mux.com/{PLAYBACK_ID}.m3u8?max_resolution=1080p

The max_resolution parameter can be set to 720p, 1080p, 1440p, or 2160p.

Pricing and availability

Integration with Mux is offered across all DatoCMS packages, each incorporating a generous amount of encoding/streaming minutes into the cost.

If you're subscribed to a paid plan and exceed your quota, your website will not experience any service disruption. At the end of the month, we'll bill you for any additional usage.

If your plan has 4K video streaming enabled, it will have an additional cost - actual seconds of videos delivered in a resolution higher than 1080p will be charged with a 3x multiplier on DatoCMS due to the higher costs that Mux applies in this case (read more).

What happens if you downgrade or cancel your subscription?

Videos will be kept for 60 days after the subscription ends. After that, we'll delete the videos. If you then change your mind and reactivate the project, you will need to re-upload the videos.

This behavior is particular to videos, as they can be very big and expensive to retain. This does not apply to other assets or data in general.

Explore more!

To gain a comprehensive understanding of videos and video optimization in DatoCMS, take a look at this video tutorial: