...
The pixels changed will be in the stream picture.
Controlling interceptors with REST API
Since build 5.2.2055 it is possible to control decoded frames interceptors with REST API
A REST query should be HTTP/HTTPS POST query as follows:
- HTTP: http://streaming.flashphoner.com:8081/rest-api/video_interceptor/set
- HTTPS: https://streaming.flashphoner.com:8444/rest-api/video_interceptor/set
Where:
- streaming.flashphoner.com - WCS server address
- 8081 - WCS server REST / HTTP port
- 8444 - WCS server HTTPS port
- rest-api - mandatory prefix
- /video_interceptor/set - REST method used
REST methods and responses
/video_interceptor/set
Set decoded frames interceptor class to the stream. The interceptor will receive a decoded frames when stream will be decoded, for example, added to mixer. Only one interceptor may be set to the stream simultaneously
Request example
| Code Block | ||||
|---|---|---|---|---|
| ||||
POST /rest-api/video_interceptor/set HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"streamName":"stream1",
"className":"com.flashphoner.frameInterceptor.TestInterceptor"
} |
Response example
| Code Block | ||||
|---|---|---|---|---|
| ||||
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json |
Return codes
Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not found |
| 500 | Internal server error |
/video_interceptor/find_all
Find all the interceptors
Request example
| Code Block | ||||
|---|---|---|---|---|
| ||||
POST /rest-api/video_interceptor/find_all HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"streamName":"stream1",
"className":"com.flashphoner.frameInterceptor.TestInterceptor"
} |
Response example
| Code Block | ||||
|---|---|---|---|---|
| ||||
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json
[
{
"hashcode":21982654,
"className":"com.flashphoner.frameInterceptor.TestInterceptor",
"processedFrames":169,
"streamName":"stream1",
"status":"PROCESSING"
}
] |
Return codes
Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not found |
/video_interceptor/remove
Remove the interceptor from the stream
Request example
| Code Block | ||||
|---|---|---|---|---|
| ||||
POST /rest-api/video_interceptor/remove HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"streamName":"stream1"
} |
Response example
| Code Block | ||||
|---|---|---|---|---|
| ||||
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json |
Return codes
Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not found |
Parameters
Parameter | Description | Example |
|---|---|---|
| streamName | Published stream name | "streamName":"stream1" |
| className | Interceptor class name | "className":"com.flashphoner.frameInterceptor.TestInterceptor" |
| hashcode | Interceptor object Id | "hashcode":21982654 |
| status | Current interceptor state | "status":"PROCESSING" |
| processedFrames | Processed frames counter | "processedFrames":169 |
The interceptor may be in one of the following states:
- WAITING - the interceptor waits for the stream decoding
- PROCESSING - the interceptor receives a frames decoded and handles them
- UNSUPPORTED - decoded frames interception is not supported (for GPU decoded streams)