Translate subtitles embedded in video files using Amazon Translate
Currently supports mkv input and srt output.
npm install amazon-translate-subtitles
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
ไม่!
"
*/
Type: object
Type: object
Default: {}
Configuration options passed to the AWS SDK Translate client as overrides.
Type: boolean
Default: false
Turns the progress bar on or off.
Type: string
Default: 'en'
Source language for translating the subtitles from.
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.
Type: string
Target language for translating the subtitles to.
Type: ReadStream
Read Stream of the video file you would like to translate subtitles for.
- amazon-translate-subtitles-cli - CLI for this module