...
Transcoding management with REST API
Obsolete REST API version (server builds before 5.2.898)
REST query should be HTTP/HTTPS POST request as:
...
- test.flashphoner.com is WCS server address
- 8081 is a standard REST / HTTP port of WCS server
- 8444 is a standard HTTPS port
- rest-api is mandatory URL prefix
- /transcoder/startup is REST query
REST queries and response states
REST query | Request example | Response example | Response states | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/transcoder/startup |
| 400 - Bad request 409 - Conflict 500 - Internal error | Create transcoder with defined parameters for certain stream | |||||||||||||||
/transcoder/find |
|
| 200 – Transcoders found 404 – Transcoders not found | Find the transcoder by certain criteria | ||||||||||||||
/transcoder/find_all |
| 200 – Transcoders found 404 – Transcoders not found | Find all transcoders | |||||||||||||||
/transcoder/terminate |
| 200 - Transcoders is terminated 404 - Transcoder not found | Stop transcoder and its output stream |
...
Name | Description | Example |
---|---|---|
uri | Transcoder URL | transcoder://tcode1 |
localStreamName | Transcoder output stream name | testT |
remoteStreamName | Stream name to transcode | test |
localMediaSessionId | Transcoder media session Id | 42a92132-bcd1-4436-a96f-3fec36b32b37 |
status | Transcoder state | PROCESSED_LOCAL |
hasAudio | Output stream has audio | true |
hasVideo | Output stream has video | true |
record | Output stream is recorded | false |
Encoder parameters | ||
width | Picture width | 640 |
height | Picture height | 480 |
keyFrameInterval | Key frame generation interval (GOP) | 30 |
fps | Frames per second | 30 |
bitrate | Bitrate, in kbps | 500 |
type | Codec | OPENH264 |
watermark | Watermark file | Test.png |
Known limits
1. Transcoder cannot be created by REST API for audio only stream. In response to /transcoder/startup query for such stream, server returns 400 Bad request with message "Can't start transcoder for audio only stream"
...
4, If only width is specified, the quey return 400 Bad request with message "Height is not specified"
REST API version 2 (server builds since 5.2.898)
REST query should be HTTP/HTTPS POST request as:
- HTTP: http://test.flashphoner.com:8081/rest-api/transcoder2/startup
- HTTPS: https://test.flashphoner.com:8444/rest-api/transcoder2/startup
Where:
- test.flashphoner.com is WCS server address
- 8081 is a standard REST / HTTP port of WCS server
- 8444 is a standard HTTPS port
- rest-api is mandatory URL prefix
- /transcoder2/startup is REST query
REST queries and response states
REST query | Request example | Response example | Response states | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/transcoder2/startup |
| 200 - OK 400 - Bad request 409 - Conflict 500 - Internal error | Create transcoder with defined parameters for certain stream | |||||||||||||||
/transcoder2/find |
|
| 200 – OK 404 – Not found | Find the transcoder by certain criteria | ||||||||||||||
/transcoder/find_all |
| 200 – OK 404 – Not found | Find all transcoders | |||||||||||||||
/transcoder/terminate |
| 200 – OK 404 – Not found | Stop transcoder and its output stream |
Parameters
Name | Description | Example |
---|---|---|
uri | Transcoder URL | transcoder2://tcode2 |
localStreamName | Transcoder output stream name | testT |
remoteStreamName | Stream name to transcode | test |
localMediaSessionId | Transcoder media session Id | 82ad5545-e11e-4f0f-801a-49e69d8c38f2 |
status | Transcoder state | PROCESSED_LOCAL |
hasAudio | Output stream has audio | true |
hasVideo | Output stream has video | true |
record | Output stream is recorded | false |
Encoder parameters | ||
width | Picture width | 320 |
height | Picture height | 240 |
audioCodec | Audio codec | mpeg4-generic |
audioRate | Audio sample rate, Hz | 44100 |
audioChannels | Audio channels | 2 |
videoCodec | Video codec | H264 |
keyFrameInterval | Key frame generation interval (GOP) | 30 |
fps | Frames per second | 30 |
bitrate | Video bitrate, in kbps | 500 |
type | Encoder type | OPENH264 |
watermark | Watermark file | Test.png |
videoRate | Video sample rate, Hz | 90000 |
Known limits
1. If video transcoding parameters are passed for audio only stream, or audio transcoding parameters are passed for video only stream, 400 Bad request will return
Quick manual for testing
1. For test we use
...