• How to record a transcoder by using the Wowza Streaming Cloud REST API

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

    Note: Recordings stored in Wowza Streaming Cloud generate additional costs. Billing is based on your peak recording storage, which is the greatest amount of recorded content stored in a given month. You can check your peak recording storage in the Wowza Streaming Cloud manager or by using the API. See How to view usage data by using the Wowza Streaming Cloud REST API.

    Contents


    Record a live stream or transcoder
    Broadcast the live stream or transcoder
    Get the recording
    Related requests

    Record a live stream or transcoder


    1. Using the Wowza Streaming Cloud REST API, create a live stream or a transcoder that receives video from a source encoder and delivers the stream to a hosted page or the transcoded output to a target. For instructions, see the following tutorials:


    2. When you create the live stream or transcoder, set the recording parameter to true.

    3. Make note of the unique live_stream_id or transcoder_id that Wowza Streaming Cloud creates for your stream. You'll need it to start and stop the broadcast and to retrieve its recording.

    Broadcast the live stream or transcoder


    1. When your live stream or transcoder is fully configured and your event begins, use the PUT method to start the stream or transcoder.

      Note: In all code examples, for [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
      Start the live stream:

      curl -X PUT --header "Content-Type: application/json" --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/live_streams/[live_stream_id]/start"
      Start the transcoder:

      curl -X PUT --header "Content-Type: application/json" --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/transcoders/[transcoder_id]/start"
    2. When your event is finished, use the PUT method to stop the stream or transcoder.

      Stop the live stream:

      curl -X PUT --header "Content-Type: application/json" --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/live_streams/[live_stream_id]/stop"
      Stop the transcoder:

       curl -X PUT --header "Content-Type: application/json" --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/transcoders/[transcoder_id]/stop"

    Get the recording


    Wowza Streaming Cloud begins recording when the stream or transcoder starts, and ends the recording when the stream or transcoder stops or after eight hours, whichever occurs first.

    Get all recordings for a specific live stream or transcoder:

    curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/transcoders/[transcoder_id]/recordings"
    Note: Every stream's live_stream_id is also its transcoder_id.
    Get all recordings for your account:

    curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/recordings"

    Related requests


    View the state of the recording:

    curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/recordings/[recording_id]/state"
    Possible recording states are uploading, converting, removing, completed, and failed.

    View the details of the recording:

    curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/recordings/[recording_id]"
    Delete a recording:

    curl -X DELETE --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/v1/recordings/[recording_id]"

    Originally Published: 01-21-2016.
    Updated: 04-14-2016.

    If you're having problems or want to discuss this article, post in our forum.