Versions Compared

Key

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

...

5. Cyclic injection is not supported. It is not possible to inject stream1 into stream2 and then stream2 into stream1 without terminating the previous injection.

Injection implementation in builds before 5.2.1618

Injection management using REST API

REST query must be HTTP/HTTPS POST request as follows:

...

  • test.flashphoner.com - WCS server address
  • 8081 - standard REST / HTTP port of  WCS server
  • 8444 - standard HTTPS port
  • rest-api - mandatory URL part
  • /stream/inject/startup - REST method used

REST queries and responses

REST query

REST query body example

REST response example

Response states

Description

/stream/inject/startup

Code Block
languagejs
themeRDark
{
 "localStreamName": "stream1",
 "remoteStreamName": "stream2"
}

200 - OK

400 - Bad request

404 - Not found

409 - Conflict

500 - Internal error


Inject stream2 into stream1


/stream/inject/find_all
Code Block
languagejs
themeRDark
[
 {
   "localStreamName": "stream1",
   "remoteStreamName": "stream2"
 }
]

200 - OK

404 - Not found


Find all injections on the server
/stream/inject/terminate
Code Block
languagejs
themeRDark
{
 "localStreamName": "stream1"
}

200 - OK

400 - Bad request

404 - Not found

500 - Internal error


Stop injection into stream1

Parameters

Name

Description

Example

localStreamNameStream name to inject to
stream1
remoteStreamNameStream name to be injected
stream2

Injecting a VOD stream from file

Since build 5.2.1535 VOD stream directly from a file may be injected:

...

This feature is useful, for example, to inject advertising video into a stream being viewed.

Configuration

Since build 5.2.1235 the parameter is added to set a time interval to wait for a keyframe in injected stream

...

In this case, the stream to be injected to will be played until keyframe arrives in the injected stream.

Injection implementation in build 5.2.1618 and newer

Configuration

Since build 5.2.1618 a new injector implementation is added allowing to choose what exactly to inject: audio, video or both. The feature may be enabled by the following parameter

Code Block
themeRDark
use_new_injector=true

REST API

REST query must be HTTP/HTTPS POST request as follows:

  • HTTP: http://test.flashphoner.com:8081/rest-api/stream/inject2/startup

  • HTTPS: https://test.flashphoner.com:8444/rest-api/stream/inject2/startup

Where:

  • test.flashphoner.com - WCS server address
  • 8081 - standard REST / HTTP port of  WCS server
  • 8444 - standard HTTPS port
  • rest-api - mandatory URL part
  • /stream/inject2/startup - REST method used

REST queries and responses

REST query

Request body

Response body

Response state

Description

/stream/inject2/startup

Code Block
languagejs
themeRDark
{
 "localStreamName": "test",
 "remoteStreamName": "test2",
 "video": true,
 "audio": true
}

200 - OK

400 - Bad request

404 - Not found

409 - Conflict

500 - Internal error


Inject test2 stream into test stream


/stream/inject2/find_all
Code Block
languagejs
themeRDark
[
  {
    "streamName": "test",
    "videoInjectorInfo": {
      "targetStreamName": "test2",
      "rootStreamName": "test2",
      "startTime": 1683344295099
    },
    "audioInjectorInfo": {
      "targetStreamName": "test2",
      "rootStreamName": "test2",
      "startTime": 1683344295056
    }
  }
]

200 - OK

404 - Not found


Find all injections on the server
/stream/inject2/terminate
Code Block
languagejs
themeRDark
{
 "localStreamName": "test",
 "video": true,
 "audio": true
}

200 - OK

400 - Bad request

404 - Not found

500 - Internal error


Stop injection into test stream

Parameters

Parameter

Description

Example

localStreamNameStream name to inject to
test
remoteStreamNameStream name to be injected
test2
videoReplace video when injectingtrue 
audioReplace audio when injectingtrue 
videoInjectorInfoVideo information from injected stream{
"targetStreamName": "test2",
"rootStreamName": "test2",
"startTime": 1683344295099
}
audioInjectorInfoAudio information from injected stream{
"targetStreamName": "test2",
"rootStreamName": "test2",
"startTime": 1683344295056
}

Quick testing

1. For test we use

...