here is my config file:
#user nobody;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
}
# rtmp control
location /control {
rtmp_control all;
}
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root F:/PD/Temp;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
rtmp {
server {
listen 1935;
chunk_size 4096;
buflen 10s;
application live {
allow publish all;
allow play all;
live on;
record off;
drop_idle_publisher 5s;
hls on;
hls_sync 100ms;
hls_path F:/PD/Temp/hls;
hls_fragment 2s;
hls_playlist_length 10m;
}
}
}在使用adobe实时媒体编码器和obc作为编码器时,我尝试使用vlc和浏览器中的rtmp播放器。两者都给了我可变的延迟。那么,我在哪里可以调整以减少延迟。我只想要零延迟,我的应用程序将完全是本地(LAN)没有互联网流
发布于 2017-02-07 22:26:16
在这方面,有三个因素很重要:
1)播放列表的大小(以秒为单位)
如果播放列表有10秒(您的列表有10分钟),rtmp模块必须等待10秒的摄入流才能生成10秒的片段,对吗?如果rtmp帧尚未到达,则无法生成10秒的片段。
2)第二代片段的大小
当你的播放列表准备好交付时(比如说10秒),你必须有10秒的片段。因此,您有以下选择: 10 /1=1片段/10秒,10 /2=2片段/5秒,10 /3=3片段/ 3.33秒(这不是很好),但.
3) 关键帧
每个片段被一个关键帧打破,所以如果你的播放列表有10秒的话,你必须调整你的编码器,每隔1,2或5秒添加一个关键帧。如果您的播放列表有12秒,您必须调整您的编码器,以添加一个关键帧每1,2,3,4,6或12。
简历:
hls_playlist_length 6s;
hls_fragment 2s;包含3个片段的播放列表的enconder关键帧=2。
延迟= +- 8秒。
https://stackoverflow.com/questions/41401787
复制相似问题