From 1ee76c252f2dbba62e0ec34cccf9eaac51de9083 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 23 七月 2025 16:25:23 +0800 Subject: [PATCH] 修改bug --- ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CarController.java | 50 -------------------------------------------------- 1 files changed, 0 insertions(+), 50 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CarController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CarController.java index e8e139c..f6725c7 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CarController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CarController.java @@ -1,6 +1,5 @@ package com.ruoyi.system.controller; -import cn.hutool.core.io.FileUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; @@ -22,7 +21,6 @@ import com.ruoyi.system.service.ICarTypeService; import com.ruoyi.system.service.IDriverService; import com.ruoyi.system.service.IEnterpriseService; -import com.ruoyi.system.util.JavaCVStreamUtil; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -34,15 +32,10 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.io.File; -import java.io.IOException; import java.math.BigDecimal; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** @@ -174,7 +167,6 @@ return R.fail("失败"); } String folderPath = hlsOutputPath + "hls\\" + car.getVehicleNumber(); - JavaCVStreamUtil.close(id, folderPath); return R.ok(); } @@ -310,48 +302,6 @@ car.setCompanyCode(enterprise.getCode()); } return R.ok(list); - } - - - public void live_hls(String input, Car car){ - String path = hlsOutputPath + "hls\\" + car.getVehicleNumber() + "\\live.m3u8"; - String folderPath = hlsOutputPath + "hls\\" + car.getVehicleNumber(); - FileUtil.mkParentDirs(path); - File file = new File(path); - if (!file.exists()) { - try { - file.createNewFile(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - //执行拉流和推流 - ExecutorService executorService = new ThreadPoolExecutor(1, 1, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<Runnable>()); - executorService.execute(new Runnable() { - @Override - public void run() { - JavaCVStreamUtil.push_hls(input, path, car.getId(), folderPath); - } - }); - carService.taskPlayDetection(car.getId()); - } - - public void live_flv(String input, Integer id){ - String url = "rtmp://" + flvIp + ":" + flvRtmpPort + "/flv/" + id; - //执行拉流和推流 - ExecutorService executorService = new ThreadPoolExecutor(1, 1, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<Runnable>()); - executorService.execute(new Runnable() { - @Override - public void run() { - JavaCVStreamUtil.push_flv(input, url, id); - } - }); - carService.taskPlayDetection(id); } -- Gitblit v1.7.1