How to Create a Multi-Subtitles Task ?

1. Overview

This guide will walk you through the process of creating a multi-subtitles task using the provided API parameters. Multi-subtitles tasks allow you to include multiple subtitle tracks in your video output.

2. Prerequisites

Before proceeding, ensure you have the following:

  • Access to the API documentation.
  • Necessary permissions to create tasks.
  • Understanding of subtitle formats such as WebVTT and SRT.

3. Operation Steps

3.1 Step One: Input Configuration

  • Provide the URL of the video file you want to process in the "input" field.
  • Specify the desired output path in the "output" field.
  • Assign a unique identifier to the storage location in the "storage_id" field.
  • Choose a template for video encoding in the "template_name" field.

3.2 Step Two: Subtitles Configuration

  • Define the input sources for audio and caption tracks in the "extra_options" section.

3.2.1 Audio Selector Configuration

  • Configure audio selectors for each language track by specifying:
    • source_file: URL of the audio file.
    • source_type: Type of source (e.g., "track" or "file").
    • selector_name: Name of the audio selector.
    • codec: Audio codec (e.g., "aac").
    • bitrate: Bitrate of the audio track.
    • sample_rate: Sample rate of the audio track.
    • channels: Number of audio channels.
    • language_code: Language code of the audio track.
    • language_code_control: Language code control configuration.

3.2.2 Caption Selector Configuration

  • Configure caption selectors for each subtitle track by specifying:
    • source_file: URL of the subtitle file.
    • source_type: Type of source (e.g., "webvtt" or "srt").
    • selector_name: Name of the caption selector.

3.3 Step Three: Output Groups

  • Define output groups to organize audio and caption descriptions.

3.3.1 Audio Description Configuration

  • Specify audio descriptions for each language track within an output group, including:
    • selector_name: Name of the audio selector.
    • codec: Audio codec.
    • bitrate: Bitrate of the audio track.
    • sample_rate: Sample rate of the audio track.
    • channels: Number of audio channels.
    • group_id: Unique identifier for the audio group.
    • language_code: Language code of the audio track.
    • language_code_control: Language code control configuration.

3.3.2 Caption Description Configuration

  • Include caption descriptions for each subtitle track within an output group, specifying:
    • selector_name: Name of the caption selector.
    • language: Language of the subtitle track.
    • description: Description of the subtitle track.

4. Examples and Use Cases

Use Case 1: Creating a Multi-Subtitles Task with English, Tamil, and Telugu Subtitles

API Parameters:

{
"input": "https://example.com/sample_video.mp4",
"output": "output/sample_output.m3u8",
"storage_id": "unique_storage_id",
"template_name": "h264_hls_1080p",
"extra_options": {
"inputs": {
"audio_selector": [
{
"source_file": "https://example.com/audio/english.wav",
"source_type": "file",
"selector_name": "eng",
"codec": "aac",
"bitrate": 64000,
"sample_rate": "44.1k",
"channels": 2,
"language_code": "eng"
},
{
"source_file": "https://example.com/audio/tamil.wav",
"source_type": "file",
"selector_name": "tam",
"codec": "aac",
"bitrate": 64000,
"sample_rate": "44.1k",
"channels": 2,
"language_code": "tam"
},
{
"source_file": "https://example.com/audio/telugu.wav",
"source_type": "file",
"selector_name": "tel",
"codec": "aac",
"bitrate": 64000,
"sample_rate": "44.1k",
"channels": 2,
"language_code": "tel"
}
],
"caption_selector": [
{
"source_type": "webvtt",
"file_setting": {
"source_file": "https://example.com/captions/english.srt"
},
"selector_name": "eng"
},
{
"source_type": "webvtt",
"file_setting": {
"source_file": "https://example.com/captions/tamil.vtt"
},
"selector_name": "tam"
},
{
"source_type": "webvtt",
"file_setting": {
"source_file": "https://example.com/captions/telugu.vtt"
},
"selector_name": "tel"
}
]
},
"output_groups": [
{
"outputs": {
"audio_description": [
{
"selector_name": "eng",
"codec": "aac",
"bitrate": 64000,
"sample_rate": "44.1k",
"channels": 2,
"group_id": "english_group",
"language_code": "eng",
"language_code_control": "use_configured"
},
{
"selector_name": "tam",
"codec": "aac",
"bitrate": 64000,
"sample_rate": "44.1k",
"channels": 2,
"group_id": "tamil_group",
"language_code": "tam",
"language_code_control": "use_configured"
},
{
"selector_name": "tel",
"codec": "aac",
"bitrate": 64000,
"sample_rate": "44.1k",
"channels": 2,
"group_id": "telugu_group",
"language_code": "tel",
"language_code_control": "use_configured"
}
],
"caption_description": [
{
"selector_name": "eng",
"language": "en",
"description": "English"
},
{
"selector_name": "tam",
"language": "ta",
"description": "Tamil"
},
{
"selector_name": "tel",
"language": "te",
"description": "Telugu"
}
]
}
}
]
}
}

5. Frequently Asked Questions (FAQs)

Q: Can I include more than three subtitle tracks in a multi-subtitles task? A: Yes, you can add additional audio and caption selectors as needed in the input configuration.

Q: How do I ensure the correct alignment between audio and subtitle tracks? A: Make sure

to specify the language code for each audio and caption track, ensuring proper synchronization during playback.

Q: Is it possible to customize the bitrate and sample rate for audio tracks? A: Yes, you can adjust the bitrate and sample rate parameters according to your requirements in the audio description settings.

This user manual provides code examples for common use cases when creating multi-subtitles tasks using the provided API parameters. Follow the outlined examples to efficiently configure and generate tasks according to your requirements.