Manipulates URLs in manifest files of adaptive bitrate streams.
The Manifest Transformer service is part of the platform for media caching on trains. It replaces hostnames of URLs in manifest of adaptive bitrate video streams by the hostname of the media cache on the train. During precaching, requests for manifest files are forwarded to the Manifest Transformer by the Online Cache. The Manifest Transformer downloads the manifest from the upstream location and tranforms it before passig the result to the Online Cache, where it will be cached.
Provides a HTTP API which the Cache can redirect requests for manifest files to. Example call:
$ curl http://localhost:3004?url=https://www.example.com/manifest.m3u8
The Manifest Transformer downloads the respective document and applies a regular expression, which modifies the manifest so that all segment URLs point to the Offline Cache on the train (see: app.service.ts
). The result is send as a response to the callee.
Note: Typically you would use the up.sh
script from the Platform project to install, build and run this service as part of a composite of docker services. Read on if you intend to run the service directly on your host system.
Prerequestits: Following software needs to be installed on your host machine in order to execute the subsequent steps.
First, git clone
this project and change into its root directory. Than run the following command to install its dependencies:
$ npm install
You can than run the service in three different modes.
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
With following command you can build a docker image for this service. But again, typically you use the startup script up.sh
of the Platform project to do the job.
$ docker build -t 5gv-manifest-transformer:latest .