Versions Compared

Key

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

...

Note that ffmpeg sends orientattion value but not angle itself.

Decoding buffer size management

When RTMP stream is published from software encoder supportin hardware acceleration on NVIDIA GPU, and contains B-frames, the stream picture can twitch in some RTMP or HLS players. To workaround this, since build 5.2.863 the parameter was added to set the maximum decoding buffer size passed in SPS

Code Block
themeRDark
h264_sps_max_dec_frame_buffering=-1

By default, buffer size is not limited. This eliminates picture twitching, but can inscrease latency due to excessive buffering. In this case, the buffer size can be limited to 2 frames (default value before build 5.2.863)

Code Block
themeRDark
h264_sps_max_dec_frame_buffering=2

or more frames to eliminate twitching without viewable latency.

Incoming RTMP stream buffering

RTMP stream published with high resolution and bitrate may be played non smoothly via WebRTC with freezes or low FPS if publishers channel is unstable. Incoming stream should be buffered to prevent playback issues

Code Block
themeRDark
rtmp_in_buffer_enabled=true

Adaptive RTMP incoming buffer has the following parameters to tune:

ParameterDescriptionDefault value
rtmp_in_buffer_start_sizeMinimum buffer volume to start, ms300
rtmp_in_buffer_initial_sizeMaxumum buffer volume, ms2000
rtmp_in_buffer_max_bufferings_allowedMaximum bufferings amout allowed-1 (unlimited)
rtmp_in_buffer_polling_timeBuffer polling period, ms100
rtmp_in_buffer_overflow_allowed_deviationMaximum difference between minimum and maximum buffer volumes used, ms1000
rtmp_in_buffer_overflow_deviation_windowWindow size to collect the difference, ms30000
rtmp_in_buffer_overflow_rateMaximum buffer overflow rate0.15
rtmp_in_buffer_clear_thresholdClear all the data exceeding maxumum buffer size when buffer reaches the threshold, ms30000

Stop stream buffering if stream delay grows

RTMP stream timestamps may significally differ from server time, and stream may give a delay if there is not enough systrem perfomance for software stream encoder, or if channel bandwidth decreases. Buffering of such stream will give a periodic freezes while playing it. Since build 5.2.1311 the following parameter was added to disable buffering and pass incoming traffic directly to server engine

Code Block
themeRDark
rtmp_in_buffer_input_delay_threshold=0

By default, RTMP traffic will always be buffered if buffering is enabled. Buffering can be disabled when stream delay reaches a value defined in milliseconds

Code Block
themeRDark
rtmp_in_buffer_input_delay_threshold=3000

In this case, buffer is cleared and goes to the PASSTHROUGH state. Even if stream delay becomes lower, buffer will remain in the state, and stream will not be buffered until publishing is stopped.

Detect stream parameters by metadata or media traffic

By default, a possible RTMP publishing parameters are set according to SDP settings file. Since build 5.2.1862 the following option is added to enable automatic stream publishing parameters detection by stream metadata or media traffic data

Code Block
themeRDark
flash_detect_metadata_by_traffic=true

The option is enabled by default. In this case, WCS changes SDP according to a stream metadata received or, if there are no metadata in 1 second, according to media information from the stream media packets received.

Known issues

Excerpt Include
From another server via RTMP
From another server via RTMP
nopaneltrue

...