Audio/Subtitle Streams

Reference for adding audio or/and subtitle tracks.

  • Audio Tracks: Allows delivering video with one or more audio streams in different languages.
  • Subtitle Tracks: Allows delivering video with one or more subtitle streams (refers to the text on the screen for translation purposes) in different languages.

Gumlet transcodes and delivers audio or/and subtitle streams present in the video container. In addition to that,
we also provide the functionality to add audio/subtitle streams into Gumlet for transcoding and delivery via API.

Audio stream file needs to be in any of the following formats: mp3, opus, flac, wav, ac3, m4a, aac.
Subtitles need to be either a SRT or WebVTT file.

These tracks can be added via Gumlet API using the additional_tracks parameter (in Create Asset POST request) which takes an array of Object with the following fields.

ParameterDescription
urlURL or web address of a file that Gumlet should download to add a stream.
typeType of additional track. Value can be either audio or subtitle.
language_codeThe language code value represents the BCP 47 specification compliant value. For example, en for English.
nameThe name of the track containing a human-readable description.

Except for the name field, all parameters are required.

curl -L -X POST 'https://api.gumlet.com/v1/video/assets' \
-H 'Authorization: Bearer <YOUR API KEY>' \
-H 'Content-Type: application/json' \
-d '{
    "input":"https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.mp4",
    "source_id": "5f462c1561cf8a766464ffc4",
    "format": "hls",
    "additional_tracks" : [
        {
            "url":"https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.aac",
            "type": "audio",
            "language_code": "en",
            "name": "English"
        }
    ]
}
{
    "asset_id": "61246ef47f0b8e419df0406a",
    "progress": 0,
    "created_at": 1629777652652,
    "status": "queued",
    "tag": [],
    "source_id": "5f462c1561cf8a766464ffc4",
    "input": {
        "transformations": {
            "format": "hls",
            "video_codec": [
                "libx264"
            ],
            "audio_codec": [
                "aac"
            ],
            "thumbnail": [
                "auto"
            ],
            "thumbnail_format": "png",
            "mp4_access": false,
            "per_title_encoding": true,
            "process_low_resolution_input": false,
            "keep_original": true,
            "audio_only": false
        },
        "source_url": "https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.mp4",
        "additional_tracks": [
            {
                "url": "https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.aac",
                "type": "audio",
                "language_code": "en",
                "name": "English"
            }
        ]
    },
    "output": {
        "format": "hls",
        "status_url": "https://api.gumlet.com/v1/video/assets/61246ef47f0b8e419df0406a",
        "playback_url": "https://video.gumlet.io/5f462c1561cf8a766464ffc4/61246ef47f0b8e419df0406a/1.m3u8",
        "thumbnail_url": [
            "https://video.gumlet.io/5f462c1561cf8a766464ffc4/61246ef47f0b8e419df0406a/thumbnail-1-0.png"
        ]
    }
}