推流URL格式通常为:rtmp://your_server_ip/live/STREAM_KEY,其中STREAM_KEY为自定义的推流密钥。 配置HLS直播播放 设置HLS支持 在相应的RTMP应用配置中启用HLS并指定HLS文件存储的路径: applicationlive {liveon;recordoff;# 启用HLShlson;hls_path/var/www/html/hls;hls_fragment3s;hls_playlist_length60s; } ...
hls_path d:/tmp/hls; hls_fragment 1s; hls_cleanup on; hls_playlist_length 1s; } hls_path:hls 路径路径 设置HLS播放列表和片段目录。 如果目录不存在,它将被创建。 hls_cleanup: on|off 默认是开着的,是否删除列表中已经没有的媒体块 hls_fragment:hls_fragment 片段时间 设置HLS片段长度。 默认为5...
这里需要配置RTMP服务相关参数,开启RTMP实时推拉流,开启HLS,配置HLS切片及播放列表索引文件存放路径、切片长度、播放列表长度: application live { ##开启RTMP实时流推流和拉流服务,地址格式:rtmp://ip:1935/live/xxx live on; ##开启HLS切片服务 hls on; ##HLS切片保存路径 hls_path /tmp/hls; hls_fragment 4...
hls_path/usr/local/nginx/html/hls; hls_fragment 5s; } } } http { server { listen 8080; location/hls{ # Serve HLS fragments types { application/vnd.apple.mpegurl m3u8; video/mp2tts; } root html; expires -1; } } server { listen 8081; ...
一、在Nginx配置文件的RTMP模块中配置hls hls_key_path /tmp/hlskeys; 提示错误信息: nginx: [emerg] the same path name "/data/hlskeys" used in /usr/local/nginx/conf/nginx.conf:178 and in /usr/local/nginx/conf/nginx.conf:178 1.
一、在Nginx配置文件的RTMP模块中配置hls hls_key_path /tmp/hlskeys; 提示错误信息: nginx: [emerg]the same path name "/data/hlskeys" usedin /usr/local/nginx/conf/nginx.conf:178 and in /usr/local/nginx/conf/nginx.conf:178 解决办法: ...
# HLS # HLS requires libavformat & should be configured as a separate # NGINX module in addition to nginx-rtmp-module: # ./configure …–add-module=/path/to/nginx-rtmp-module/hls … # For HLS to work please create a directory in tmpfs (/tmp/app here) ...
live on;hls on;hls_path/usr/share/nginx/html/hls;hls_fragment 5s;}}} 其中,hls_path需要可读可写的权限。接下来,我们创建/usr/share/nginx/html/hls 目录。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 mkdir-p/usr/share/nginx/html/hls ...
hls_path/opt/video/hls;#切片视频文件存放位置。 hls_fragment 10s;#每个视频切片的时长。 hls_playlist_length 60s;#总共可以回看的事件,这里设置的是1分钟。 hls_continuous on;#连续模式。 hls_cleanup on;#对多余的切片进行删除。 hls_nested on;#嵌套模式。}}}http{include mime.types;default_type app...
rtmp { server { listen 1935; chunk_size 4000; drop_idle_publisher 10s; idle_streams off; application live { live on; } application hls { live on; hls on; hls_path /tmp/hls; } # MPEG-DASH is similar to HLS application dash { live on; dash on; dash_path /tmp/dash; } } } 1...