修复工作
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<el-row :gutter="10" >
|
||||
<el-col :span="24">
|
||||
<div @click="clickVideo(0)" class="selectVideo">
|
||||
<CusPlayer @clickPlayer="clickPlayer" ref="video"></CusPlayer>
|
||||
<JpegPlayer @clickPlayer="clickPlayer" ref="video"></JpegPlayer>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -46,6 +46,7 @@ import {ref, onMounted} from 'vue';
|
||||
import 'xgplayer';
|
||||
import FlvJsPlayer from 'xgplayer-flv.js';
|
||||
import CusPlayer from './cusPlayer.vue';
|
||||
import JpegPlayer from './jpegPlayer.vue';
|
||||
import {getDevice} from "@/api/video/device";
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
@@ -68,12 +69,11 @@ onMounted(() => {
|
||||
const getDetails = async (deviceId) => {
|
||||
const res = await getDevice(deviceId);
|
||||
tableData.value = res.data;
|
||||
// 直接访问后端视频流服务器(10083端口),绕过Nginx反代,避免缓冲问题
|
||||
// 注意:RTSP URL需要原样传递,不要编码,&&&作为特殊分隔符
|
||||
// 🔧 测试:使用 JavaCV 方案(不使用 FFmpeg)
|
||||
const videoServerUrl = 'http://49.232.154.205:10083';
|
||||
playUrl.value = `${videoServerUrl}/live?url=${tableData.value.url}`; // 不加 &&&ffmpeg=true
|
||||
console.log('📺 播放地址(JavaCV 方案):', playUrl.value);
|
||||
// 🔧 测试:使用 JavaCV 方案 + WebSocket(推送 JPEG 帧)
|
||||
// WebSocket 地址格式: ws://host:port/live?url=rtsp://...
|
||||
const videoServerUrl = 'ws://49.232.154.205:10083';
|
||||
playUrl.value = `${videoServerUrl}/live?url=${tableData.value.url}`;
|
||||
console.log('📺 播放地址(JavaCV WebSocket 方案):', playUrl.value);
|
||||
handlePlay();
|
||||
}
|
||||
|
||||
|
||||
@@ -214,6 +214,8 @@ public class MediaTransferFlvByJavacv extends MediaTransfer implements Runnable
|
||||
/** ================ 构造函数与初始化 ================ */
|
||||
public MediaTransferFlvByJavacv(CameraDto camera) {
|
||||
cameraDto = camera;
|
||||
running = true; // 初始化为 true,准备启动
|
||||
log.info("🎥 创建 JavaCV 媒体传输器: {}", camera.getUrl());
|
||||
}
|
||||
|
||||
public void setRun(boolean run) {
|
||||
|
||||
Reference in New Issue
Block a user