Tutorials · 3 min read

Lost in translation? Fill in the blanks with captions!

Unlock the full potential of your video content with api.video's user-friendly captioning feature. This guide introduces the seamless integration of captions into your videos hosted on api.video, utilizing the WebVTT format.

Zoltán

December 20, 2023

Add captions to your videos hosted at api.video using the standard WebVTT format and enable your audience to have seamless user experience regardless of their language or location. Captions also enable you to provide more inclusive and accessible content by inviting deaf or hard-of-hearing users into your audience.

How to upload captions

api.video offers a suite of dedicated API endpoints that can help you manage captions for your videos programmatically. You can also use the api.video Dashboard to upload captions directly to any of your videos.

Via the API

The /captions API endpoint enables you to manage captions for your videos. You can upload, update, get, list, and delete captions.

When uploading captions, you only need to include 3 attributes in a POST request to the Captions endpoint:

  • the videoId of the video that you want to add a caption to,
  • the language of the caption you want to upload,
  • and the path to the caption’s VTT file that you want to upload.

Via the Dashboard

If you need a quick no-code solution to upload captions to a video, check out your list of uploaded videos in the Dashboard. Open the Details page of the video that you want to add a caption to and click on the Captions tab to upload VTT caption files manually.

A screenshot of the api.video dashboard showing the Caption menu.

Selecting caption languages

When uploading captions via the API, you need specify the caption file’s language using IETF language tags. You can use primary subtags like en (English), extended subtags like fr-CA (French, Canada), or region subtags like zh-Hans-CN (Simplified Chinese used in the PRC). api.video's caption solution supports all major and minor languages, and even dialects.

Check out the documentation for a complete list of supported language tags.

What is WebVTT?

WebVTT is a standard format for displaying timed text tracks for captions or chapters. It is a text based format, which must be encoded using UTF-8. Here’s an example:

html

Check out the Mozilla developer guide for more information about WebVTT.

Best practices

  • When uploading a caption file, make sure that you use the standard VTT file format.
  • To ensure that you use the correct formatting in your VTT file, api.video recommends using a parser to check for errors before you upload the file. Click here for a free online VTT parser.
  • You can upload captions for one language, and to one video at a time.
  • api.video offers video player SDKs for the most popular platforms - and apart from the Flutter player, all of them support captions! Check out the Player SDKs to get started!

Next steps

Now that you understand how captions work at api.video, check out this earlier blog post about adding captions programmatically to your videos, or dive into the documentation to understand more about api.video’s solutions.

Try out more than 80 features for free

Access all the features for as long as you need.
No commitment or credit card required

Video API, simplified

Fully customizable API to manage everything video. From encoding to delivery, in minutes.

Built for Speed

The fastest video encoding platform. Serve your users globally with 140+ points of presence. 

Let end-users upload videos

Finally, an API that allows your end-users to upload videos and start live streams in a few clicks.

Affordable

Volume discounts and usage-based pricing to ensure you don’t exceed your budget.