Last updated: May 29, 2024

<span aria-hidden="true" id="new-feature-auto-transcribe-videos-with-subtitles"></span>

# New feature: auto-transcribe videos with subtitles

![Charlie Macnamara](/assets/images/teammates/charlie.jpg?dpl=dpl_3fBRD5jmFtSDABLXGJJyXU1nVXf8)

**Charlie Macnamara**

Technical Writer & Support Engineer · Scotland · Show bio

We recently added a new feature to our [/speech/transcribe](/docs/robots/speech-transcribe.md) Robot enabling it to listen to human-spoken language and output SRT files. You can automatically use these files to caption media in video players. And thanks to Transloadit's LEGO-like composability, you can even burn these files straight into the videos themselves. Today, I'd like to show you just how to do that.

![/speech/transcribe Robot](/_next/static/immutable/media/opengraph-image.25c0hlpzovpu-.png)

AI is being used in more corners of life than you might expect and for a good reason, too. It can enhance the speed, precision, and effectiveness of human efforts dramatically. Still, the sheer number of data, data sanitization, and video cards required to train complex models can make AI seem intimidating, which may prohibit smaller companies from leveraging it. Transloadit is on a mission to put AI in the hands of more developers by making it that much easier to wield and create value with.

Over the years, we have released a [series](/blog/2020/02/tech-preview-of-cloudai-bots.md) of[AI-based Robots](/services/artificial-intelligence.md) that are simple plug and play. You won't need to spend a second on learning about or training AI models.

The AI Robot we'll be taking a look at today is our[/speech/transcribe](/docs/robots/speech-transcribe.md) Robot. This Robotcan read and automatically create text files from any audio or video file, negating the need to do any tedious transcribing yourself. It comes with additional benefits out the box, such as being compatible with many languages and having the option to leverage either Amazon or Google's AI with the simple switch of a single parameter. Transloadit handles all the implementation details under the hood and offers one interface that can be plugged into workflows where other Robotsjoin in and greatly enhance the value that these AI bots already provide. The sum becomes much more significant than its parts. Switching providers by changing three characters also allows you to quickly discover which of them serves your use case best. You don't need to worry about error handling or sending files with the proper codecs, bandwidths, etc. Transloadit handles all of this for you, and offers it as a service that can be wielded with a single declarative JSON recipe.

<span aria-hidden="true" id="getting-started"></span>

## Getting started

In this post, we will be combining our [/speech/transcribe](/docs/robots/speech-transcribe.md)and [/video/subtitle](/docs/robots/video-subtitle.md) Robots to transcribe human-spoken language inside a video and then burn the output right back into the video itself. While it is true that doing this by hand can sometimes yield better results, naturally, it is a costly and tedious process — to the degree where it is prohibitive to do at all. And for many purposes, we find our customers deem automatic transcription "good enough" while bringing costs down so drastically that transcribing videos becomes a compelling prospect to begin with.

One use case is sharing videos on social media, where it has been proven that videos with subtitles are much better at grabbing someone's attention than those without.

Often, the transcribed files are also indexed by something like ElasticSearch, by which videos become searchable. A search hit on any spoken word in the video will be returned instead of just hits on the video's title.

Below is the recipe we used to combine our two features. We call these Assembly Instructions to save in a Template in your account for safe re-use at any time. We'll run through each Step and then give it a whirl.

```json
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "transcribed": {
      "use": ":original",
      "robot": "/speech/transcribe",
      "provider": "gcp",
      "format": "srt",
      "result": true
    },
    "subtitled": {
      "use": {
        "bundle_steps": true,
        "steps": [
          {
            "name": ":original",
            "as": "video"
          },
          {
            "name": "transcribed",
            "as": "subtitles"
          }
        ]
      },
      "robot": "/video/subtitle",
      "ffmpeg_stack": "{{stacks.ffmpeg.recommended_version}}",
      "preset": "ipad-high",
      "result": true
    },
    "exported": {
      "use": ["subtitled", "transcribed"],
      "robot": "/s3/store",
      "credentials": "s3_cred"
    }
  }
}

```

Our first Step using the [/upload/handle](/docs/robots/upload-handle.md) Robot is for, well, handling our uploads. Who would've thought? This Stepallows you to upload your file. Do note, however, that we have many alternative Robotsavailable for [importing files](/services/file-importing.md).

Moving onto our second Step `"transcribed"`, in which our before-mentioned AI magic comes into play. We set up a provider parameter with the API value `"gcp"`, but you could also use the`"aws"` value. Additionally, we are required to set up a `format` parameter. Since we are trying to embed subtitles into a video, we have opted to use the `"srt"` format. Alternatively, you could use`"webvtt"`, but its benefits over `"srt"` won't be required for our use case.

You could export the SRT files separately so that you can overlay the captions in the video player. Still, in this case, we'll burn the generated subtitle into the initially uploaded video file using our [/video/subtitle](/docs/robots/video-subtitle.md) Robot. To merge the twoSteps, reference both the upload and the subtitle Steps within the[/video/subtitle](/docs/robots/video-subtitle.md) Robot's use parameter using the`use.steps[].as` naming syntax.

Finally, use the [/s3/store](/docs/robots/s3-store.md) Robot to export our results to Amazon S3. Like our first Step, though, this Step is very interchangeable as we offer many other [exporting options](/services/file-exporting.md).

![/video/subtitle Robot](/_next/static/immutable/media/opengraph-image.25c0hlpzovpu-.png)

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

## Testing

To test our Template, we thought we'd use a short clip from[David Attenborough⁠](https://en.wikipedia.org/wiki/David%5FAttenborough)'s phenomenal[Planet Earth⁠](https://www.bbc.co.uk/programmes/b006mywy) series.

As you can see, the Assembly was a success. Thanks to AI, we don't have to go through the laborious process of creating a subtitle file by hand.

This workflow can now be integrated into your web/mobile app, back-end service, or command-line utility via [20 convenient SDKs](/docs/sdks.md) like [Uppy⁠](https://uppy.io) or the[Go SDK](/docs/sdks/go-sdk.md), as well as directly via our [JSON REST API](/docs/api.md).

We look forward to hearing what you'll build with us. Do let us know on[Twitter⁠](https://twitter.com/transloadit)!

[#speech-transcribe-robot](/blog/tags/speech-transcribe-robot.md)[#video-subtitle-robot](/blog/tags/video-subtitle-robot.md)[#s3-store-robot](/blog/tags/s3-store-robot.md)[#upload-handle-robot](/blog/tags/upload-handle-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
