# amazon-translate-subtitles

> Library for translating subtitles using Amazon Translate

Latest version **1.1.6** (published 2025-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install amazon-translate-subtitles
pnpm add amazon-translate-subtitles
yarn add amazon-translate-subtitles
bun add amazon-translate-subtitles
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2025-11-17 |
| First published | 2022-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0 |
| Dependencies | 6 |
| Unpacked size | 24.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ryan Sonshine |
| Maintainers | ryansonshine |
| Keywords | translate, subtitles, amazon translate, mkv subtitles |

## Links

- npm: https://www.npmjs.com/package/amazon-translate-subtitles
- Repository: https://github.com/ryansonshine/amazon-translate-subtitles
- Homepage: https://github.com/ryansonshine/amazon-translate-subtitles#readme
- Issues: https://github.com/ryansonshine/amazon-translate-subtitles/issues
- npm.io page: https://npm.io/package/amazon-translate-subtitles

## Dependencies (6)

- [p-limit](https://npm.io/package/p-limit.md) ^3.1.0
- [progress](https://npm.io/package/progress.md) ^2.0.3
- [file-type](https://npm.io/package/file-type.md) ^16.5.4
- [matroska-subtitles](https://npm.io/package/matroska-subtitles.md) ^3.3.2
- [lodash.defaultsdeep](https://npm.io/package/lodash.defaultsdeep.md) ^4.6.1
- [@aws-sdk/client-translate](https://npm.io/package/@aws-sdk/client-translate.md) ^3.209.0

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.1.6 (latest) — 2025-11-17
- 1.1.5 — 2025-11-17
- 1.1.4 — 2023-07-09
- 1.1.3 — 2023-07-09
- 1.1.2 — 2023-06-13
- 1.1.1 — 2023-01-09
- 1.1.0 — 2022-11-21
- 1.0.2 — 2022-11-16
- 1.0.1 — 2022-11-16
- 1.0.0 — 2022-11-16

## README

# amazon-translate-subtitles

[![npm package][npm-img]][npm-url]
[![Build Status][build-img]][build-url]
[![Downloads][downloads-img]][downloads-url]
[![Issues][issues-img]][issues-url]
[![Code Coverage][codecov-img]][codecov-url]
[![Commitizen Friendly][commitizen-img]][commitizen-url]
[![Semantic Release][semantic-release-img]][semantic-release-url]

> Translate subtitles embedded in video files using Amazon Translate

Currently supports mkv input and srt output.

## Install

```bash
npm install amazon-translate-subtitles
```

## Usage

```ts
import { translateSubtitles } from 'amazon-translate-subtitles';

const video = createReadStream('my-video.mkv');

const thaiSubs = await translateSubtitles({ video, targetLanguage: 'th' });
console.log(thaiSubs);
/*
"
1
00:00:03,549 --> 00:00:05,290
... ยักษ์ใหญ่แห่งโรดส์!

2
00:00:05,757 --> 00:00:06,678
ไม่!
"
*/
```

## API

### translateSubtitles(options)

#### options

Type: `object`

##### awsClientOverrides

Type: `object`

Default: `{}`

Configuration options passed to the AWS SDK Translate client as overrides.

##### showProgress

Type: `boolean`

Default: `false`

Turns the progress bar on or off.

##### sourceLanguage

Type: `string`

Default: `'en'`

Source language for translating the subtitles from.

##### sourceTrackType

Type: `string`

Default: `'auto'`

Source track type to select if multiple subtitle tracks of the same language are
available. Options are `auto`, `sdh`, and `forced`.

**Auto**: The library will attempt to grab the standard subtitles.

**SDH**: Subtitles designed for those who are deaf and hard of hearing.

**Forced**: Displayed when the video has a secondary language being spoken.

##### targetLanguage

Type: `string`

Target language for translating the subtitles to.

##### video

Type: `ReadStream`

Read Stream of the video file you would like to translate subtitles for.

## Related

- [amazon-translate-subtitles-cli][cli-url] - CLI for this module

[build-img]:https://github.com/ryansonshine/amazon-translate-subtitles/actions/workflows/release.yml/badge.svg
[build-url]:https://github.com/ryansonshine/amazon-translate-subtitles/actions/workflows/release.yml
[downloads-img]:https://img.shields.io/npm/dt/amazon-translate-subtitles
[downloads-url]:https://www.npmtrends.com/amazon-translate-subtitles
[npm-img]:https://img.shields.io/npm/v/amazon-translate-subtitles
[npm-url]:https://www.npmjs.com/package/amazon-translate-subtitles
[issues-img]:https://img.shields.io/github/issues/ryansonshine/amazon-translate-subtitles
[issues-url]:https://github.com/ryansonshine/amazon-translate-subtitles/issues
[codecov-img]:https://codecov.io/gh/ryansonshine/amazon-translate-subtitles/branch/main/graph/badge.svg
[codecov-url]:https://codecov.io/gh/ryansonshine/amazon-translate-subtitles
[semantic-release-img]:https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-release-url]:https://github.com/semantic-release/semantic-release
[commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen-url]:http://commitizen.github.io/cz-cli/
[cli-url]:https://github.com/ryansonshine/amazon-translate-subtitles-cli

---
_Source: https://npm.io/package/amazon-translate-subtitles · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
