ws-rtsp-cus
v1.0.4
Published
流媒体服务
Downloads
2
Maintainers
Readme
安装前, 电脑必须要有 node 环境 pm2 和 ffmpeg , ffmpeg 版本: 当前测试的版本是 ffmpeg version 4.3.2-2021-02-27-essentials_build;
项目移植于 github.com/2547881370/ws-rtsp,修改了 ffmpeg 参数
安装
1、npm i ws-rtsp-cus
使用 demo
// node /app.js
var http = require('http');
var rtsp = require('ws-rtsp');
var server = http.createServer();
new rtsp.StreamingMediaServer(server);
server.listen(8089);
// index.html
<html>
<body>
<button onclick="player()">播放</button>
<canvas id="canvas"></canvas>
</body>
<script type="text/javascript" src="./js/jsmpeg.min.js"></script>
<script type="text/javascript">
function player() {
new JSMpeg.Player('ws://localhost:8089/flv?url=cnRzcDovL2FkbWluOjEyMzQ1NmFhQDE3Mi4xNi4xLjcwL1N0cmVhbWluZy9DaGFubmVscy8xMDE=&channelid=2', {
canvas: document.getElementById('canvas'),
})
}
</script>
</html>