Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Captions and Transcripts

No security coverage Under active development

Captions and Transcripts adds WebVTT caption tracks to Drupal video and audio media, puts them in core's own players and turns them into an accessible transcript. Nothing reaches visitors until a person with permission has reviewed it. An optional submodule drafts captions with a speech-to-text provider, for that review.

Status: Stable. 1.0.0 is the first release.

Why

Core's video and audio formatters output no <track> element, so a Drupal site cannot show captions in its own player without custom code, and nothing checks a caption file before visitors get it. Speech recognition gets words wrong, so captions need a person's check before they are published.

Captions for prerecorded video (WCAG 2.1 success criterion 1.2.2) are part of the level AA standard in the US Department of Justice's ADA Title II rule for state and local governments. After the 2026 extension, its dates are 26 April 2027 for entities with a population of 50,000 or more, and 26 April 2028 for smaller ones and special district governments. The module helps a site provide captions and transcripts; whether a site meets a particular law is a question for its own legal advice.

Features

Caption tracks and validation

  • A Caption track field for WebVTT (.vtt) files. Each track has a kind (captions, subtitles, descriptions or chapters), a language as a BCP 47 tag such as en, fr-CA or es-419, an optional label for the player's menu, and a switch to turn it on by default. The field uses private files by default when the site has them.
  • Every upload is parsed by the WebVTT specification's own parsing rules, so the cues it finds are the ones a browser keeps. Errors refuse the file, with line numbers: an unreadable timing line (naming a SubRip-style comma, or a SubRip file), text outside any cue, a < that swallows the words after it, a cue that ends before it starts, cues out of order, invalid UTF-8, no cues at all, and STYLE blocks that load anything. Files over 4 MB are refused unparsed.
  • Warnings, such as missing blank lines, unknown tags or settings and duplicate cue identifiers, are listed with the upload without refusing it. Caption files are checked again whenever the media item is validated on save, by the media form, JSON:API or REST.
  • At most one default track each for captions and subtitles, descriptions and chapters, and no two tracks of the same kind and language with the same label.

Review before visitors see it

  • A track is shown to visitors only once someone with the Review caption tracks permission has marked it reviewed. Uploads by anyone else start unreviewed; uploads by reviewers start reviewed unless the field is set otherwise.
  • Tracks waiting for review are left out of the player, the transcript and the download links, and the track route and file access refuse them to everyone but reviewers who may edit the media item. The reviewed flag is checked as a field constraint, so this holds for JSON:API and REST too.
  • A Captions tab on each media item previews the media with every track, drafts included, lists each track's cue count, time span, errors and warnings, edits cues as WebVTT text, and marks tracks reviewed or waiting for review. A track with errors cannot be marked reviewed.

Players and transcripts

  • The Video with captions and Audio with captions display formats are core's video and audio formats, with their settings, plus <track> elements for the reviewed tracks. Browsers do not draw captions for audio; there the tracks let the transcript follow playback.
  • Tracks are served from a route on the site as text/vtt, with X-Content-Type-Options: nosniff and a sandboxing Content-Security-Policy, so they work whatever the web server's MIME types say, and caption files on object storage need no CORS rules.
  • The Transcript format builds a transcript from the reviewed captions or subtitles track in the page's language, or the closest one. Captions are joined into paragraphs by speaker and pause (2 seconds by default), speaker names come from WebVTT voice tags, description tracks are interleaved as a descriptive transcript, and chapter tracks become headings. The heading text and level are settings.
  • Visitors can show and hide the transcript (on by default, starting hidden) with a native button; a hidden transcript uses hidden="until-found" where the browser supports it, so find-in-page still reaches it. Without JavaScript the transcript is shown.
  • Linked to a captioned player on the same page (on by default), each paragraph's time becomes a button that plays the media from that point, and the words being spoken are marked with aria-current="time".
  • Cue text never becomes markup: only italic, bold, underline, ruby and language spans are kept, and the transcript carries the track's language and writing direction.
  • Also: a Caption file links format for downloads of the reviewed tracks, a second Transcript format for a long text field written by hand, and caption fields on remote video (oEmbed) for a transcript and caption file links.

Setup, coverage and checks

  • Set up captions on a video, audio or remote video media type adds a caption field, its upload widget, the captioned player for file sources and a transcript below the media, on the default display. Steps already done are skipped.
  • A caption coverage report lists media with reviewed captions, with tracks waiting for review and with none, limited to media the user may view.
  • Status report entries for video and audio media types without a caption field, caption fields stored in public files, default displays that never output their captions, and the coverage counts.
  • Drush: captions-transcripts:validate checks a file and exits non-zero on errors; captions-transcripts:report with --fail-on=missing,draft,unconfigured fails a deploy check while media lack reviewed captions; captions-transcripts:setup sets up named media types, or all with --all.

AI drafting submodule

Captions and Transcripts AI (captions_transcripts_ai) drafts captions from a media item's audio through the AI module.

  • Any AI provider with the speech-to-text operation, called through the AI module. The module asks for WebVTT, timed segments or SRT, whichever the model offers, and splits long segments to a line length (42 characters by default) and lines per caption (2 by default) that you set.
  • Each draft is saved as a new captions track waiting for review, with a NOTE at the top saying it was made by speech recognition. Output that is not valid WebVTT is not saved, and a second draft in the same language waits until the first is reviewed or removed.
  • Drafts are requested on the Captions tab, now or at the next cron run, or with drush captions-transcripts:ai-draft. Optionally, off by default, a draft is queued for each new video or audio item that has no tracks. The queue pauses while the provider is rate limiting or out of quota.
  • The file size is checked against a limit you set (25 MB by default) before anything is sent; larger media get a message asking for a smaller audio-only file, which you can choose per media type. A provider that refuses the file as too large, or returns text without timing, also gets a plain message rather than a silent failure.

Requirements

  • Drupal 11.3 or later, or Drupal 12.
  • PHP 8.3 or later.
  • Core's Media and File modules.
  • Any database Drupal supports (MySQL or MariaDB, PostgreSQL, SQLite).
  • A private file system is recommended, so that tracks waiting for review cannot be downloaded by anyone who knows their address.
  • For the AI submodule: the AI module 1.5 or later, with a speech-to-text provider whose model returns timed output (WebVTT, SRT or timed segments), such as Whisper. On Drupal 12 it needs an AI release that supports Drupal 12.
  • Drush is optional, for the commands.

Installation

Install with Composer, then enable the module:

composer require drupal/captions_transcripts
drush en captions_transcripts

For AI drafts, also require the AI module and a provider, then enable captions_transcripts_ai. Then choose Set up captions for each video and audio media type, or run drush captions-transcripts:setup --all.

Configuration and permissions

Setup is an operation on each video, audio and remote video type under Administration » Structure » Media types (/admin/structure/media/manage/[type]/captions); after that, the field and its formats are under Manage fields and Manage display. Tracks are reviewed on the Captions tab of each media item (/media/[id]/captions). The coverage report is at Reports » Caption coverage (/admin/reports/captions), for users with core's Access media overview permission. The AI submodule's settings are at Administration » Configuration » Media » AI caption drafting (/admin/config/media/captions-transcripts-ai).

  • Review caption tracks (restricted): see tracks waiting for review, edit their cues and mark them reviewed, which shows them to visitors. The Captions tab also needs edit access to the media item. Editors without this permission can still upload tracks; their uploads wait for review.
  • Administer AI caption drafting (restricted, AI submodule): choose the speech-to-text provider, the file size limit, the audio field per media type, the caption line limits and whether new media are drafted automatically. Each draft is a paid provider call.
  • Request AI caption drafts (not restricted, AI submodule): ask for a draft on the Captions tab of a media item, which also needs Review caption tracks and edit access to the item.

Setting up a media type needs core's Administer media types permission, and with Field UI enabled also the permissions to administer media fields, display and form display.

What it does not cover

Live captions (WCAG 1.2.4) are out of scope: the module is for recorded media. Browsers do not speak description tracks, so where a narrated audio description is required (WCAG 1.2.5), it still has to be in the video itself. YouTube and Vimeo play in the provider's player, which cannot load tracks from the site, so captions in that player are managed at the provider; the site can still show a transcript and caption file links, and its times do not control that player. Cues are edited as WebVTT text, not in a cue-by-cue editor with a waveform. In public file storage, a track waiting for review is never linked from a page but can still be downloaded by anyone who knows its address; the status report warns about this.

Similar projects

Checked on drupal.org in November 2026.

  • Able Player integrates an accessible media player that supports captions and transcripts. Choose it if you want that player. This module extends core's own video and audio formatters, validates caption files on upload and holds every track for review.
  • YouTube Video Transcript shows transcripts for YouTube videos. It has releases only for Drupal 8 and is marked unsupported.
  • We found no other current drupal.org project that adds caption tracks to core's video output.

Support and maintenance

Report bugs and ask for features in the issue queue. Each release has notes describing what changed.

This project is not covered by Drupal's security advisory policy. Until it is, security issues are handled in the public issue queue and fixed in ordinary releases.

A read-only mirror is on GitHub at DanePete/drupal-captions-transcripts; development and issues stay on drupal.org.

Maintainer

Created and maintained by deadnorth (Dead North).

Drupal 11 · not 10 PHP >=8.3

Ask your assistant about Captions and Transcripts

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • file Drupal core
  • media Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Dec 2026
Latest release
1 hour ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.0 Stable 11 PHP >=8.3 Dec 2, 2026