Live Streaming API

How to authenticate

All live streaming API methods, except /v1/access_token, require a bearer-type Authorization header containing an access token. To acquire an access token you should call /v1/access_token API method described below.

Passing Authorization header with cURL:

curl -X $HTTP_METHOD -H "Authorization: Bearer $ACCESS_TOKEN" https://api-live.qencode.com/v1/$OBJECT

All requests must be made over HTTPS.

Getting Access Token

POST
/v1/access_token/<api_key>

Qencode requires API keys to generate access tokens that are used to authenticate all of your live stream requests. To get an access_token, you must provide your API key in the authorization header of the request.

You can view and manage the API keys associated with your projects inside of your Qencode Account.

Access token is valid for 24 hours.

warning
Caution
To build a secure solution we strongly recommend that you DO NOT call this method directly from any client application as you will expose your api key publicly. We recommend you first obtain an access token from your server and then pass to the client app.
Arguments

For live-streaming, an API key is assigned to each Project created in your Qencode account. After logging into your account, you can manage your API keys on the Live Streaming Projects page, as well as track the usage of each Project on the Statistics page.

Returns

After API key authentication is complete, you will receive this session based token, which can be used to call all other live streaming API methods.

Request Example

Replace the 'your_api_key' value below with your API key. You can find you API key in your Live Streaming Project within your account.

curl -X POST https://api-live.qencode.com/v1/access_token/your_api_key
Response Example

Token returned should be passed in Authorization header to all other live streaming API methods described below

{
 "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyjpYXQiOjE2MjgxNTgyNJMsInN1YiI6MTMwLCJleHAiOjE2MjgyNDQ2NjN9.SxS3zLx2CZbZ9ylTpd25kj9el6_4TqqTWUA9RT2iJ9I"
}

Creating a Live Stream

POST
/v1/live-streams

You can use your access token to create a live stream, and receive all the information you need to start streaming and playback.

You can pass optional JSON data containing stream params.

Returns

The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.

Input Objects Structure
Attributes
Live stream name can be passed as an optional parameter when a stream is created.
The input format for the stream. Defaults to rtmp. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
The output format for the stream. Defaults to hls.
The maximum time transcoder waits for the input stream before it's auto-stopped. Defaults to 120 seconds. In case stream_timeout is specified for a stream and its value is greater 120 seconds, stream in idle or waiting state is billed same way as for live state.

The fully qualified domain name for the live stream playback.

You should create a domain for playback first using the content delivery API or Content Delivery section in the portal UI.

Output Objects Structure
Attributes
The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
Attributes
Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
Attributes
You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
Attributes
In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
Attributes

Specifies the output url path to a folder in your bucket.

Example: s3://example.com/bucket/video-files/.

Supported storage prefixes are:

  • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
  • b2:// - for Backblaze B2
  • azblob:// - for Azure Blob Storage
  • ftp:// or ftps:// - for any FTP server
  • sftp:// - for any FTP over SSH server
    to be described....
    to be described....

    For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

    Specify 'public-read' value in order to make output video publicly accessible.

    Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

    Possible values: 'original', 'transcoded' or 'auto' (default).

    • original - system tries to record the original ingested stream
    • transcoded - records the highest available transcoded resolution
    • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

    Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

    Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

    In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

    You can also record all transcoded streams by specifying 'all' as value for resolution.

    Possible values: 'mp4' (default), 'ts' or 'hls'.

    Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

    You can also specify a list of output formats, e.g. ['mp4', 'hls'].

    Specifies maximum duration of a recorded video file.

    In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

    Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

    Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

    Available types of server URLs:

    • rtmp
    • webrtc
    • srt

    You only can use one URL at a time.

    RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

    Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
    An array of playback IDs for the stream. Each playback ID has the following attributes:
    Attributes
    A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
    A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
    The date and time when the playback ID was created.
    Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
    Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
    Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
    Live stream name can be passed as an optional parameter when a stream is created.
    Whenever a stream is created, a timestamp is recorded for future reference.
    Attributes

    See possible status values description below.

    createdA new stream has just been created.
    startingAllocating transcoding resources to process live streaming.
    waitingTranscoder is ready and waiting for input stream.
    launchingInput stream is being transcoded, but waiting for output stream to begin playback.
    liveThe stream is currently live.
    idleInput stream was stopped. Transcoder is ready and waiting for input stream.
    stoppingThe live stream is stopping.
    stoppedThe live stream has stopped.
    Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
    Request Example
    curl -X POST 'https://api-live.qencode.com/v1/live-streams' \ 
    -H 'Authorization: Bearer $ACCESS_TOKEN' \ 
    -H 'Content-Type: application/json' \ 
    --data-raw '{"name": "test-stream-name", "input_format": "rtmp", "output_format": "hls"}'
    Response Example
    {
      "stream": {
        "id": "12345fcd-7aea-492c-b9eb-b4b0cde0dc7e",
        "server_urls": {
          "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
        },
        "status": {
          "timestamp": "2021-08-28 17:59:33",
          "name": "created"
        },
        "name": "test-stream-name",
        "playback_ids": [
          {
            "policy": "public",
            "created": "2021-08-28 17:59:33",
            "id": "Av22X1p8h5",
            "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
          }
        ],
        "created_at": "2021-08-28 17:59:33",
        "stream_key": "12345be3-7590-4efa-b476-d99e7757b8c4",
        "params": {
          "output_format": "hls",
          "callback_url": null,
          "framerate": 0,
          "mode": "auto",
          "input_format": "rtmp"
        }
      }
    }

    Getting a Live Stream Data

    GET
    /v1/live-streams/<stream_id>

    Gets a live stream information.

    Returns
    The stream object along with all of it's attributes, originally created with the /v1/live-streams method. See stream output objects structure.
    Output Objects Structure
    Attributes
    The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
    Attributes
    Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
    Attributes
    You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
    The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
    The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
    Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
    Attributes
    In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
    Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
    Attributes

    Specifies the output url path to a folder in your bucket.

    Example: s3://example.com/bucket/video-files/.

    Supported storage prefixes are:

    • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
    • b2:// - for Backblaze B2
    • azblob:// - for Azure Blob Storage
    • ftp:// or ftps:// - for any FTP server
    • sftp:// - for any FTP over SSH server
      to be described....
      to be described....

      For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

      Specify 'public-read' value in order to make output video publicly accessible.

      Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

      Possible values: 'original', 'transcoded' or 'auto' (default).

      • original - system tries to record the original ingested stream
      • transcoded - records the highest available transcoded resolution
      • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

      Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

      Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

      In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

      You can also record all transcoded streams by specifying 'all' as value for resolution.

      Possible values: 'mp4' (default), 'ts' or 'hls'.

      Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

      You can also specify a list of output formats, e.g. ['mp4', 'hls'].

      Specifies maximum duration of a recorded video file.

      In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

      Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

      Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

      Available types of server URLs:

      • rtmp
      • webrtc
      • srt

      You only can use one URL at a time.

      RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

      Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
      An array of playback IDs for the stream. Each playback ID has the following attributes:
      Attributes
      A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
      A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
      The date and time when the playback ID was created.
      Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
      Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
      Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
      Live stream name can be passed as an optional parameter when a stream is created.
      Whenever a stream is created, a timestamp is recorded for future reference.
      Attributes

      See possible status values description below.

      createdA new stream has just been created.
      startingAllocating transcoding resources to process live streaming.
      waitingTranscoder is ready and waiting for input stream.
      launchingInput stream is being transcoded, but waiting for output stream to begin playback.
      liveThe stream is currently live.
      idleInput stream was stopped. Transcoder is ready and waiting for input stream.
      stoppingThe live stream is stopping.
      stoppedThe live stream has stopped.
      Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
      Request Example
      curl -H "Authorization: Bearer $ACCESS_TOKEN" 
       -X GET https://api-live.qencode.com/v1/live-streams/12345fcd-7aea-492c-b9eb-b4b0cde0dc7e
      Response Example
      {
        "stream": {
          "id": "12345fcd-7aea-492c-b9eb-b4b0cde0dc7e",
          "server_urls": {
            "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
          },
          "status": {
            "timestamp": "2021-08-28 17:59:33",
            "name": "created"
          },
          "name": "test-stream-name",
          "playback_ids": [
            {
              "policy": "public",
              "created": "2021-08-28 17:59:33",
              "id": "Av22X1p8h5",
              "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
            }
          ],
          "created_at": "2021-08-28 17:59:33",
          "stream_key": "12345be3-7590-4efa-b476-d99e7757b8c4",
          "params": {
            "output_format": "hls",
            "callback_url": null,
            "framerate": 0,
            "mode": "auto",
            "input_format": "rtmp"
          }
        }
      }

      Listing Live Streams

      GET
      /v1/live-streams

      Gets a list of user live streams.

      Returns
      In case no filter specified, contains list of all user live streams.
      Request Example
      curl -H "Authorization: Bearer $ACCESS_TOKEN" 
       -X GET https://api-live.qencode.com/v1/live-streams
      Response Example
      {
        "streams": [
          {
            "id": "7297653f-5a79-4c58-9dbd-972141822b59",
            ...
      
          },
          {
            "id": "e09066ca-b200-4b67-bf37-122137f31f8a",
            ...
          }
          ...
        ]
      }
      

      Starting a live stream

      POST
      /v1/live-streams/<stream_id>/start

      Prepares system for live stream ingest.

      Sends a message to the system so it can allocate a transcoder for the stream.

      You must call this method when starting a stream with WebRTC or SRT input. WebRTC and SRT Server URLs are returned in server_urls array in stream data.

      For RTMP input format calling this method is optional, but helps to minimize the time for stream to get live.

      Returns

      Updated live stream object.

      Output Objects Structure
      Attributes
      The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
      Attributes
      Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
      Attributes
      You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
      The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
      The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
      Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
      Attributes
      In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
      Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
      Attributes

      Specifies the output url path to a folder in your bucket.

      Example: s3://example.com/bucket/video-files/.

      Supported storage prefixes are:

      • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
      • b2:// - for Backblaze B2
      • azblob:// - for Azure Blob Storage
      • ftp:// or ftps:// - for any FTP server
      • sftp:// - for any FTP over SSH server
        to be described....
        to be described....

        For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

        Specify 'public-read' value in order to make output video publicly accessible.

        Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

        Possible values: 'original', 'transcoded' or 'auto' (default).

        • original - system tries to record the original ingested stream
        • transcoded - records the highest available transcoded resolution
        • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

        Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

        Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

        In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

        You can also record all transcoded streams by specifying 'all' as value for resolution.

        Possible values: 'mp4' (default), 'ts' or 'hls'.

        Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

        You can also specify a list of output formats, e.g. ['mp4', 'hls'].

        Specifies maximum duration of a recorded video file.

        In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

        Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

        Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

        Available types of server URLs:

        • rtmp
        • webrtc
        • srt

        You only can use one URL at a time.

        RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

        Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
        An array of playback IDs for the stream. Each playback ID has the following attributes:
        Attributes
        A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
        A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
        The date and time when the playback ID was created.
        Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
        Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
        Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
        Live stream name can be passed as an optional parameter when a stream is created.
        Whenever a stream is created, a timestamp is recorded for future reference.
        Attributes

        See possible status values description below.

        createdA new stream has just been created.
        startingAllocating transcoding resources to process live streaming.
        waitingTranscoder is ready and waiting for input stream.
        launchingInput stream is being transcoded, but waiting for output stream to begin playback.
        liveThe stream is currently live.
        idleInput stream was stopped. Transcoder is ready and waiting for input stream.
        stoppingThe live stream is stopping.
        stoppedThe live stream has stopped.
        Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
        Request Example
        curl -H "Authorization: Bearer $ACCESS_TOKEN" 
         -X POST https://api-live.qencode.com/v1/live-streams/$STREAM_ID/start
        Response Example
        {
          "stream": {
            "id": "12345fcd-7aea-492c-b9eb-b4b0cde0dc7e",
            "server_urls": {
              "rtmp": "rtmp://rtmp-live.qencode.com/qlive",
              "webrtc": "wss://live-df6607d4-8867-4a30-906d-0fed54e58f97.qencode.com:3334/qlive/534ce5b1-dfd7-4daa-8121-bc5c68bbeb37?direction=send&transport=tcp",
              "srt": "srt://live-df6607d4-8867-4a30-906d-0fed54e58f97.qencode.com:9999?streamid=534ce5b1-dfd7-4daa-8121-bc5c68bbeb37"
            },
            "status": {
              "timestamp": "2021-08-28 17:59:33",
              "name": "waiting"
            },
            "name": "test-stream-name",
            "playback_ids": [
              {
                "policy": "public",
                "created": "2021-08-28 17:59:33",
                "id": "Av22X1p8h5",
                "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
              }
            ],
            "origin_host": "live-df6607d4-8867-4a30-906d-0fed54e58f97.qencode.com",
            "created_at": "2021-08-28 17:59:33",
            "stream_key": "12345be3-7590-4efa-b476-d99e7757b8c4",
            "params": {
              "output_format": "hls",
              "callback_url": null,
              "framerate": 0,
              "mode": "auto",
              "input_format": "rtmp"
            }
          }
        }

        Stopping a live stream

        POST
        /v1/live-streams/<stream_id>/stop

        Stops a live stream.

        Sends a message to the system so it can free transcoding resources. Calling this method is optional, stream is automatically stopped in case a timeout of 120 seconds is reached when waiting for the input stream.

        Returns

        Updated live stream object.

        Output Objects Structure
        Attributes
        The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
        Attributes
        Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
        Attributes
        You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
        The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
        The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
        Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
        Attributes
        In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
        Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
        Attributes

        Specifies the output url path to a folder in your bucket.

        Example: s3://example.com/bucket/video-files/.

        Supported storage prefixes are:

        • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
        • b2:// - for Backblaze B2
        • azblob:// - for Azure Blob Storage
        • ftp:// or ftps:// - for any FTP server
        • sftp:// - for any FTP over SSH server
          to be described....
          to be described....

          For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

          Specify 'public-read' value in order to make output video publicly accessible.

          Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

          Possible values: 'original', 'transcoded' or 'auto' (default).

          • original - system tries to record the original ingested stream
          • transcoded - records the highest available transcoded resolution
          • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

          Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

          Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

          In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

          You can also record all transcoded streams by specifying 'all' as value for resolution.

          Possible values: 'mp4' (default), 'ts' or 'hls'.

          Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

          You can also specify a list of output formats, e.g. ['mp4', 'hls'].

          Specifies maximum duration of a recorded video file.

          In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

          Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

          Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

          Available types of server URLs:

          • rtmp
          • webrtc
          • srt

          You only can use one URL at a time.

          RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

          Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
          An array of playback IDs for the stream. Each playback ID has the following attributes:
          Attributes
          A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
          A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
          The date and time when the playback ID was created.
          Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
          Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
          Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
          Live stream name can be passed as an optional parameter when a stream is created.
          Whenever a stream is created, a timestamp is recorded for future reference.
          Attributes

          See possible status values description below.

          createdA new stream has just been created.
          startingAllocating transcoding resources to process live streaming.
          waitingTranscoder is ready and waiting for input stream.
          launchingInput stream is being transcoded, but waiting for output stream to begin playback.
          liveThe stream is currently live.
          idleInput stream was stopped. Transcoder is ready and waiting for input stream.
          stoppingThe live stream is stopping.
          stoppedThe live stream has stopped.
          Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
          Request Example
          curl -H "Authorization: Bearer $ACCESS_TOKEN" 
           -X POST https://api-live.qencode.com/v1/live-streams/$STREAM_ID/stop
          Response Example
          {
            "stream": {
              "id": "12345fcd-7aea-492c-b9eb-b4b0cde0dc7e",
              "server_urls": {
                "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
              },
              "status": {
                "timestamp": "2021-08-28 17:59:34",
                "name": "stopping"
              },
              "name": "test-stream-name",
              "playback_ids": [
                {
                  "policy": "public",
                  "created": "2021-08-28 17:59:33",
                  "id": "Av22X1p8h5",
                  "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
                }
              ],
              "created_at": "2021-08-28 17:59:33",
              "stream_key": "12345be3-7590-4efa-b476-d99e7757b8c4",
              "params": {
                "output_format": "hls",
                "callback_url": null,
                "framerate": 0,
                "mode": "auto",
                "input_format": "rtmp"
              }
            }
          }

          Updating a live stream

          PUT
          /v1/live-streams/<stream_id>

          Updates a live stream.

          You can pass stream params as attributes of JSON object in request data. All params are optional, at least one should be specified.

          Returns

          Updated live stream object.

          Input Objects Structure
          Attributes

          URL of an endpoint on your server to handle task callbacks.

          See Receiving Callbacks.

          The input format for the stream. Defaults to rtmp. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
          The output format for the stream. Defaults to hls.
          Attributes

          In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.

          Enabling or disabling DVR during streaming is supported.

          Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
          Attributes

          Specifies the output url path to a folder in your bucket.

          Example: s3://example.com/bucket/video-files/.

          Supported storage prefixes are:

          • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
          • b2:// - for Backblaze B2
          • azblob:// - for Azure Blob Storage
          • ftp:// or ftps:// - for any FTP server
          • sftp:// - for any FTP over SSH server
            Your access key for S3 bucket, or username for FTP server
            Your secret key for S3 bucket, or password for FTP server

            For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

            Specify 'public-read' value in order to make output video publicly accessible.

            Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

            Possible values: 'original', 'transcoded' or 'auto' (default).

            • original - system tries to record the original ingested stream
            • transcoded - records the highest available transcoded resolution
            • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

            Specifies a list of referer domains allowed for stream playback. Can be used to limit playback for a certain domain or list of domains. Wildcards in domain names are supported.

            Please note, this is not a strong secure solution to control stream access since http referer value can be easily changed.

            Specify an empty array to reset the setting. Dynamic changing of allowed referer domains during streaming is not supported and will take an effect during next stream launch.

            The maximum time transcoder waits for the input stream before it's auto-stopped. Defaults to 120 seconds. In case stream_timeout is specified for a stream and its value is greater 120 seconds, stream in idle or waiting state is billed same way as for live state.
            Output Objects Structure
            Attributes
            The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
            Attributes
            Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
            Attributes
            You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
            The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
            The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
            Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
            Attributes
            In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
            Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
            Attributes

            Specifies the output url path to a folder in your bucket.

            Example: s3://example.com/bucket/video-files/.

            Supported storage prefixes are:

            • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
            • b2:// - for Backblaze B2
            • azblob:// - for Azure Blob Storage
            • ftp:// or ftps:// - for any FTP server
            • sftp:// - for any FTP over SSH server
              to be described....
              to be described....

              For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

              Specify 'public-read' value in order to make output video publicly accessible.

              Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

              Possible values: 'original', 'transcoded' or 'auto' (default).

              • original - system tries to record the original ingested stream
              • transcoded - records the highest available transcoded resolution
              • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

              Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

              Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

              In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

              You can also record all transcoded streams by specifying 'all' as value for resolution.

              Possible values: 'mp4' (default), 'ts' or 'hls'.

              Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

              You can also specify a list of output formats, e.g. ['mp4', 'hls'].

              Specifies maximum duration of a recorded video file.

              In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

              Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

              Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

              Available types of server URLs:

              • rtmp
              • webrtc
              • srt

              You only can use one URL at a time.

              RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

              Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
              An array of playback IDs for the stream. Each playback ID has the following attributes:
              Attributes
              A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
              A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
              The date and time when the playback ID was created.
              Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
              Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
              Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
              Live stream name can be passed as an optional parameter when a stream is created.
              Whenever a stream is created, a timestamp is recorded for future reference.
              Attributes

              See possible status values description below.

              createdA new stream has just been created.
              startingAllocating transcoding resources to process live streaming.
              waitingTranscoder is ready and waiting for input stream.
              launchingInput stream is being transcoded, but waiting for output stream to begin playback.
              liveThe stream is currently live.
              idleInput stream was stopped. Transcoder is ready and waiting for input stream.
              stoppingThe live stream is stopping.
              stoppedThe live stream has stopped.
              Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
              Request Example
              curl -X PUT 'https://api-live.qencode.com/v1/live-streams/$STREAM_ID' \ 
              -H 'Authorization: Bearer $ACCESS_TOKEN' \ 
              --data-raw '{"name": "test-stream-update1", "input_format": "webrtc", "output_format": "cmaf", 
              "dvr": {
                "enabled": 1,
                "destination": {
                  "url": "s3://us-west.s3.qencode.com/bucketname/path/to/dvr_output",
                  "key": "ABCDE12345",
                  "secret": "ABCDEFGH12345678",
                  "permissions": "public-read"
                }
              }}'
              Response Example
              {
                "stream": {
                  "id": "73bfd689-777b-48fb-97f5-ded39b8b0d50",
                  "name": "test-stream-update1",
                  "quality": "LIVE SD",
                  "status": {
                    "timestamp": "2021-12-01 17:24:04",
                    "name": "stopped"
                  },
                  "playback_ids": [
                    {
                      "policy": "public",
                      "created": "2021-08-28 17:59:33",
                      "id": "Av22X1p8h5",
                      "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
                    }
                  ],
                  "created_at": "2021-10-17 08:09:00",
                  "server_urls": {
                    "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
                  },
                  "params": {
                    "input_format": "webrtc",
                    "output_format": "cmaf",
                    "framerate": "30",
                    "mode": "auto",
                    "callback_url": null,
                    "dvr": {
                      "enabled": 1,
                      "destination": {
                        "url": "s3://us-west.s3.qencode.com/bucketname/path/to/dvr_output",
                        "key": "ABCDE12345",
                        "secret": "ABCDEFGH12345678",
                        "permissions": "public-read"
                      }
                    }
                  }
                }
              }

              Deleting a live stream

              DELETE
              /v1/live-streams/<stream_id>

              Deletes a live stream.

              Live stream must be stopped before deleting.

              Returns

              Stream status will be 'deleted' for a successful operation.

              Date and time the stream status changed to 'deleted'.

              Request Example
              curl -H "Authorization: Bearer $ACCESS_TOKEN" 
               -X DELETE https://api-live.qencode.com/v1/live-streams/$STREAM_ID
              Response Example
              {
                "status": {
                  "timestamp": "2021-08-28 17:59:34",
                  "name": "deleted"
                }
              }

              Adding a playback ID to a live stream

              POST
              /v1/live-streams/<stream_id>/playback-ids

              Adds a playback ID to a stream

              You should pass playback policy as an attribute of JSON object in request data.

              You can add multiple playback IDs to a same stream if necessary.

              Returns

              Updated live stream object.

              Input Objects Structure
              Attributes

              Playback policy should be either 'public' or 'authenticated'.

              Public playback IDs does not require any authentication.

              Playback IDs with authenticated policy require a JWT token provided in 'auth' param in playback URL query string.

              Output Objects Structure
              Attributes
              The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
              Attributes
              Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
              Attributes
              You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
              The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
              The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
              Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
              Attributes
              In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
              Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
              Attributes

              Specifies the output url path to a folder in your bucket.

              Example: s3://example.com/bucket/video-files/.

              Supported storage prefixes are:

              • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
              • b2:// - for Backblaze B2
              • azblob:// - for Azure Blob Storage
              • ftp:// or ftps:// - for any FTP server
              • sftp:// - for any FTP over SSH server
                to be described....
                to be described....

                For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

                Specify 'public-read' value in order to make output video publicly accessible.

                Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

                Possible values: 'original', 'transcoded' or 'auto' (default).

                • original - system tries to record the original ingested stream
                • transcoded - records the highest available transcoded resolution
                • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

                Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

                Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

                In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

                You can also record all transcoded streams by specifying 'all' as value for resolution.

                Possible values: 'mp4' (default), 'ts' or 'hls'.

                Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

                You can also specify a list of output formats, e.g. ['mp4', 'hls'].

                Specifies maximum duration of a recorded video file.

                In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

                Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

                Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

                Available types of server URLs:

                • rtmp
                • webrtc
                • srt

                You only can use one URL at a time.

                RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

                Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
                An array of playback IDs for the stream. Each playback ID has the following attributes:
                Attributes
                A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
                A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
                The date and time when the playback ID was created.
                Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
                Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
                Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
                Live stream name can be passed as an optional parameter when a stream is created.
                Whenever a stream is created, a timestamp is recorded for future reference.
                Attributes

                See possible status values description below.

                createdA new stream has just been created.
                startingAllocating transcoding resources to process live streaming.
                waitingTranscoder is ready and waiting for input stream.
                launchingInput stream is being transcoded, but waiting for output stream to begin playback.
                liveThe stream is currently live.
                idleInput stream was stopped. Transcoder is ready and waiting for input stream.
                stoppingThe live stream is stopping.
                stoppedThe live stream has stopped.
                Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
                Request Example
                curl -X POST 'https://api-live.qencode.com/v1/live-streams/$STREAM_ID/playback-ids' \ 
                -H 'Authorization: Bearer $ACCESS_TOKEN' \ 
                --data-raw '{
                 "url": "rtmp://a.rtmp.youtube.com/live2",
                 "stream_key": "1234-5678-abcd-efgh-3cm6"
                }'
                Response Example
                {
                  "stream": {
                      "status": {
                          "timestamp": "2023-06-02 13:19:40",
                          "name": "created"
                      },
                      "name": "Stream_N3B47YML",
                      "stream_key": "a49c85c5-513a-4cea-8c66-f98e2019aab0",
                      "created_at": "2023-06-02 13:19:40",
                      "server_urls": {
                          "rtmps": "rtmps://rtmp-live.qencode.com/qlive",
                          "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
                      },
                      "params": {
                          "input_format": "rtmp",
                          "output_format": "hls",
                          "framerate": 0,
                          "mode": "auto",
                          "callback_url": null,
                          "dvr": {
                              "max_file_duration": 14400,
                              "destination": null,
                              "enabled": false,
                              "stream_source": "auto",
                              "format": "mp4"
                          }
                      },
                      "playback_ids": [
                          {
                              "policy": "public",
                              "created": "2023-06-02 13:19:40",
                              "id": "Av22X1p8h5",
                              "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
                          },
                          {
                              "policy": "authenticated",
                              "id": "5yxn1iz6vj4g",
                              "playback_url": "https://play-5yxn1iz6vj4g.qencode.com/qhls/qlive/playlist.m3u8",
                              "created": "2023-06-02 16:15:54"
                          }
                      ],
                      "id": "92727a3d-5b14-491d-9479-a9269d8e76e1"
                  }
                }

                Removing a playback ID from a live stream

                DELETE
                /v1/live-streams/<stream_id>/playback-ids/<playback_id>

                Removes a playback ID from stream.

                Returns

                Updated live stream object.

                Output Objects Structure
                Attributes
                The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
                Attributes
                Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
                Attributes
                You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
                The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
                The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
                Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
                Attributes
                In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
                Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
                Attributes

                Specifies the output url path to a folder in your bucket.

                Example: s3://example.com/bucket/video-files/.

                Supported storage prefixes are:

                • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
                • b2:// - for Backblaze B2
                • azblob:// - for Azure Blob Storage
                • ftp:// or ftps:// - for any FTP server
                • sftp:// - for any FTP over SSH server
                  to be described....
                  to be described....

                  For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

                  Specify 'public-read' value in order to make output video publicly accessible.

                  Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

                  Possible values: 'original', 'transcoded' or 'auto' (default).

                  • original - system tries to record the original ingested stream
                  • transcoded - records the highest available transcoded resolution
                  • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

                  Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

                  Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

                  In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

                  You can also record all transcoded streams by specifying 'all' as value for resolution.

                  Possible values: 'mp4' (default), 'ts' or 'hls'.

                  Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

                  You can also specify a list of output formats, e.g. ['mp4', 'hls'].

                  Specifies maximum duration of a recorded video file.

                  In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

                  Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

                  Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

                  Available types of server URLs:

                  • rtmp
                  • webrtc
                  • srt

                  You only can use one URL at a time.

                  RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

                  Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
                  An array of playback IDs for the stream. Each playback ID has the following attributes:
                  Attributes
                  A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
                  A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
                  The date and time when the playback ID was created.
                  Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
                  Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
                  Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
                  Live stream name can be passed as an optional parameter when a stream is created.
                  Whenever a stream is created, a timestamp is recorded for future reference.
                  Attributes

                  See possible status values description below.

                  createdA new stream has just been created.
                  startingAllocating transcoding resources to process live streaming.
                  waitingTranscoder is ready and waiting for input stream.
                  launchingInput stream is being transcoded, but waiting for output stream to begin playback.
                  liveThe stream is currently live.
                  idleInput stream was stopped. Transcoder is ready and waiting for input stream.
                  stoppingThe live stream is stopping.
                  stoppedThe live stream has stopped.
                  Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
                  Request Example
                  curl -X DELETE 'https://api-live.qencode.com/v1/live-streams/$STREAM_ID/playback-ids/$PLAYBACK_ID' \ 
                  -H 'Authorization: Bearer $ACCESS_TOKEN'
                  Response Example
                  {
                    "stream": {
                        "status": {
                            "timestamp": "2023-06-02 13:19:40",
                            "name": "created"
                        },
                        "name": "Stream_N3B47YML",
                        "stream_key": "a49c85c5-513a-4cea-8c66-f98e2019aab0",
                        "created_at": "2023-06-02 13:19:40",
                        "server_urls": {
                            "rtmps": "rtmps://rtmp-live.qencode.com/qlive",
                            "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
                        },
                        "params": {
                            "input_format": "rtmp",
                            "output_format": "hls",
                            "framerate": 0,
                            "mode": "auto",
                            "callback_url": null,
                            "dvr": {
                                "max_file_duration": 14400,
                                "destination": null,
                                "enabled": false,
                                "stream_source": "auto",
                                "format": "mp4"
                            }
                        },
                        "playback_ids": [
                            {
                                "policy": "public",
                                "created": "2023-06-02 13:19:40",
                                "id": "Av22X1p8h5",
                                "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
                            }
                        ],
                        "id": "92727a3d-5b14-491d-9479-a9269d8e76e1"
                    }
                  }

                  Adding a simulcast target for a live stream

                  POST
                  /v1/live-streams/<stream_id>/simulcast-targets

                  Adds a simulcast target for a stream

                  You should pass target params as attributes of JSON object in request data.

                  Returns

                  Updated live stream object.

                  Input Objects Structure
                  Attributes
                  The re-streaming service RTMP ingest URL.

                  Stream key used to authenticate against the simulcast target.

                  Output Objects Structure
                  Attributes
                  The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
                  Attributes
                  Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
                  Attributes
                  You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
                  The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
                  The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
                  Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
                  Attributes
                  In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
                  Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
                  Attributes

                  Specifies the output url path to a folder in your bucket.

                  Example: s3://example.com/bucket/video-files/.

                  Supported storage prefixes are:

                  • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
                  • b2:// - for Backblaze B2
                  • azblob:// - for Azure Blob Storage
                  • ftp:// or ftps:// - for any FTP server
                  • sftp:// - for any FTP over SSH server
                    to be described....
                    to be described....

                    For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

                    Specify 'public-read' value in order to make output video publicly accessible.

                    Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

                    Possible values: 'original', 'transcoded' or 'auto' (default).

                    • original - system tries to record the original ingested stream
                    • transcoded - records the highest available transcoded resolution
                    • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

                    Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

                    Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

                    In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

                    You can also record all transcoded streams by specifying 'all' as value for resolution.

                    Possible values: 'mp4' (default), 'ts' or 'hls'.

                    Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

                    You can also specify a list of output formats, e.g. ['mp4', 'hls'].

                    Specifies maximum duration of a recorded video file.

                    In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

                    Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

                    Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

                    Available types of server URLs:

                    • rtmp
                    • webrtc
                    • srt

                    You only can use one URL at a time.

                    RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

                    Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
                    An array of playback IDs for the stream. Each playback ID has the following attributes:
                    Attributes
                    A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
                    A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
                    The date and time when the playback ID was created.
                    Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
                    Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
                    Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
                    Live stream name can be passed as an optional parameter when a stream is created.
                    Whenever a stream is created, a timestamp is recorded for future reference.
                    Attributes

                    See possible status values description below.

                    createdA new stream has just been created.
                    startingAllocating transcoding resources to process live streaming.
                    waitingTranscoder is ready and waiting for input stream.
                    launchingInput stream is being transcoded, but waiting for output stream to begin playback.
                    liveThe stream is currently live.
                    idleInput stream was stopped. Transcoder is ready and waiting for input stream.
                    stoppingThe live stream is stopping.
                    stoppedThe live stream has stopped.
                    Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
                    Request Example
                    curl -X POST 'https://api-live.qencode.com/v1/live-streams/$STREAM_ID/simulcast-targets' \ 
                    -H 'Authorization: Bearer $ACCESS_TOKEN' \ 
                    --data-raw '{
                     "url": "rtmp://a.rtmp.youtube.com/live2",
                     "stream_key": "1234-5678-abcd-efgh-3cm6"
                    }'
                    Response Example
                    {
                      "stream": {
                        "id": "73bfd689-777b-48fb-97f5-ded39b8b0d50",
                        "name": "test-stream-update1",
                        "quality": "LIVE SD",
                        "status": {
                          "timestamp": "2021-12-01 17:24:04",
                          "name": "stopped"
                        },
                        "server_urls": {
                          "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
                        },
                        "params": {
                          "input_format": "webrtc",
                          "output_format": "cmaf",
                          "framerate": "30",
                          "mode": "auto",
                          "callback_url": null,
                          "dvr": {
                            "destination": null,
                            "enabled": 0
                          }
                        },
                        "playback_ids": [
                          {
                            "policy": "public",
                            "created": "2021-08-28 17:59:33",
                            "id": "Av22X1p8h5",
                            "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
                          }
                        ],
                        "created_at": "2021-10-17 08:09:00",
                        "simulcast_targets": [
                          {
                            "url": "rtmp://a.rtmp.youtube.com/live2",
                            "id": "12348fd3-0fc2-4982-8910-d1b06bb917c9",
                            "stream_key": "1234-5678-abcd-efgh-3cm6"
                          }
                        ]
                      }
                    }

                    Removing a simulcast target from a live stream

                    DELETE
                    /v1/live-streams/<stream_id>/simulcast-targets/<target_id>

                    Removes a simulcast target from stream by its ID.

                    Returns

                    Updated live stream object.

                    Output Objects Structure
                    Attributes
                    The stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
                    Attributes
                    Every live stream will stream object contains all the attributes of your live stream, including like id, stream_key, playback_id, status, origin and more.
                    Attributes
                    You can specify callback URL (also known as webhook) to receive updates upon each stream status change. See Updating a live stream for more details on how to set up a callback URL for a stream.
                    The desired format for ingesting the stream. Possible values: 'rtmp', 'webrtc', 'srt'. You may explicitly define stream input format but system dynamically changes it to the appropriate value depending on the server URL type you used for ingest.
                    The desired format for stream playback. LL-HLS, CMAF and DASH coming soon!
                    Can be specified as integer or float value of frames per second. Specify 0 to preserve input frame rate. Current maximum supported frame rate is 30.
                    Attributes
                    In order to start recording your stream, you must set enabled parameter to 1. Defaults to 0.
                    Describes output endpoint, path, credentials and permissions for the destination of the output files created a result of the API request. You can save to multiple destinations by putting all of your destination objects into array.
                    Attributes

                    Specifies the output url path to a folder in your bucket.

                    Example: s3://example.com/bucket/video-files/.

                    Supported storage prefixes are:

                    • s3:// - for any S3-compatible storage (Qencode, AWS, GCS, DigitalOcean, etc.)
                    • b2:// - for Backblaze B2
                    • azblob:// - for Azure Blob Storage
                    • ftp:// or ftps:// - for any FTP server
                    • sftp:// - for any FTP over SSH server
                      to be described....
                      to be described....

                      For S3 only. Specifies object access permissions. For AWS possible values are: 'private', 'public-read', 'authenticated-read', 'bucket-owner-read' and others described in Access Control List Overview. Default value is 'private'.

                      Specify 'public-read' value in order to make output video publicly accessible.

                      Only for AWS S3. Specifies storage class for the output. You can specify REDUCED_REDUNDANCY value in order to lower your storage costs for noncritical, reproducible data. See Reduced redundancy storage description.

                      Possible values: 'original', 'transcoded' or 'auto' (default).

                      • original - system tries to record the original ingested stream
                      • transcoded - records the highest available transcoded resolution
                      • auto - in this mode system will try to record original stream but will switch to transcoded in case of any incompatibility of incoming stream and recording container

                      Only applies to to transcoded stream source. Ignored in case stream_source param is set to 'original'.

                      Possible values: 'highest', 'lowest', '240p', '480p', '720p', '1080p', '1440p', '4k', 'all'. By default the highest transcoded resolution is recorded.

                      In case the highest transcoded resolution is lower than the specified one, system tries to record the closest one.

                      You can also record all transcoded streams by specifying 'all' as value for resolution.

                      Possible values: 'mp4' (default), 'ts' or 'hls'.

                      Use 'ts' for better compatibility if you want to record the original ingested stream instead of transcoded one.

                      You can also specify a list of output formats, e.g. ['mp4', 'hls'].

                      Specifies maximum duration of a recorded video file.

                      In case the stream lasts longer than max_file_duration seconds, system creates another video file and starts transfer of the recorded one to destination specified.

                      Max value - 21600 seconds (6 hrs). Defaults to 14400 (4 hrs).

                      Contains the list of server URLs available for ingest. Server URL needs to be set when streaming through third-party client software like OBS.

                      Available types of server URLs:

                      • rtmp
                      • webrtc
                      • srt

                      You only can use one URL at a time.

                      RTMP url is always available. You need to call start API method for the stream before you can see WebRTC and SRT URLs.

                      Stream key is used to identify the stream when pushing from a 3rd party client software like OBS.
                      An array of playback IDs for the stream. Each playback ID has the following attributes:
                      Attributes
                      A unique identifier for the playback of the output. Can be used to automatically build playback_url for different output formats.
                      A policy that defines the playback behavior of the output. Possible values: 'public', 'authenticated'. Authenticated policy requires a signed token to play the stream. See Signed tokens for more information.
                      The date and time when the playback ID was created.
                      Depending on the output format you choose, the playback URL is used in conjuction with your player to play your video to your viewers.
                      Contains the domain name of live stream origin. Is only available for streams in Waiting, Launching, Live or Idle states.
                      Contains the live stream origin URL. Is only available for streams in Waiting, Launching, Live or Idle states.
                      Live stream name can be passed as an optional parameter when a stream is created.
                      Whenever a stream is created, a timestamp is recorded for future reference.
                      Attributes

                      See possible status values description below.

                      createdA new stream has just been created.
                      startingAllocating transcoding resources to process live streaming.
                      waitingTranscoder is ready and waiting for input stream.
                      launchingInput stream is being transcoded, but waiting for output stream to begin playback.
                      liveThe stream is currently live.
                      idleInput stream was stopped. Transcoder is ready and waiting for input stream.
                      stoppingThe live stream is stopping.
                      stoppedThe live stream has stopped.
                      Whenever there is a change in the status of a stream, a timestamp is recorded for future reference.
                      Request Example
                      curl -X DELETE 'https://api-live.qencode.com/v1/live-streams/$STREAM_ID/simulcast-targets/$TARGET_ID' \ 
                      -H 'Authorization: Bearer $ACCESS_TOKEN'
                      Response Example
                      {
                        "stream": {
                          "id": "73bfd689-777b-48fb-97f5-ded39b8b0d50",
                          "name": "test-stream-update1",
                          "quality": "LIVE SD",
                          "status": {
                            "timestamp": "2021-12-01 17:24:04",
                            "name": "stopped"
                          },
                          "server_urls": {
                            "rtmp": "rtmp://rtmp-live.qencode.com/qlive"
                          },
                          "params": {
                            "input_format": "webrtc",
                            "output_format": "cmaf",
                            "framerate": "30",
                            "mode": "auto",
                            "callback_url": null,
                            "dvr": {
                              "destination": null,
                              "enabled": 0
                            }
                          },
                          "playback_ids": [
                            {
                              "policy": "public",
                              "created": "2021-08-28 17:59:33",
                              "id": "Av22X1p8h5",
                              "playback_url": "https://play-Av22X1p8h5.qencode.com/qhls/qlive/playlist.m3u8"
                            }
                          ],
                          "stream_key": "1234e5b1-dfd7-4daa-8121-bc5c68bbeb37",
                          "created_at": "2021-10-17 08:09:00",
                          "simulcast_targets": []
                        }
                      }