{"id":13618372,"url":"https://github.com/nirb999/easy-ott-subtitles","last_synced_at":"2025-04-14T10:31:46.430Z","repository":{"id":218011950,"uuid":"605637787","full_name":"nirb999/easy-ott-subtitles","owner":"nirb999","description":"OTT (DASH/HLS) manifest manipulator server for subtitle generation (translate/transcribe)","archived":false,"fork":false,"pushed_at":"2025-03-25T12:17:34.000Z","size":74,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T13:27:22.198Z","etag":null,"topics":["captions","hls-live-streaming","mpeg-dash","ott","python-dash","python-hls","speech-to-text","streaming","subtitles","translation","ttml","webvtt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nirb999.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-23T15:28:08.000Z","updated_at":"2025-03-25T12:17:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebf72e4f-bf36-49c8-a95f-3e72a87e0c77","html_url":"https://github.com/nirb999/easy-ott-subtitles","commit_stats":null,"previous_names":["nirb999/easy-ott-subtitles"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirb999%2Feasy-ott-subtitles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirb999%2Feasy-ott-subtitles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirb999%2Feasy-ott-subtitles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirb999%2Feasy-ott-subtitles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nirb999","download_url":"https://codeload.github.com/nirb999/easy-ott-subtitles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248862688,"owners_count":21173861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captions","hls-live-streaming","mpeg-dash","ott","python-dash","python-hls","speech-to-text","streaming","subtitles","translation","ttml","webvtt"],"created_at":"2024-08-01T20:01:59.721Z","updated_at":"2025-04-14T10:31:46.421Z","avatar_url":"https://github.com/nirb999.png","language":"Python","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# easy-ott-subtitles\nOTT (DASH/HLS) automatic subtitles translator/transcriber.\nSuitable to VoD and Live OTT streams.\n\nIt 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).\nIt allows very easy intergation: no changes to the origin stream are needed, work is done on-the-fly.\nOriginal Video/Audio/Text tracks are directed to the origin server. Only added text tracks are served from easy-ott-subtitles server.\n\nCurrently using Google Cloud Translation and Speech-to-Text APIs.\n\n* * *\n\n## Installation\n\n* Create virtual enviroment\n```bash\n$ virtualenv -p python3 venv\n$ source venv/bin/activate\n```\n\n* Install python dependencies\n```bash\n$ pip install -r requirements.txt\n```\n\n* Install FFmpeg (used for transcribe only)\n```bash\n$ sudo apt-get install ffmpeg\n```\n\n* For python 3.10, fix this in venv/lib/python3.10/site-packages/construct/core.py:\n```bash\n-import collections\n+#import collections\n+import collections.abc as collections\n```\n\n* * *\n\n## Configuration\n* Configure Google Cloud service account key\n1. Generate service account key json file.\n2. Copy the file to folder 'google_key'\n3. Configure project id and service account key file path in ini file under GOOGLE_API:\n```bash\n[GOOGLE_API]\nPROJECT_ID = \u003cproject_id\u003e\nSERVICE_ACCOUNT_FILE = google_key/\u003cservice_account_key_file_path\u003e\n```\n\n* Default port number is 8500.\nThis can be changed in ini file under HTTP_SERVER:\n```bash\n[HTTP_SERVER]\nEOS_HTTP_PORT_NUMBER = 8500\n```\n* * *\n\n## Usage\n\n* Start the server\n```bash\n$ python easy-ott-subtitles -c eos.ini\n```\n\n* * *\n\n## URL Generation\n\n* To consturct a playout URL, use this formula:\n```bash\nhttp://\u003cserver_ip_address\u003e:\u003cserver_port_number\u003e/eos/v1/\u003cdash/hls\u003e/\u003cvod/live\u003e/\u003ctranslate/transcribe\u003e/\u003csource_language\u003e/\u003corigin_stream_url_base64\u003e/eos_manifest.\u003cm3u8/mpd\u003e?languages=\u003cdestination_languages\u003e\u0026default=\u003cdefault_language\u003e\n```\n\n### Example\n\n#### Transcribe\n\n* Use a sample HLS test stream in English: \nhttp://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=m3u8-aapl)\n\n* This stream does not contain any subtitles which we can translate, so we nee to transcribe it.\n\n* Encoded stream URL to Base64: aHR0cDovL2Ftc3NhbXBsZXMuc3RyZWFtaW5nLm1lZGlhc2VydmljZXMud2luZG93cy5uZXQvOTE0OTI3MzUtYzUyMy00MzJiLWJhMDEtZmFiYTZjMjIwNmEyL0F6dXJlTWVkaWFTZXJ2aWNlc1Byb21vLmlzbS9tYW5pZmVzdChmb3JtYXQ9bTN1OC1hYXBsKQ==\n\n* Construct playout URL with English and German subtitles:\nhttp://127.0.0.1:8500/eos/v1/hls/vod/transcribe/en-US/aHR0cDovL2Ftc3NhbXBsZXMuc3RyZWFtaW5nLm1lZGlhc2VydmljZXMud2luZG93cy5uZXQvOTE0OTI3MzUtYzUyMy00MzJiLWJhMDEtZmFiYTZjMjIwNmEyL0F6dXJlTWVkaWFTZXJ2aWNlc1Byb21vLmlzbS9tYW5pZmVzdChmb3JtYXQ9bTN1OC1hYXBsKQ==/eos_manifest.m3u8?languages=en-US,de-DE\u0026default=en-US\n\n* You need to wait a bit (~30 seconds) before start playing, to let the transcribe service to get ahead with the Speech-to-Text process.\n\n#### Translate\n\n* Use a sample HLS test stream with English subtitles:\nhttp://sample.vodobox.com/planete_interdite/planete_interdite_alternate.m3u8\n\n* Encoded stream URL to Base64: \naHR0cDovL3NhbXBsZS52b2RvYm94LmNvbS9wbGFuZXRlX2ludGVyZGl0ZS9wbGFuZXRlX2ludGVyZGl0ZV9hbHRlcm5hdGUubTN1OA==\n\n* Construct playout URL with German Subtitles:\nhttp://127.0.0.1:8500/eos/v1/hls/vod/translate/en-US/aHR0cDovL3NhbXBsZS52b2RvYm94LmNvbS9wbGFuZXRlX2ludGVyZGl0ZS9wbGFuZXRlX2ludGVyZGl0ZV9hbHRlcm5hdGUubTN1OA==/eos_manifest.m3u8?languages=de-DE\u0026default=de-DE\n\n* * *\n\n## HTTPS Server and Caching\nThis package is using python HTTP server.\nTo 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.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirb999%2Feasy-ott-subtitles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnirb999%2Feasy-ott-subtitles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirb999%2Feasy-ott-subtitles/lists"}