Versions Compared

Key

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

...

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
languagejs
themeRDark
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
languagejs
themeRDark
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json

Return codes

Code

Reason

200OK
404Not found
500Internal server error

/video_interceptor/find_all

Find all the interceptors

Request example

Code Block
languagejs
themeRDark
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
languagejs
themeRDark
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

200OK
404Not found

/video_interceptor/remove

Remove the interceptor from the stream

Request example

Code Block
languagejs
themeRDark
POST /rest-api/video_interceptor/remove HTTP/1.1
Host: localhost:8081
Content-Type: application/json

{
    "streamName":"stream1"
}

Response example

Code Block
languagejs
themeRDark
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json

Return codes

Code

Reason

200OK
404Not found

Parameters

Parameter

Description

Example

streamNamePublished stream name"streamName":"stream1" 
classNameInterceptor class name"className":"com.flashphoner.frameInterceptor.TestInterceptor" 
hashcodeInterceptor object Id"hashcode":21982654 
statusCurrent interceptor state"status":"PROCESSING" 
processedFramesProcessed 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)