Begin recording a stream after a transcoder has started

Learn how to use the REST API to record a live stream or transcoder after the transcoder has started in the Wowza Video™ service and how to programmatically download recordings.

This allows you to record only part of the stream. A common use case for this workflow is when you have a welcome slate before video content begins and you only want to record the video content.

Note: If you're a Wowza Video subscriber, recordings created using the recording parameter will not be available on the Asset Management page. If you want to mange your recording through asset management, set the save_asset parameter to true when creating a live stream. This will generate both a VOD stream and a recording.

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. Start the live stream
 

Endpoint Reference

curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/live_streams/[live_stream_id]/start"

2. Start recording
 

Note: 
  • When you initiate an API request to start recording, there is a delay of approximately 10 seconds before the first recorded video frames pass through the transcoder in Wowza Video. If you are watching the source live, you will need to allow a minimum of 10 seconds between the API request and live events that need to be captured in the stream recording.

Endpoint Reference

curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[live_stream_id]/start_recording"

The response indicates that video capture for recording has started. If you query for details of the live stream, the recording parameter remains set to false, even though the stream is being recorded.

{
  "transcoder": {
    "recording": {
      "state": "started"
    }
  }
}

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 "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[live_stream_id]/stop_recording"

Stop the live stream:

Endpoint Reference

curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/live_streams/[live_stream_id]/stop"

4. Get the recording

Wowza Video 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 "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[live_stream_id]/recordings"

Get all recordings for your account:

Endpoint Reference

curl -X GET \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/recordings"

Related requests


Transcoder Workflow

1. Start the transcoder

Endpoint Reference

curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[transcoder_id]/start"

2. Start recording
 


Note: 
  • When you initiate an API request to start recording, there is a delay of approximately 10 seconds before the first recorded video frames pass through the transcoder in Wowza Video. If you are watching the source live, you will need to allow a minimum of 10 seconds between the API request and live events that need to be captured in the stream recording.

Start recording:

Endpoint Reference

curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[transcoder_id]/start_recording"

The response indicates that video capture for recording has started. If you query for details of the live stream or transcoder, the recording parameter remains set to false, even though the stream is being recorded.

{
  "transcoder": {
    "recording": {
      "state": "started"
    }
  }
}

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 "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[transcoder_id]/stop_recording"

Stop the transcoder:

Endpoint Reference

curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/live_streams/[transcoder_id]/stop"

4. Get the recording

Wowza Video 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 "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[transcoder_id]/recordings"

Get all recordings for your account:

Endpoint Reference

curl -X GET \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/recordings"

Related requests