Skip to content

OTT (DASH/HLS) manifest manipulator server for subtitle generation (translate/transcribe)

License

Notifications You must be signed in to change notification settings

nirb999/easy-ott-subtitles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easy-ott-subtitles

OTT (DASH/HLS) automatic subtitles translator/transcriber. Suitable to VoD and Live OTT streams.

It is basically a manifest manipulator for HLS and DASH. It adds subtitle(s) track(s) to the origin manifest according to the URL parameters (see instructions below). It allows very easy intergation: no changes to the origin stream are needed, work is done on-the-fly. Original Video/Audio/Text tracks are directed to the origin server. Only added text tracks are served from easy-ott-subtitles server.

Currently using Google Cloud Translation and Speech-to-Text APIs.


Installation

  • Create virtual enviroment
$ virtualenv -p python3 venv
$ source venv/bin/activate
  • Install python dependencies
$ pip install -r requirements.txt
  • Install FFmpeg (used for transcribe only)
$ sudo apt-get install ffmpeg

Configuration

  • Configure Google Cloud service account key
  1. Generate service account key json file.
  2. Copy the file to folder 'google_key'
  3. Configure project id and service account key file path in ini file under GOOGLE_API:
[GOOGLE_API]
PROJECT_ID = <project_id>
SERVICE_ACCOUNT_FILE = google_key/<service_account_key_file_path>
  • Default port number is 8500. This can be changed in ini file under HTTP_SERVER:
[HTTP_SERVER]
EOS_HTTP_PORT_NUMBER = 8500

Usage

  • Start the server
$ python easy-ott-subtitles -c eos.ini

URL Generation

  • To consturct a playout URL, use this formula:
http://<server_ip_address>:<server_port_number>/eos/v1/<dash/hls>/<vod/live>/<translate/transcribe>/<source_language>/<origin_stream_url_base64>/eos_manifest.<m3u8/mpd>?languages=<destination_languages>&default=<default_language>

Example

Transcribe

Translate


HTTPS Server and Caching

This package is using python HTTP server. To make it suitable for production and enable HTTPS + caching for subtitle fragments, you can use Nginx with reverese proxy as the outbound HTTPS server, and enable content caching.

Releases

No releases published

Packages

No packages published

Languages