API Reference - Non-Interactive Live Streaming

This page describes the API references for Non-Inteactive (Direct Ingestion) Live Streaming


Table of Contents


  1. Generate JWT Token

Generate JWT Token to use with sariska services

post
Body
apiKeystringOptional

please pass apiKey with tied with your sariska account

Example: iufwenufewifweifiuTbddhbdjhjfbjfjwfjwfj
expstringOptional

pass exp claim of jwt token

Example: 24 hours
nbfstringOptional

pass nbf claim of jwt token

scopestringOptional

pass scope of token it can be messaging or media or sariska or leave it blank

Responses
200
A successfully generated response for jwt token
application/json
post
POST /api/v1/misc/generate-token HTTP/1.1
Host: api.sariska.io
Content-Type: application/json
Accept: */*
Content-Length: 219

{
  "apiKey": "iufwenufewifweifiuTbddhbdjhjfbjfjwfjwfj",
  "user": {
    "id": "ytyVgh",
    "name": "Nick",
    "email": "[email protected]",
    "avatar": "https://some-storage-location/nick.jpg",
    "moderator": false
  },
  "exp": "24 hours",
  "nbf": "",
  "scope": ""
}
{
  "token": "text"
}
  1. Start Live Streaming (Direct Ingestion)

Starts new live streaming

post
Authorizations
Body
is_low_latencybooleanOptional

Whether the live streaming needs to be in low latency

Example: true
is_direct_ingestionbooleanOptional

Instead of a room, we use direct ingestion to start a live stream, for e.g. from obs

Example: true
multi_bitratebooleanOptional

If true is passed, the stream will be transcoded into 5 different variants: 720p (HD), 480p (HD_MID), 360p (MID), 240p (MID_LOW), and 240p (LOW) with bitrates of 2628kbps, 1128kbps, 878kbps, 528kbps, and 264kbps, respectively. This will ensure the best possible viewing experience, regardless of the user's network or device.

Example: true
is_vodbooleanOptional

Please set this flag to true if you want to access the Video on Demand (VOD) URL. The VOD will be available after the live streaming has finished.

Example: true
Responses
200
A generated response after live streaming started successfully
application/json
post
POST /terraform/v1/hooks/srs/startRecording HTTP/1.1
Host: api.sariska.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 85

{
  "is_low_latency": true,
  "is_direct_ingestion": true,
  "multi_bitrate": true,
  "is_vod": true
}
{
  "started": true,
  "stream_path": "text",
  "srt_ingest_url": "text",
  "flv_ingest_url": "text",
  "rtmp_ingest_url": "text",
  "flv_play_url": "http://streaming-edge-nlb-tcp-bbc5ae3a0d2cb7a3.elb.ap-south-1.amazonaws.com:8080/4zrurnrwrvxxj8xf/wsb3vhnlxcrtdluw.flv?domain=ll_latency_h264",
  "rtmp_play_url": "rtmp://streaming-edge-nlb-tcp-bbc5ae3a0d2cb7a3.elb.ap-south-1.amazonaws.com:1935/4zrurnrwrvxxj8xf/wsb3vhnlxcrtdluw?domain=ll_latency_h264",
  "low_latency_hls_url": "https://low-latency-edge.sariska.io/original/4zrurnrwrvxxj8xf/wsb3vhnlxcrtdluw/playlist.m3u8",
  "hls_url": "https://edge.sariska.io/play/hls/2imjtqyu4udy4ol8/82e28qet2noruyzb.m3u8"
}
  1. Get Live Viewers Count

Get all live viewers count

get
Path parameters
stream_namestringRequired
Responses
200
A generated response for fetching live hls users count
application/json
get
GET /terraform/v1/hooks/srs/live/viewers/count/{stream_name} HTTP/1.1
Host: api.sariska.io
Accept: */*
200

A generated response for fetching live hls users count

{
  "{stream_name}": {
    "current_viewers": 1,
    "uptime": 1
  }
}
  1. Get Live Viewers Count for Low Latency HLS

Get all live viewers count with low latency HLS URL

get
Path parameters
stream_namestringRequired
Responses
200
A generated response for fetching live hls users count
application/json
get
GET /llhls/v1/hooks/srs/live/viewers/count/{stream_name} HTTP/1.1
Host: api.sariska.io
Accept: */*
200

A generated response for fetching live hls users count

{
  "{stream_name}": {
    "current_viewers": 1,
    "uptime": 1
  }
}

Last updated