HOME > EN > Time Jitter
This article describes the timestamp correct of SRS.
RTMP requires the timestamp is mono-inc(monotonically increase). The mono-inc is the timestamp of packet is always larger.
RTMP requires the stream is mono-inc. The audio is mono-inc, video is mono-inc, and stream mixed audio with video is mono-inc.
What happens when not mono-inc? Some server will disconnect connection, flash maybe failed to play stream.
SRS will ensure the stream timestamp is mono-inc. When delta of packets too large, set to 40ms(fps 25).
Some components use the timestamp jitter:
time_jitter
.time_jitter
.full
timestamp jitter algorithm.full
timestamp jitter algorithm.fast_cache
.You can disable the timestamp jitter algorithm when your encoder can not ensure the video+autio mono-inc, some encoder can ensure video mono-inc and audio mono-inc.
Config the timestamp jitter in vhost for RTMP delivery:
vhost jitter.srs.com {
# about the stream monotonically increasing:
# 1. video timestamp is monotonically increasing,
# 2. audio timestamp is monotonically increasing,
# 3. video and audio timestamp is interleaved monotonically increasing.
# it's specified by RTMP specification, @see 3. Byte Order, Alignment, and Time Format
# however, some encoder cannot provides this feature, please set this to off to ignore time jitter.
# the time jitter algorithm:
# 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
# 2. zero, only ensure sttream start at zero, ignore timestamp jitter.
# 3. off, disable the time jitter algorithm, like atc.
# default: full
time_jitter full;
# whether use the mix algorithm to correct the timestamp.
# if on, always ensure the timestamp of audio+video is monotonically increase.
# if off, use time_jitter to correct the timestamp if required.
# default: off
mix_correct off;
}
While the mix_correct
of vhost can correct the audio+video stream to mixed monotonically increase.
Config timestamp jitter for dvr:
vhost dvr.srs.com {
# dvr RTMP stream to file,
# start to record to file when encoder publish,
# reap flv according by specified dvr_plan.
# http callbacks:
# @see http callback on_dvr_hss_reap_flv on http_hooks section.
dvr {
# about the stream monotonically increasing:
# 1. video timestamp is monotonically increasing,
# 2. audio timestamp is monotonically increasing,
# 3. video and audio timestamp is interleaved monotonically increasing.
# it's specified by RTMP specification, @see 3. Byte Order, Alignment, and Time Format
# however, some encoder cannot provides this feature, please set this to off to ignore time jitter.
# the time jitter algorithm:
# 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
# 2. zero, only ensure sttream start at zero, ignore timestamp jitter.
# 3. off, disable the time jitter algorithm, like atc.
# default: full
time_jitter full;
}
}
When RTMP ATC is on, RTMP always disable the time_jitter.
Winlin 2015.4
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。