...
WCS can capture an RTMP video stream published by another server, by request. The captured stream can be broadcast to any of supported platforms using any of supported technologies. Managing of RTMP stream capturing is performed using REST API.
...
A REST-query must be an HTTP/HTTPS POST request as follows:
- - HTTP: http://test.flashphoner.com:
...
- 8081/rest-api/pull/rtmp/pull
- - HTTPS: https://test.flashphoner.com:
...
- 8444/rest-api/pull/rtmp/pull
Where:
- - test.flashphoner.com - is the address of the WCS server
- -
...
- 8081 - is the standard REST / HTTP port of the WCS server
- -
...
- 8444 - is the standard HTTPS port
- - rest-api - is the required part of the URL
- - /pull/rtmp/pull - is the REST method used
REST-methods and response statuses
REST-method | Example of REST-query | Example of REST response | Response status | Description | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
/pull/pull |
| 409 - Conflict 500 - Internal error | Pull the WebRTC stream at the specified URL | ||||||||
/pull/find_all |
| 200 – streams are found 500 - Internal error | Find all pulled WebRTC streams | ||||||||
/pull/terminate |
| 200 - stream terminated 500 - Internal error | Terminate the pulled WebRTC stream |
Parameters
Parameter name | Description | Example |
---|---|---|
uri | URL of the WebRTC stream | wss://demo.flashphoner.com:8443 |
localMediaSessionId | Session identifier | 5a072377-73c1-4caf-abd3 |
remoteMediaSessionId | Session identifier on the remote server | 12345678-abcd-dead-beaf |
localStreamName | Local name assigned to the captured stream. By this name the stream can be requested from the WCS server | testStream |
remoteStreamName | Captured stream name on the remote server | testStream |
status | Current stream status | NEW |
Configuration
In the /usr/local/FlashphonerWebCallServer/conf directory you can find the SDP description file for the RTMP agent rtmp_agent.sdp:
...
Below is the call flow when capturing an RTMP stream from another server
Known issues
Excerpt |
---|
1 |
...
. A stream containing B-frames does not play or plays with artifacts (latencies, lags) Symptoms: |
...
|
...
|
...
Solution: |
...
change the encoder settings so, that B-frames were not used (lower encoding profile, specify in the command line etc). 2. AAC frames of type 0 are not supported by decoder and will be ignored while stream pulled playback In this case, warnings will be displayed in the client log:
Solution: use Fraunhofer AAC codec with the following parameter in flashphoner.properties file
3. When publishing and then playing and recording H264 + AAC stream video may be out of sync with sound, or no sound at all. Symptoms: when playing H264 + AAC stream published on server, and when recordingsuch stream, sound is out of sync with video or absent Solution: a) set the following parameter in flashphoner.properties file
This parameter also turns off AAC frames dropping. b) use Fraunhofer AAC codec
4. Sound may be distorted or absent when resampled to 11025 Hz Symptoms: when H264 + AAC stream published on WCS server is played with AAC sample rate 11025 Hz, sound is distorted or absent Solution: do not use 11025 Hz sample rate, or escape AAC sound resampling to this rate, for example, do not set this sample rate in SDP settings. |
5. Some RTMP functions does not supported and will be ignored:
- FCSubscribe
- FCPublish
- FCUnpublish
- onStatus
- onUpstreamBase
- releaseStream
6. When recording the captured stream to the disk, only audio is recorded
Symptoms: when the "record": "true" parameter is set in the /pull/rtmp/pull REST query, the received file lacks video track, only audio is present.
Solution: in the SDP setting set the SDP settings set the
Code Block | ||||
---|---|---|---|---|
| ||||
a=sendonly |
...