当前位置:网站首页>Browser plays RTSP video based on nodejs
Browser plays RTSP video based on nodejs
2022-06-30 12:19:00 【Wangxiaomin】
Browser play rtsp video , be based on nodeJs
1: install ffmpeg, And configure environment variables .
Download address :http://ffmpeg.zeranoe.com/builds/ perhaps :
Baidu cloud link :https://pan.baidu.com/s/1PBt18BHFGpdr0lpoUp5cKw
Extraction code :hx08
To configure :

Copy file address , Back to the desktop , Right click My computer / This computer , Click on Advanced system setup , senior , Click on environment variable
Click on path

Set the path

win + r Input cmd
Input ffmpeg enter

success
2:npm install node-rtsp-stream ws
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
node xx.js Start the service
3: html Page play video
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>
边栏推荐
- How do different types of variables compare with zero
- Shutter 007 input field from zero
- Redis的配置文件及新数据类型
- Hisilicon 3559 universal platform construction: introduction to YUV format
- 695. maximum island area
- 用于生成学习任务的量子神经网络2022最新综述
- 聊聊怎么做硬件兼容性检测,快速迁移到openEuler?
- Multiparty cardinality testing for threshold private set-2021: Interpretation
- Redis6学习笔记-第二章-Redis6的基本操作
- A Generic Deep-Learning-Based Approach for Automated Surface Inspection-论文阅读笔记
猜你喜欢

edusoho企培版纯内网部署教程(解决播放器,上传,后台卡顿问题)

Solve the problem that the server cannot be connected via SSH during reinstallation

服务器常用的一些硬件信息(不断更新)

使用深度学习进行生物网络分析

海思3559万能平台搭建:获取数据帧修改后编码

How can c write an SQL parser

lvgl 小部件样式篇

STM32 移植 RT-Thread 标准版的 FinSH 组件

A High-Precision Positioning Approach for Catenary Support Components With Multiscale Difference阅读笔记

STM32 porting the fish component of RT thread Standard Edition
随机推荐
Map collection
Redis - SDS simple dynamic string
Global capital market 101: Breit, one of the best investment targets for domestic high net worth people
这些电影中的科幻构想,已经用AI实现了
用于生成学习任务的量子神经网络2022最新综述
Achieve secure data sharing among multiple parties and solve the problem of asymmetric information in Inclusive Finance
[cloud native | kubernetes] in depth understanding of deployment (VIII)
Talk about how to do hardware compatibility testing and quickly migrate to openeuler?
[cf] 803 div2 A. XOR Mixup
Sword finger offer 05 Replace spaces: replace each space in the string s with "%20"“
Building a database model using power designer tools
90.(cesium篇)cesium高度监听事件
Hisilicon 3559 sample parsing: Venc
21、wpf之绑定使用小记
HMS core audio editing service 3D audio technology helps create an immersive auditory feast
Pinda general permission system (day 7~day 8)
【云原生 | Kubernetes篇】深入了解Deployment(八)
Serial communication interface 8250
Hisilicon 3559 developing common sense reserves: a complete explanation of related terms
The website with id 0 that was requested wasn‘t found. Verify the website and try again