Begin recording when you start a transcoder

Learn how to use the REST API to record a live stream or transcoder in the Wowza Streaming Cloud™ service and how to programmatically download recordings.

Before you start


You should complete the following tasks:

  • Create a live stream or a transcoder. You'll need the resulting live_stream_id or transcoder_id to record a broadcast. View our Connect a source topics to learn how to create a live stream or transcoder for RTMP, RTSP, IP camera, SRT encoder, UDP encoder, WebRTC, and Wowza Streaming Engine.

You should be familiar with the following concepts:

Live Stream Workflow

1. Configure your live stream to record when it starts

You'll need to edit your live stream so that the recording parameter is set to true. You can skip this step if you set this parameter to true when you created the live stream.

Endpoint Reference

curl -H "wsc-api-key: ${WSC_API_KEY}" \
  -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
  -H "Content-Type: application/json" \
  -X "PATCH" \
  "${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]" \
  -d $'{
  "live_stream": {
    "recording": "true"
  }
}'

2. Start the live stream

Endpoint Reference

curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]/start"

3. Stop recording

You can stop the recording at any point before the live stream has ended or you can stop the live stream, which will end the recording.

Note: We recommend leaving the live stream running for 10 to 15 seconds after the end of the event. This ensures that the recording doesn't cut off prematurely.

Stop the recording:

Endpoint Reference

curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/stop_recording"

Stop the live stream:

Endpoint Reference

curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]/stop"

4. Get the recording

Wowza Streaming Cloud begins converting the recording to MP4 format when the transcoder stops, not necessarily when the recording stops. If the transcoder continues running after recording stops, you will need to wait until the transcoder stops to retrieve the recording.

Get all recordings for a specific transcoder:

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[live_stream_id]/recordings"

Get all recordings for your account:

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/recordings"

Next steps

If you want, you can configure nDVR so your viewers can play or pause a live stream, rewind it to a previously recorded point, or resume viewing at the current live point. See Configure nDVR using the Wowza Streaming Cloud REST API for more information.

Related requests


Transcoder Workflow

1. Configure your transcoder to record when it starts

You’ll need to configure the properties parameter. The section should be set to recording, the key to mp4, and the value to true. For more information, see Set advanced properties with the Wowza Streaming Cloud REST API.

Endpoint Reference

curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/properties"

{
  "property": {
    "recording": "mp4",
    "section": "recording",
    "value": "true"
  }
}

2. Start the transcoder.

Endpoint Reference

curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/start"

3. Stop recording

You can stop the recording at any point before the stream has ended or you can stop the transcoder, which will end the recording.

Note: We recommend leaving the transcoder running for 10 to 15 seconds after the end of the event. This ensures that the recording doesn't cut off prematurely.

Stop the recording:

Endpoint Reference

curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/stop_recording"

Stop the transcoder:

Endpoint Reference

 curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/stop"

4. Get the recording

Wowza Streaming Cloud begins converting the recording to MP4 format when the transcoder stops, not necessarily when the recording stops. If the transcoder continues running after recording stops, you will need to wait until the transcoder stops to retrieve the recording.

Get all recordings for a specific transcoder:

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/recordings"

Get all recordings for your account:

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/recordings"

Next steps

If you want, you can configure nDVR so your viewers can play or pause a live stream, rewind it to a previously recorded point, or resume viewing at the current live point. See Configure nDVR using the Wowza Streaming Cloud REST API for more information.

Related requests