Skip to main content

Automatic video captions

Finding caption files
Link copied!

You can access a published video caption file by adding "-captions-language" to the source video's file name. For example, the video seo-video.mp4 would have a VTT file with the name seo-video-captions-en-GB.

Note, that captions files use a different URL structure to videos. For example, the URL for the captions file seo-video-captions-en-GB on the account ampproduct would be https://cdn.c1.amplience.net/c/ampproduct/seo-video-captions-en-GB.

Each video can have only one "captions" profile applied. To apply a different captions profile, you must first remove a previously applied one.

To find captions files that have been created for specific videos use either:

  • The Content Hub search feature. For example, to find captions that have been generated for the file seo-video.mp4, search for seo-video-captions*. Note, the search is case sensitive.
  • The Media Delivery API to fetch the metadata for a video file using the format https://cdn.media.amplience.net/v/<COMPANY_NAME>/<VIDEO_NAME>.json?metadata=*. For example, https://cdn.media.amplience.net/v/ampproduct/seo-video.json?metadata=*

Using video captions
Link copied!

When making videos and their captions available to your audience:

  • Set the kind attribute to "captions". See HTML <track> tag
  • The srclang attribute must be a valid BCP 47 language tag. Note, this attribute is optional

For example:

<video controls width="100%"  protocol="https" poster="https://cdn.media.amplience.net/v/ampproduct/seo-video?protocol=https">
<source src="https://cdn.media.amplience.net/v/ampproduct/seo-video/mp4_720p?protocol=https"/>
<track
label="English"
kind="captions"
srclang="en"
src="https://cdn.c1.amplience.net/c/ampproduct/seo-video-captions-en-GB" />
<track>
</video>

Cross domain settings
Link copied!

If your application has strict security rules, you may wish to whitelist the captions domain: https://cdn.c1.amplience.net in your security policy and amend your <video> tag to have its crossorigin attribute set to anonymous.

Captions and credit usage
Link copied!

For automatic video captions, Amplience credits are charged from when you apply a caption generation profile to a video. Previewing captioned videos doesn't require any credits.

When you manually apply a "captions enabled" profile to a video in Content Hub, we first check your Amplience credit balance to ensure you have enough credits before generating the captions.

If you run out of credits while generating captions during a bulk upload, captions will continue to be created until all credits are used up. You can check the status of caption generation for bulk uploads from the "Tools > Activity" queue.

Read more about Amplience credits.

Media Delivery API reference