当前位置: 首页 > news >正文

node-rtsp-stream、jsmpeg.min.js实现rtsp视频在web端播放

1. 服务地址(私有):https://gitee.com/nnlss/video-node-server
2.node-rtsp-stream 需要安装FFMPEG;
3.给推拉流做了开关,可借助http请求,有更好方式可联系;
 

4.存在问题:

1).对于网络摄像头,直接推拉流,测试6h+界面不卡顿,延迟1s以内(未精确测试延迟时间)

2).对于物料上的rstp, 由于工程师一直给rtsp推流,即便node服务结束进程,FFMPEG依然可以获取到rtsp

5.node 服务打包

  1. 安装ncc
    npm install -g @zeit/ncc

     2.安装成功

ncc version

     3. ncc 打包node 为单文件

ncc build index.js -o nodeServer

报错:

ncc: Version 0.22.3
ncc: Compiling file index.js
Error: error:0308010C:digital envelope routines::unsupported

原因:node 版本问题node.js - Error message "error:0308010C:digital envelope routines::unsupported" - Stack Overflow

利用nvm 切换版本 

nvm use 16.15.0

重新打包:

ncc build index.js -o nodeServer

生成文件目录nodeServer/index.js:

-nodeServer--index.js

cmd进入目录执行:

node index.js

启动服务成功

本地部署前后端配置nginx


#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       8081;server_name  localhost;#charset koi8-r;charset utf-8;#access_log  logs/host.access.log  main;location / {root dist;index index.html;try_files $uri $uri/ /index.html; # 解决前端界面刷新 路由重定向404问题}location /api/video/ {proxy_pass http://127.0.0.1:9998/video/;proxy_set_header Upgrade $http_upgrade; }location /dev-api/ {proxy_pass http://127.0.0.1:9000/;}client_max_body_size 10g;#error_page  404              /404.html;# redirect server error pages to the static page /50x.html## proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {#    listen       8000;#    listen       somename:8080;#    server_name  somename  alias  another.alias;#    location / {#        root   html;#        index  index.html index.htm;#    }#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}}

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • vue3 通过 axios + jsonp 实现根据公网 ip, 查询天气信息
  • 0基础学习HTML(十七)字符字体
  • 【Go】Go 环境下载与安装教程(Windows系统)
  • 【环境搭建】MySQL安装部署
  • 数据结构应试-1
  • linux驱动开发-arm汇编基础
  • 用javascript写一个网页,显示日期时间
  • 优化理论及应用精解【11】
  • 爬虫技术初步自学
  • 国产操作系统
  • Cubieboard2(六)RTL8188ETV 驱动
  • 怎样写论文及论文格式?分享4款ai论文生成软件
  • 面试金典题2.3
  • C++第2课——取余运算符的应用、浮点型和字符型(含视频讲解)
  • 工业数据采集系统
  • [分享]iOS开发-关于在xcode中引用文件夹右边出现问号的解决办法
  • bearychat的java client
  • Fundebug计费标准解释:事件数是如何定义的?
  • Java Agent 学习笔记
  • JavaScript-Array类型
  • JS字符串转数字方法总结
  • Magento 1.x 中文订单打印乱码
  • python 装饰器(一)
  • react 代码优化(一) ——事件处理
  • Spring声明式事务管理之一:五大属性分析
  • TCP拥塞控制
  • vue2.0一起在懵逼的海洋里越陷越深(四)
  • Vue组件定义
  • windows下如何用phpstorm同步测试服务器
  • 半理解系列--Promise的进化史
  • 将 Measurements 和 Units 应用到物理学
  • 盘点那些不知名却常用的 Git 操作
  • 扑朔迷离的属性和特性【彻底弄清】
  • 小程序01:wepy框架整合iview webapp UI
  • 小程序开发中的那些坑
  • 协程
  • “十年磨一剑”--有赞的HBase平台实践和应用之路 ...
  • 宾利慕尚创始人典藏版国内首秀,2025年前实现全系车型电动化 | 2019上海车展 ...
  • ​LeetCode解法汇总1410. HTML 实体解析器
  • ​sqlite3 --- SQLite 数据库 DB-API 2.0 接口模块​
  • # Redis 入门到精通(一)数据类型(4)
  • # 服务治理中间件详解:Spring Cloud与Dubbo
  • ######## golang各章节终篇索引 ########
  • #APPINVENTOR学习记录
  • #面试系列-腾讯后端一面
  • $.ajax()
  • (1)(1.8) MSP(MultiWii 串行协议)(4.1 版)
  • (Oracle)SQL优化技巧(一):分页查询
  • (pytorch进阶之路)扩散概率模型
  • (windows2012共享文件夹和防火墙设置
  • (草履虫都可以看懂的)PyQt子窗口向主窗口传递参数,主窗口接收子窗口信号、参数。
  • (附源码)springboot车辆管理系统 毕业设计 031034
  • (七)理解angular中的module和injector,即依赖注入
  • (三)SvelteKit教程:layout 文件
  • (图)IntelliTrace Tools 跟踪云端程序