Skip to content

Latest commit

 

History

History

vod-meta-server

Ephyr VOD meta server

Changelog

Simple HTTP server, which provides a meta information for kaltura/nginx-vod-module to play a scheduled VOD playlists. Each playlists schedules on weekly basis (see example).

New schedule may be specified via PUT HTTP request.

Also, supports background downloading of remote video files into a local files cache.

See ephyr-vod-meta-server --help for details.

REST API overview
GET /{format}/{playlist}/{file}

Generates meta information for kaltura/nginx-vod-module to play a scheduled VOD playlist starting from now.

GET /

Returns the whole current persisted state of this VOD meta server.

GET /{playlist}

Returns the current state of a single playlist persisted in this VOD meta server.

PUT /[?force=true][&dry_run=true] (authorized)

Renews the whole state of this VOD meta server.

If renewing breaks the current playback of any playlist, then an error will be returned. Providing a query parameter force=true will force-apply the new state regardless of a broken playback:

curl -X PUT -H "Authorization: Bearer qwerty" -H "Content-Type: application/json" \
     -d @vod.state.json http://127.0.0.1/vod-meta/?force=true
Example of state request

Requirements:

  • All weekdays in a single playlist should have at least one clip.
  • Duration of any clip should divide on its playlist's segment_duration without remainder.
  • All clips in a single weekday should have total duration less than 24 hours and represent a fraction of it.

Parameters:

  • segment_duration is optional (defaults to 10s);
  • resolutions is optional (defaults to empty);
  • anything other is mandatory.
{
  "divan-tv": {
    "title": "Divan TV",
    "lang": "eng",
    "tz": "+02:00",
    "segment_duration": "10s",
    "resolutions": [360, 720],
    "clips": {
      "mon": [
        {"from": "00:00:00", "to": "00:02:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"},
        {"from": "00:00:00", "to": "00:01:00", "title": "Truth of Life", "url": "https://www.youtube.com/watch?v=Q69gFVmrCiI"}
      ],
      "sun": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
      "tue": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
      "wed": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
      "thu": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
      "fri": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
      "sat": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}]
    }
  }
}
PUT /{playlist}[?force=true][&dry_run=true] (authorized)

Renews a single playlist in the current state of this VOD meta server.

If renewing breaks the current playlist's playback, then an error will be returned. Providing a query parameter force=true will force-apply the new playlist's state regardless of a broken playback:

curl -X PUT -H "Authorization: Bearer qwerty" -H "Content-Type: application/json" \
     -d @playlist.json http://127.0.0.1/vod-meta/divan-tv?force=true
Example of playlist request

Requirements:

  • All weekdays should have at least one clip.
  • Duration of any clip should divide on segment_duration without remainder.
  • All clips in a single weekday should have total duration less than 24 hours and represent a fraction of it.

Parameters:

  • segment_duration is optional (defaults to 10s);
  • resolutions is optional (defaults to empty);
  • anything other is mandatory.
{
  "title": "Divan TV",
  "lang": "eng",
  "tz": "+02:00",
  "segment_duration": "10s",
  "resolutions": [360, 720],
  "clips": {
    "mon": [
      {"from": "00:00:00", "to": "00:02:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"},
      {"from": "00:00:00", "to": "00:01:00", "title": "Truth of Life", "url": "https://www.youtube.com/watch?v=Q69gFVmrCiI"}
    ],
    "sun": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
    "tue": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
    "wed": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
    "thu": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
    "fri": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}],
    "sat": [{"from": "00:00:00", "to": "00:01:00", "title": "Life circle", "url": "https://www.youtube.com/watch?v=0wAtNWA93hM"}]
  }
}
DELETE /{playlist} (authorized)

Removes a single playlist from the current state of this VOD meta server.

Try it out

VOD meta info HTTP server

To boot up a simple example, run:

make up

Now, open an HLS or DASH stream in a VLC or any other media player supporting HTTP streaming:

http://localhost/hls/cnn-live/master.m3u8    # to play HLS stream
http://localhost/dash/cnn-live/manifest.mpd  # to play DASH stream

License

Ephyr is subject to the terms of the Blue Oak Model License 1.0.0. If a copy of the BlueOak-1.0.0 license was not distributed with this file, You can obtain one at https://blueoakcouncil.org/license/1.0.0.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.