Skip to content

VOD and playout

Playout turns a list of stored files into a live channel, the way a broadcaster runs a schedule. Viewers see one continuous stream, not a series of videos.

Terminal window
curl -b jar -X POST \
http://localhost:9001/api/v1/apps/default/vod/bunny \
--data-binary @bunny.mp4

After upload the file is conditioned: normalised so it can be joined to other items without artefacts at the seams. An asset is not playable until this finishes. Check progress with GET /api/v1/apps/default/vod, which reports whether each asset is ready.

To condition everything outstanding in one go:

Terminal window
curl -b jar -X POST http://localhost:9001/api/v1/apps/default/vod-prepare-all
Terminal window
curl -b jar -X POST http://localhost:9001/api/v1/apps/default/playlists \
-H 'content-type: application/json' \
-d '{
"name": "evening",
"items": ["bunny", "sintel", "tears"],
"repeat": true,
"ads": ["promo-a", "promo-b"],
"ad_every": 2
}'

repeat loops the list forever, which is what a 24/7 channel wants. ad_every inserts an ad break after every N items, drawn from ads.

Check before you go live, not after:

Terminal window
curl -b jar \
http://localhost:9001/api/v1/apps/default/playlists/evening/preflight

It reports missing items, assets that are not conditioned yet, and anything else that would interrupt the channel.

Terminal window
curl -b jar -X POST \
http://localhost:9001/api/v1/apps/default/playlists/evening/go-live \
-H 'content-type: application/json' -d '{"stream_name":"channel1"}'

The channel is now a normal live stream. Watch it at /watch/default/channel1, or take the HLS playlist. Every viewer sees the same point in the schedule, exactly like broadcast.

Terminal window
# What is on air, what is next, and whether an ad is playing
curl -b jar http://localhost:9001/api/v1/apps/default/streams/channel1/now-playing
# Cut to the next item
curl -b jar -X POST http://localhost:9001/api/v1/apps/default/streams/channel1/skip

Each item is played by its own decoder pass, carrying a timestamp offset so the next item continues where the last one stopped. The result is a single monotonic timeline across the whole playlist, which is what keeps players from resetting at every boundary. Item transitions are marked with a discontinuity, so players are told to expect new encoding parameters.