当前位置: 首页 > 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;#    }#}}

http://www.lryc.cn/news/448239.html

相关文章:

  • C++ 9.27
  • 让具身智能更快更强!华东师大上大提出TinyVLA:高效视觉-语言-动作模型,遥遥领先
  • Excel 获取某列不为空的值【INDEX函数 | SMALL函数或 LARGE函数 | ROW函数 | ISBLANK 函数】
  • 爆火!大模型算法岗 100 道面试题全解析,赶紧收藏!
  • Python画笔案例-068 绘制漂亮米
  • 得物App荣获国家级奖项,正品保障引领潮流电商新风尚
  • 【BurpSuite】SQL注入 | SQL injection(1-2)
  • ThreadPoolExecutor有哪些核心的配置参数?
  • 关于工作虚拟组的一些思考
  • 【Redis入门到精通六】在Spring Boot中集成Redis(含配置和操作演示)
  • 【CSS】透明度 、过渡 、动画 、渐变
  • 尚硅谷vue3+TypeScript笔记大全
  • New major version of npm available! 8.3.1 -> 10.8.3 报错
  • Python(七)- 文件操作
  • Docker技术深度解析与实践案例
  • llama_deploy
  • 平衡二叉搜索树插入的实现
  • ROS理论与实践学习笔记——2 ROS通信机制之通信机制实践
  • CDGA|数据治理:策略与价值的深度融合
  • 49. 建模软件绘制3D场景(Blender)
  • 如何使用 DomCrawler 进行复杂的网页数据抓取?
  • 维修服务品牌小程序渠道客获
  • 【全新课程】正点原子《基于GD32 ARM32单片机项目实战入门》培训课程上线!
  • Kafka系列之:安装使用kafka_exporter详细步骤
  • Paddlets时间序列集成模型回测实战:MLPRegressor、NHiTSModel与RNNBlockRegressor
  • 【anki】显示 “连接超时,请更换网络后重试” 怎么办
  • 第一批学习大模型的程序员,已经碾压同事了,薪资差距都甩出一条街了...
  • Unity NetCode 客户端连接不上服务器,局域网模式 Failed to connect to server.
  • C++远端开发环境安装(centos7)
  • LaTeX 编辑器-TeXstudio