Versions Compared

Key

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

WCS5EN:In a player via RTMP
Include Page
WCS5EN:In a player via RTMP
Table of Contents

Overview

A stream published on the WCS server can be played via RTMP in a third-party player. In this case, WCS itself serves as an RTMP-source.

RTMP-codecs

  • Video: H.264
  • Audio: AAC, G.711, Speex

Operation flowchart

Image Added

  1. The browser establishes a connection to the server via Websocket
  2. The browser captures the camera and the microphone and sends the WebRTC stream to the server
  3. VLC Player establishes a connection to the server via RTMP
  4. VLC Player receives the stream from the server and plays it

Quick manual on testing

Publishing a video stream on the server and playing it via RTMP in a software player

1. For the test we use:

2. Open the Two Way Streaming application. Click Connect, then Publish. Copy the identifier of the stream:


Image Added

3. Run VLC, select the "Media - Open network stream" menu. Enter the URL of the WCS server and enter the identifier of the stream, in this exampe:
rtmp://demo.flashphoner.com:1935/live/9121:

Image Added

4. Click the "Play" button. The player starts playing the stream:

Image Added

Call flow

Below is the call flow when playing a stream via RTMP in a software player.


Image Added

  1. The software player establishes a connection to the WCS server via RTMP.
  2. The software player receives the media stream from WCS.

Excerpt Include
Using RTMP encoder
Using RTMP encoder
nopaneltrue

Track order management in RTMP stream

Most players on various platforms suppose video track to be first in RTMP stream. To guarantee this order and to send videodata before audiodata, set the following parameter in flashphoner.properties file:

Code Block
themeRDark
rtmp_send_video_first=true

Note that if this setting is active, a stream containing audio track only can not be played as RTMP because audiodata will not be sent to client.

RTMP playback sound suppression

Sound may be disabled while stream published on server playback as RTMP. To do this, the following RTMP URL parameter should be passed:

Code Block
themeRDark
rtmp://yourserver:1935/live?suppress_sound=true/streamName

In this case audio track will be replaced by silence.

Known issues

1. When playing FullHD, 2K, 4K streams with big frame size, data packets to send may not fit to socket buffer, this leads to artifacts in some players

Symptoms: artifacts occur while playing RTMP stream via good channel

Solution: enable RTMP packets buffering with the parameter

Code Block
themeRDark
rtmp.server_buffer_enabled=true