gpt4 book ai didi

electron - Electron中的RTSP(视频流)

转载 作者:行者123 更新时间:2023-12-03 12:37:58 28 4
gpt4 key购买 nike

我已经安装了fluent-ffmpegffmpeg-static以将流转换为HTML可复制的视频。如何使用这些软件包在客户端中显示流?
服务器端( main.js ):

const { app, BrowserWindow } = require('electron');
const ffmpeg = require('fluent-ffmpeg');
const ffmpegPath = require('ffmpeg-static').replace('app.asar', 'app.asar.unpacked');

ffmpeg.setFfmpegPath(ffmpegPath);

function createWindow () {

const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});

win.loadFile('index.html');
}

function testStream () {

let source = 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov';


}

app.whenReady().then(createWindow).then(testStream);
客户端( index.html ):
<!DOCTYPE html>
<html>
<head>
<meta charset = 'UTF-8'>
</head>
<body>
<h1>I want to reproduce the video here</h1>

</body>
</html>

最佳答案

如果我理解正确;您可能希望从以下内容开始:

    <video id="video-player" controls preload="none" style="border: 5px solid red; height: 1080px; width: 1920px; ">
<source src="index.m3u8" type="application/x-mpegURL">
</video>

关于electron - Electron中的RTSP(视频流),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65668422/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com