赞
踩
docker run -it -d \
--restart always \
-p 8380:80 \
-p 1935:1935 \
--name nginx-http-flv \
mugennsou/nginx-http-flv
server {
listen 1935;
application demo {
live on;
gop_cache on;
#enable HLS ,主要就是增加如下配置
hls on;
hls_path /tmp/hls;
hls_fragment 3;
hls_playlist_length 20;
}
}
location /hls { # Disable cache add_header Cache-Control no-cache; # CORS setup add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Expose-Headers' 'Content-Length'; # allow CORS preflight requests if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } root /tmp/; add_header Cache-Control no-cache; }
nginx -t # 测试配置文件是否有误
nginx -s reload # 重新加载
ffmpeg -re -i H:\testvideo\h265_high.mp4 -vcodec copy -acodec copy -f flv rtmp://192.168.25.105:1935/demo/stream-1
ffmpeg -list_devices true -f dshow -i dummy
ffmpeg -f dshow -i video="Integrated Camera":audio="麦克风阵列 (Realtek High Definition Audio)" -vcodec libx264 -acodec copy -preset:v ultrafast -tune:v zerolatency -f flv "rtmp://192.168.25.105:1935/demo/stream-1"
obs推流相对来说很简单,主要就是配置一下这里即可
如果想推相机的流直接增加一个视频捕获设备即可,如下图
https://github.com/mugennsou/http-flv
https://blog.csdn.net/yelin042/article/details/78434454
搭建HLS直播测试环境 - 简书 https://www.jianshu.com/p/4006d47eccf9
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。