Last updated: September 18, 2024

<span aria-hidden="true" id="easily-burn-subtitles-into-videos-with-our-new-robot"></span>

# Easily burn subtitles into videos with our new Robot

![Samuel Ogundipe](/assets/images/teammates/samuel.png?dpl=dpl_6nhQNS5wkVkPZWuKMzXcWrAHNJL5)

**Samuel Ogundipe**

Technical Writer · Lagos, Nigeria · Show bio

[](https://github.com/samuelayo)

If you built a product, chances are you want people to know about it and start using it, too. And if you are in the business of selling something to consumers, placing video ads on websites is a very effective way to go about that.

When it comes to making video ads — and this of course holds true in general — the smallest things can often make the biggest difference. Even something as seemingly unimportant as adding subtitles to your video could be that thin line between a succesful and a failed advert.

Over time, it has been proven that advertisement videos with subtitles have[higher engagement rates⁠](https://www.bizreport.com/2017/02/video-ad-campaigns-with-subtitles-outperform-in-brand-awaren.html)compared to those without. With browsers often starting videos muted, captions are a great way to capture an audience's attention and get your message across.

Now, there are two ways to caption a video, you can use Closed Captions or Open Captions. Closed indicates that the captions are not visible until activated by the viewer. Open, "burned-in", "hard-coded", or "baked on" captions, on the other hand, are visible to all viewers at all times, and can't be disabled. The subtitles are made up of pixels in the actual video itself.

While there are many advantages to Closed Captions (the viewer can select their appropriate language or choose to opt out) there are also interesting use cases for open caption. A particular one I'd like to be focus on here is running advertisements in a scenario where you can't always rely on player compatibility, but you still want to make sure your message gets across.

Manually burning subtitles into a video can be a huge headache, especially if you have a large archive of videos to caption. Luckily, the team at Transloadit has your back! We are proud to present to you our brand-new and shiny [/video/subtitle](/docs/robots/video-subtitle.md) Robot.

Our [/video/subtitle](/docs/robots/video-subtitle.md) Robot can be used in combination with [other Robots](/services.md), to create powerful workflows unique to your use case.

![The subtitle Robot adding subtitles to a video.](/_next/static/immutable/media/opengraph-image.43s2t_jpz61pq.png)

<span aria-hidden="true" id="burning-subtitles-into-videos"></span>

## Burning subtitles into videos

If you want to burn subtitles into a video, the first step would be to provide both the video and the subtitle file to our Robot. While there is a plethora of ways to do this, I will demonstrate the following two:

* Using the [/http/import](/docs/robots/http-import.md) Robot
* Using the [/upload/handle](/docs/robots/upload-handle.md) Robot

<span aria-hidden="true" id="using-the-httpimport-robot"></span>

## Using the /http/import Robot

Let's look at how to burn subtitles into an example video using the[/http/import](/docs/robots/http-import.md) Robot.

To get started, we need a video and a subtitle file. If you do not have a subtitle file yet, create a file named `subtitle.srt` and add:

```srt
1
00:00:00,000 --> 00:00:22,000
Hi! : )
These subtitles were 'burned' into this video,
by supplying an SRT and an MP4 file to our /video/subtitle Robot.
Kind regards from Transloadit! : )

```

In the code block above, we have created subtitles that will run between the beginning of a video and the 22-second mark. Next, we will make the file available via a public URL, so our[/http/import](/docs/robots/http-import.md) Robot can import it.

Now we can create our Assembly Instructions, supplying both our video and subtitle files to be burned. Take a look at the Assembly Instructions below:

```json
{
  "steps": {
    "mp4_imported": {
      "robot": "/http/import",
      "url": "../../../../../../_assets/demos/inputs/surf.mp4"
    },
    "srt_imported": {
      "robot": "/http/import",
      "url": "https://s3.amazonaws.com/samuelo-testaws/subtitle.srt"
    },
    "subtitled": {
      "robot": "/video/subtitle",
      "preset": "ipad-high",
      "use": {
        "steps": [
          { "name": "mp4_imported", "as": "video" },
          { "name": "srt_imported", "as": "subtitles" }
        ]
      }
    },
    "exported": {
      "use": ["subtitled"],
      "robot": "/s3/store",
      "credentials": "s3_cred"
    }
  }
}

```

In the code block above, we have used the [/http/import](/docs/robots/http-import.md) Robot to import two different files, then declared a `subtitled` Step, where we specified which of the imported files is the video and which is the subtitle file, i.e., the[/video/subtitle](/docs/robots/video-subtitle.md) Robot's `use` parameter. Next, we export the results to our S3 bucket. The `s3_cred` refers to the Template Credentialsthat I have securely stored before, and contains both the bucket name and the access keys.

<span aria-hidden="true" id="using-the-uploadhandle-robot"></span>

## Using the /upload/handle Robot

Alternatively, we could be using the [/upload/handle](/docs/robots/upload-handle.md) Robot to get either the video or subtitle file to Transloadit. We do not define multiple upload points as the [/upload/handle](/docs/robots/upload-handle.md) Robot can handle multiple uploads in one instance. The files form different fields in a multipart upload. Because of this, in our `subtitled` Step, we need to define which fields contain our video and our subtitle file.

Here, our Assembly Instructions should look like this:

```json
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "subtitled": {
      "robot": "/video/subtitle",
      "preset": "ipad-high",
      "use": {
        "steps": [
          { "name": ":original", "fields": "video", "as": "video" },
          { "name": ":original", "fields": "subtitle", "as": "subtitles" }
        ]
      }
    },
    "exported": {
      "use": ["subtitled"],
      "robot": "/s3/store",
      "credentials": "s3_cred"
    }
  }
}

```

> "fields" within `use` filters are the input field by the `name` attribute. So, in order to make this work, we would need to add an `<input type="file" name="subtitle" />` to our form (and one with `name="video"`). For non-browser SDKs, this translates to adding files as follows:`transloadit.addFile('video', './file.mp4')`.

<span aria-hidden="true" id="viewing-results"></span>

## Viewing results

Here is what our video looked like before burning subtitles to it:

And here it is after burning subtitles:

<span aria-hidden="true" id="conclusion"></span>

## Conclusion

As I hope to have shown in this introduction, burning subtitles into video files doesn't have to be hard or time-consuming at all, when using our [/video/subtitle](/docs/robots/video-subtitle.md) Robot. With Transloadit, you never have to worry about dealing with FFmpeg, scaling a fleet of machines, or tying it into other media processing jobs. We've been perfecting that part for the past nine years, so you can focus on your business.

Happy burning! 🔥 And if you have questions, comments or concerns, do[let us know](mailto:support@transloadit.com)!

[#video-encoding-service](/blog/tags/video-encoding-service.md)[#video-subtitle-robot](/blog/tags/video-subtitle-robot.md)[#tutorial](/blog/tags/tutorial.md)[#upload-handle-robot](/blog/tags/upload-handle-robot.md)[#http-import-robot](/blog/tags/http-import-robot.md)

### 👩‍💻 Join 20k+ developers

Sign up for our [monthly newsletter](/newsletters.md) to receive direct links to 3 exclusive tech — and 2 product updates. No less, no more.

Your email:

Get access

## File uploading and encoding. Made simple.

Transloadit streamlines file handling for developers, trusted by brands like Coursera and The New York Times. We’re known for a reliable API, top-notch support, and a strong commitment to open source, with projects like [Uppy⁠](https://uppy.io) and [Tus⁠](https://tus.io) setting standards in file processing.

[Sign up](/c/)[Book a Demo](https://survey.typeform.com/to/kRg47Xi5)

No credit card needed · 5 GB included in the free plan

Cancel anytime
