# Subtitles and captions

> SRT and WebVTT files, and subtitle streams inside the video.

Subtitles need no dubbing: a transcription, optionally translations, and subtitle outputs.

## Subtitle files in several languages

English SRT, Spanish SRT and French WebVTT for every input:

```json
{
  "name": "Lectures — subtitles",
  "config": {
    "sourceMedia": { "@type": "S3FolderSource" },
    "transcription": { "@type": "Speechmatics", "language": "en" },
    "translations": [
      { "language": "es", "engine": { "@type": "DeepL" } },
      { "language": "fr", "engine": { "@type": "Google" } }
    ],
    "outputs": [
      {
        "@type": "S3FolderOutput",
        "items": [
          { "@type": "SubtitleFile", "format": "SRT", "language": "en" },
          { "@type": "SubtitleFile", "format": "SRT", "language": "es" },
          { "@type": "SubtitleFile", "format": "VTT", "language": "fr" }
        ]
      }
    ]
  }
}
```

`lecture-01.mp4` gives `lecture-01.en.srt`, `lecture-01.es.srt` and `lecture-01.fr.vtt`. The
default name is `${name}.${lang}.${ext}`; set `nameTemplate` for another.

A cue where the speaker changes starts with `>>`. To use another mark, or none, see
[Speaker changes](/vod-express/configuration/outputs#speaker-changes).

## A transcript only

```json
{
  "name": "Interviews — transcripts",
  "config": {
    "sourceMedia": { "@type": "S3FolderSource" },
    "transcription": { "@type": "Speechmatics", "language": "en" },
    "outputs": [
      {
        "@type": "S3FolderOutput",
        "items": [
          { "@type": "SubtitleFile", "format": "TXT", "language": "en" },
          { "@type": "SubtitleFile", "format": "SRT", "language": "en" }
        ]
      }
    ]
  }
}
```

## Subtitle streams inside the video

Selectable subtitles in the MP4, with the input's own audio. The item, in the `S3FolderOutput`'s
`items`:

```json
{
  "@type": "VideoFile",
  "ext": "mp4",
  "nameTemplate": "${name}.subs.${ext}",
  "useOriginalTracks": true,
  "subTracks": [
    { "language": "en" },
    { "language": "es" }
  ]
}
```

In Matroska, set `"subtitleCodec": "subrip"` on each track.

## Subtitles with a dub

Subtitles and dubs combine in one project: a translation with `ttsOptions` can feed both a dub
track and a subtitle output.

```json
"outputs": [
  {
    "@type": "S3FolderOutput",
    "items": [
      {
        "@type": "VideoFile", "ext": "mp4", "nameTemplate": "${name}.es.${ext}",
        "useOriginalTracks": true,
        "dubTracks": [{ "language": "es", "title": "Spanish" }],
        "subTracks": [{ "language": "es" }]
      },
      { "@type": "SubtitleFile", "format": "SRT", "language": "es" }
    ]
  }
]
```
