海康威视直播推流

本文介绍了如何使用nginx-http-flv-module在服务器上转发码流,配合flv.js实现web直播。详细步骤包括配置nginx,使用ffmpeg和VLC进行推流和显示,以及通过脚本自动化部署。
摘要由CSDN通过智能技术生成

一、nginx-http-flv-module转发码流,web使用flv.js直播码流

端口按照nginx.conf里面配置

拉取镜像
docker pull mycujoo/nginx-http-flv-module
启动容器
docker run -d -p 8001:8001 -p 8002:8002 --name http-flv -v /root/video:/root mycujoo/nginx-http-flv-module:latest
进入容器
docker exec -it http-flv sh
打开配置文件
vi /opt/nginx/nginx.conf

修改配置文件

daemon off;
​
error_log /var/log/nginx/error.log warn;
​
events {
    worker_connections 1024;
}
​
rtmp {
​
    out_queue   4096;
    out_cork    8;
    max_streams 64;
​
​
    server {
        listen 8001;
        access_log off; # 取消操作日志
        application live {
            live on;
            gop_cache on; #open GOP cache for reducing the wating time for the first picture of video
        }
    }
}
​
http {
    server {
        listen 8002;
        access_log off; # 取消操作日志
        location /live {
            flv_live on; #open flv live streaming (subscribe)
            chunked_transfer_encoding  on; #open 'Transfer-Encoding: c
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值