当前位置:网站首页>浏览器播放rtsp视频,基于nodeJs
浏览器播放rtsp视频,基于nodeJs
2022-06-30 11:54:00 【汪小敏同学】
浏览器播放rtsp视频,基于nodeJs
1:安装ffmpeg,并且配置环境变量。
下载地址:http://ffmpeg.zeranoe.com/builds/ 或者:
百度云链接:https://pan.baidu.com/s/1PBt18BHFGpdr0lpoUp5cKw
提取码:hx08
配置:
复制文件地址,返回桌面,右键我的电脑/此电脑,点击高级系统设置,高级,点击环境变量
点击path
设置路径
win + r 输入cmd
输入ffmpeg 回车
成功
2:npm install node-rtsp-stream ws
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
node xx.js 启动服务
3: html页面播放视频
jsmpeg/jsmpeg.min.js at master · phoboslab/jsmpeg · GitHub
<!DOCTYPE html> <html> <head> <title>JSMpeg Stream Client</title> <style type="text/css"> *{ padding: 0; margin: 0; } .container{ margin: 0 auto; } canvas{ background-color: aqua; display: block; margin: 10px 0; } </style> </head> <body> <div class="container"> <canvas id="video-canvas" width="1366" height="750" style="width:980px;height:544px"></canvas> </div> <script type="text/javascript" src="./scripts/jsmpeg.js"></script> <script type="text/javascript"> const width = document.body.clientWidth; const height = document.body.clientHeight; console.log(width,height) const canvas = document.getElementById('video-canvas'); console.log(document.location.hostname) var urls = 'ws://localhost:9998'; var players = new JSMpeg.Player(urls, {canvas: canvas}); </script> </body> </html>
边栏推荐
- Boost研究:Boost Log
- 会议预告 | 华为 2012 实验室全球软件技术峰会-欧洲分会场
- 再不上市,旷视科技就熬不住了
- R language ggplot2 visualization: use ggplot2 to visualize the scatter diagram, and_ Set the alpha parameter in the point parameter to specify the transparency level of data points (points transparent
- He was the first hero of Shanghai's two major industries, but died silently in regret
- 【云原生 | Kubernetes篇】深入了解Deployment(八)
- A high precision positioning approach for category support components with multiscale difference reading notes
- 用于生成学习任务的量子神经网络2022最新综述
- 【LeetCode】15、三数之和
- 1175. 质数排列
猜你喜欢
使用深度学习进行生物网络分析
Beego development blog system learning (II)
wallys/IPQ8074a/2x(4×4 or 8×8) 11AX MU-MIMO DUAL CONCURRENT EMBEDDEDBOARD
Review the writing software with characteristics
60 divine vs Code plug-ins!!
【LeetCode】15、三数之和
会议预告 | 华为 2012 实验室全球软件技术峰会-欧洲分会场
led背光板的作用是什麼呢?
Another miserable day by kotlin grammar
STM32 porting the fish component of RT thread Standard Edition
随机推荐
他是上海两大产业的第一功臣,却在遗憾中默默离世
How can c write an SQL parser
Speech recognition - Fundamentals (I): introduction [speech to text]
Getting started with the go language is simple: go handles XML files
R语言ggplot2可视化:使用ggplot2可视化散点图、使用scale_x_log10函数配置X轴的数值范围为对数坐标
OpenMLDB Meetup No.4 会议纪要
The sci-fi ideas in these movies have been realized by AI
3D线光谱共焦传感器在半导体如何检测
用宝塔建第2个网站时网站总是报错:No input file specified.
Embedded sig | multi OS hybrid deployment framework
R language ggplot2 visualization: use ggplot2 to visualize the scatter diagram and use scale_ color_ viridis_ D function specifies the color scheme of data points
R language ggplot2 visualization: gganimate package is based on Transition_ The time function creates a dynamic scatter graph animation (GIF), and uses the labs function to add a dynamic time title to
MySQL 内置函数
After the node is installed in the NVM, the display is not internal or external when the NPM instruction is used
Redis - ziplist compressed list
R language ggplot2 visual Facet: gganimate package is based on Transition_ The time function creates a dynamic scatter graph animation (GIF) and uses the labs function to add a dynamic time title to t
Flutter 从零开始 007 输入框
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
Embedded SIG | 多 OS 混合部署框架
3D视觉检测在生产流水的应用有哪些