How do I record streams for VOD playback?
Recording assets is built into the Phenix platform. We provide a simple workflow for recording streams for subsequent VOD playback.
You can easily try creating an asset using the Portal's publishing feature.
on-demand capability, click on the Permalink, and start publishing.
To create a VOD asset from a real-time stream that has already started publishing, see Recording an Existing Stream.
Recording a New Stream
To create a VOD asset from a real-time Phenix stream, include
on-demand in the
capabilities of the publishing token.
To require a token when viewing or downloading the VOD asset, include the
capability in the publishing token. Users that do not include a valid token when trying to view or
download the asset will receive a 401 Unauthorized response.
When publishing a real-time stream with the
on-demand capability, Phenix will also create a VOD
asset as a chunked HLS and DASH stream which is stored in perpetuity or until it is explicitly
deleted by the customer.
The asset will be availble for viewing or downloading after publishing ends. To view content during publishing, use replay.
You can directly access the playlists by fetching the playlist URL from our API to integrate playback with your own player.
Alternatively, you can use the same subscribing mechanism as for our real-time streams. In this case, you would need to know the stream id (which can be obtained from the ExpressPublisher object via a getter).
Recording an Existing Stream
In most cases, creation of a VOD asset starts at the time of publishing, using the
on-demand publishing capability as shown above.
If you wish to turn VOD capture on and off for an existing stream , use the
Start Transcoding and
Stop Transcoding APIs.
To start and stop VOD recordings:
Note the streamId that you wish to record. This can be obtained by subscribing to notifications or from the API response to the publish-uri method.
Determine what asset type is desired (DASH or HLS) and any other options such as quality.
Send a POST request to the
/pcast/transcodingendpoint as shown in the API documentation. Note the
transcodingIdreturned by the API call.
To end capture of the VOD asset, send a DELETE request to the
/pcast/transcoding/<urlEncodedTranscodingId>endpoint as shown using the
transcodingIdreturned in the previous step.