> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salad.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Captions Guide

> Learn how to generate and customize captions (SRT files) using Salad Transcription API. Discover how to obtain captions, understand our industry-standard formatting, and translate captions into multiple languages.

*Last Updated: November 18, 2024*

## Introduction

Salad Transcription API provides powerful features for generating captions in the SRT (SubRip Subtitle) format, which is
widely used for video subtitles and closed captions. Our service enables you to:

* **Generate SRT captions with industry-standard formatting**: We adhere to the standard of a maximum of **84 characters
  per caption** to ensure readability and compliance with broadcasting guidelines.
* **Intelligent caption segmentation**: Captions are broken at sentence boundaries whenever possible. If a sentence is
  too long, we break at punctuation marks, and as a last resort, at word boundaries to maintain the character limit.
* **Translate captions into multiple languages**: Enhance accessibility and reach by translating your captions into
  different languages using our LLM integration.

## SRT file

### Structure

Each subtitle has four parts in the SRT file.

* A numeric counter indicating the number or position of the subtitle.
* Start and end time of the subtitle separated by –> characters
* Subtitle text in one or more lines.
* A blank line indicating the end of the subtitle.

**Example of SRT**

```text theme={null}
1
00:00:00,400 --> 00:01:15,300
This is an example.

2
00:02:16,400 --> 00:03:25,300
This is an example of
a subtitle - 2nd subtitle.
```

### SRT Formatting Standards

* **Maximum 84 Characters per Caption:** Each caption line is limited to 84 characters to comply with industry standards
  and ensure optimal readability.
* **Caption Segmentation**

1. **Sentence Boundaries:** Captions are ideally broken at the end of sentences.
2. **Punctuation Marks:** If a sentence exceeds the character limit, we break at natural punctuation marks like commas
   or semicolons.
3. **Word Boundaries:** As a last resort, we break at word boundaries to stay within the character limit.

## Captions Features

### Generating SRT Captions

To generate SRT captions for your transcriptions, include the `"srt": true` parameter in your request.

**Example:**

```json theme={null}
"input": {
  "url": "https://example.com/path/to/file.mp3",
  "srt": true
}
```

**Example Response:**

```json theme={null}
{
  "output": {
    "text": "Hello, and welcome to our conference.",
    "srt_content": "1\n00:00:00,000 --> 00:00:05,000\nHello, and welcome to our conference.\n"
  }
}
```

### Translating SRT Captions

To translate your SRT captions into multiple languages, use the `"srt_translation"` parameter with a comma-separated
list of target languages.

**Supported languages for srt translation:**

* English
* French
* German
* Italian
* Portuguese
* Hindi
* Spanish
* Thai

**Example Request:**

```json theme={null}
"input": {
  "url": "https://example.com/path/to/file.mp3",
  "srt": true,
  "srt_translation": "spanish, portuguese"
}
```

**Note**: When using "srt\_translation", the original transcription and SRT content will be returned as normal, along
with the translated SRT files.

**Example Response:**

```json theme={null}
{
  "output": {
    "text": "Hello, and welcome to our conference.",
    "srt_content": "1\n00:00:00,000 --> 00:00:05,000\nHello, and welcome to our conference.\n",
    "srt_translation": {
      "Spanish": "1\n00:00:00,000 --> 00:00:05,000\nHola, y bienvenidos a nuestra conferencia.\n",
      "Portuguese": "1\n00:00:00,000 --> 00:00:05,000\nOlá, e bem-vindos à nossa conferência.\n"
    }
  }
}
```

The `srt_content` field contains the original SRT captions in the source language. The `srt_translation` object contains
the SRT captions translated into the specified languages.

**Full request example**

```json theme={null}
curl -X POST https://api.salad.com/api/public/organizations/{my-organization}/inference-endpoints/transcribe/jobs \
   -H "Salad-Api-Key: {your-api-key}" \
   -H "Content-Type: application/json" \
   -d '{
      "input": {
         "url": "https://example.com/path/to/file.mp3",
         "srt": true,
         "srt_translation": "spanish, portuguese, french"
      },
      "metadata": {
        "my-job-id": 1234
      }
    }'

```
