Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

REST query

Body example

Response example

Response state

Desctiption

/hls/startup

Code Block
languagejs
themeRDark
{
  "name":"test"
}

200 - OK

404 - Stream not found

500 - Internal error


Start HLS agent for the stream


/hls/find_all

Code Block
languagejs
themeRDark
{
  "offset":0,
  "size":10
}
Code Block
languagejs
themeRDark
[{
    "id": "test",
    "streamName": "test",
    "status": "ACTIVE",
    "waitingSize": 0,
    "profiles": [
      "a_test",
      "v_test"
    ],
    "subscribers": 1,
    "playlist": "...",
    "createdDate": 1697605114475,
    "logs": []
}]

200 – OK

404 – Not found

Find all streams having HLS agents

/hls/terminate

Code Block
languagejs
themeRDark
{
  "name":"test"
}

200 – OK

404 – Not found

Stop or restart HLS agent for the stream

/hls/profiles
Code Block
languagejs
themeRDark
{
  "hlsId":"test",
  "profileName":"v_test" }
Code Block
languagejs
themeRDark
{
  "name": "v_test",
  "stream": {
    "appKey": "defaultApp",
    "sessionId": "test-HLS",
    "mediaSessionId": "81b8b278-612e-4b72-9153-454be9df0a34-test-HLS",
    "name": "test",
    "published": false,
    "hasVideo": false,
    "hasAudio": true,
    "status": "PLAYING",
    "sdp": "...",
    "videoCodec": "H264",
    "record": false,
    "width": 1280,
    "height": 720,
    "bitrate": 0,
    "minBitrate": 0,
    "maxBitrate": 0,
    "quality": 0,
    "parentMediaSessionId": "f3401d2e-7e9a-4e18-a353-d323c947ac94",
    "history": false,
    "gop": 0,
    "fps": 0,
    "audioBitrate": 0,
    "codecImpl": "",
    "transport": "UDP",
    "cvoExtension": true,
    "createDate": 1697605114875,
    "mediaType": "play",
    "audioState": {
      "muted": false
    },
    "videoState": {
      "muted": false
    },
    "mediaProvider": "HLS"
  },
  "keyFrameReceived": true,
  "videoProfile": {
    "type": "video",
    "width": 1280,
    "height": 720,
    "fps": 29,
    "bitrate": 1720,
    "codec": "",
    "quality": 0,
    "audioGroupId": "audio"
  },
  "metrics": {
    "minFPS": 29.962547,
    "avgFPS": 30.000088,
    "maxFPS": 30.04292,
    "countGaps": 0,
    "resolutionChanges": 0,
    "queueSize": 10,
    "startPts": 375400,
    "currentPts": 375400
  },
  "subscribers": 1
}

200 – OK

400 – Bad request

404 – Not found

Get HLS profile statistics
/hls/subscribers
Code Block
languagejs
themeRDark
{
  "hlsId":"test"
}
Code Block
languagejs
themeRDark
[
  {
    "id": "192.168.0.83-59000-Mozilla/5.0 (X11; Linux x86_64) Chrome/118.0.0.0",
    "ip": "192.168.0.83",
    "port": 59000,
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) Chrome/118.0.0.0",
    "active": true,
    "metrics": {
      "profileTime": {
        "test": 71,
        "v_test": 541353
      },
      "requestsNumber": 5930,
      "requestsStatuses": {
        "200 OK": 5930
      },
      "profileSwitches": 1,
      "maxResponseTime": 29,
      "minResponseTime": 0,
      "avgResponseTime": 0.4436762225969646
    }
  }
]

200 – OK

400 – Bad request

404 – Not found

Get HLS subscribers statistics
/hls/enableRecordingconnections
Code Block
languagejs
themeRDark
{
  "idsoffset":0,
  "size":10
}
Code Block
languagejs
themeRDark
[
  {
    "ip": "test192.168.0.83",
    "test-HLS-ABR-STREAM"
  ]
}port": 51708,
    "userAgent": "Chrome/125.0.0.0 Safari/537.36"
  }
]

200 – OK

400 – Bad request

404 – Not found

409 - Conflict

500 - Internal server error

Enable HLS stream debug segments recordingGet a list of HLS clients connected to the server
/hls/disableRecordingenableRecording
Code Block
languagejs
themeRDark
{
  "ids": [
    "test",
    "test-HLS-ABR-STREAM"
  ]
}

200 – OK

400 – Bad request

404 – Not found

Disable

409 - Conflict

500 - Internal server error

Enable HLS stream debug segments recording

Parameters

Parameter name

Description

Example

name

Stream published name

test

/hls/disableRecording
Code Block
languagejs
themeRDark
{
  "ids": [
    "test",
    "test-HLS-ABR-STREAM"
  ]
}

200 – OK

400 – Bad request

404 – Not found

Disable HLS stream debug segments recording

Parameters

Parameter name

Description

Example

name

Stream published name

test

hlsId

Stream published name

test

profileNameQuality profile name to get a statisticsv_test
offsetOffset from HLS streams statistics list start0
sizeMaximum HLS streams statistics list size10
idsHLS streams list to enable/disable debug segment recording

[ "test", "test-HLS-ABR-STREAM" ]

stateHLS stream stateACTIVE
logsMessages about stream issues[]

...

Where 8445 is HTTPS HLS port of WCS server

Displaying a list of HLS clients connected to the server

Since build 5.2.1968 it is possible to display a list of HLS clients connected to the server. The list is returned in response to the /hls/connections query:

Code Block
languagejs
themeRDark
[
  {
    "ip": "192.168.0.83",
    "port": 51708,
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
  }
]

Where:

  • ip - client address
  • port - client source port
  • userAgent - User-Agent header sent by the client

For HTTPS clients all the tabs of the same browser window on the same PC will be displayed at one position because HTTP/2 uses the same TCP connection for all HTTPS connections.

A clients count in the list will be the same as the statistics page value

Code Block
languagebash
themeRDark
curl -s 'http://wcs:8081/?action=stat&params=connections_hls'

HLS stream segments recording to disk for debugging purposes

...