play{gop_cache_max_frames2500;# 播放缓存的 GOP 帧数,越高会增加启动流播放的延迟,但能提高流畅度}} 说明支持 RTMP、HTTP-FLV、HLS 和 WebRTC 等,且 SRS 默认会有一个 live 应用不会显式列出,rtmp://localhost/live/livestream 就是推流和拉流的默认路径,如果你想要自定义流路径,可以在 vhost 下添加新...
在ngx_rtmp_session_t增加gop相关的字段: typedef struct { ... /* gop cache */ /*save gop frames array, can be reuesd */ ngx_rtmp_gop_frame_t *gop_array; /* gop frames chain*/ ngx_rtmp_gop_frame_t *gop_chain; /* current cached frame count */ ngx_int_t gop_frame_cnt; /* ...
也正是在调试这个bug的过程中,发现nginx-http-flv-module在打开gop_cache配置项的情况下,flv.js跟其他主流的播放器(如vlc)相比,首屏时间是最快的,几乎没有延迟,使用的pull源是中国香港卫视的直播源:rtmp://live.hkstv.hk.lxdns.com/live/hks。 2018-03-27更新: 顺手改点代码就有bug,真是恼火。最近为了响...
gop_cache on; #打开 GOP 缓存,减少首屏等待时间 max_connections 1024; push 192.168.2.238:1936;#推流到别的服务器,可以多台,写多行 # execffmpeg-re -i rtmp://localhost:1935/$app/$name -vcodec libx264 -acodec aac -f flv rtmp://localhost:1939/$app/${name};#上面的push向ZLMediaKit推送有...
gop_cache off; } } } 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"'; ...
gop_cache on; } } #以下配置项已废弃,原因在下文更新中 upstream backend { #开启负载均衡 server host1:port1; server host2:port2; } } 启动Nginx,在vlc播放器中以“网络”方式打开媒体,填入http://localhost/live?stream=hks即可。 通用URL:http://example.com[:port]/dir?[srv=index&app=xxx&]str...
gop_cache on;#打开GOP缓存,减少首屏等待时间 } } server { listen 1935; server_name www.test.com;#用于虚拟主机名完全匹配 application myapp { live on; gop_cache on;#打开GOP缓存,减少首屏等待时间 } } } events { worker_connections1024;#Nginx处理的最大连接数 ...
gop_cache on; publish_notify on; on_publish http://172.16.70.234:8080/swms/oa/index_notifyLiveStart.action; #on_update http://172.16.70.234:8080/swms/oa/index_notifyLiveStart.action; on_publish_done http://172.16.70.234:8080/swms/oa/index_notifyLiveStop.action; ...
gop_cache on; #打开 GOP 缓存,减少首屏等待时间 } application hls { live on; hls on; hls_path /tmp/hls; } application dash { live on; dash on; dash_path /tmp/dash; } } server { listen 1935; server_name *.test.com; #用于虚拟主机名前缀通配 ...
#include "ngx_rtmp_gop_cache_module.h" static ngx_rtmp_publish_pt next_publish; static ngx_rtmp_play_pt next_play; static ngx_rtmp_close_stream_pt next_close_stream; static ngx_rtmp_gop_frame_t *ngx_rtmp_gop_cache_alloc_frame( ...