ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
@@ -41,7 +41,8 @@ @Value("${mediamtx.host}") String mediamtxHost; @Value("${mediamtx.ffmpegPath}") String ffmpegPath; /** * 添加流媒体 @@ -66,9 +67,9 @@ if (isCode.equals("1")) { conf.setSource("publisher"); //默认软解码 String cmd = "ffmpeg -rtsp_transport tcp -i " + sourceUrl + " -vcodec libx264 -preset:v ultrafast -r 25 -keyint_min 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; String cmd = ffmpegPath + "/ffmpeg -rtsp_transport tcp -i " + sourceUrl + " -vcodec libx264 -preset:v ultrafast -r 25 -keyint_min 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; if (mode.equals("0")) {//硬解码 cmd = rootPath + "ffmpeg -hwaccel cuvid -c:v hevc_cuvid -rtsp_transport tcp -i " + sourceUrl + " -c:v h264_nvenc -r 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -bf 0 -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; cmd = ffmpegPath + "/ffmpeg -hwaccel cuvid -c:v hevc_cuvid -rtsp_transport tcp -i " + sourceUrl + " -c:v h264_nvenc -r 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -bf 0 -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; } conf.setRunOnDemand(cmd); conf.setRunOnDemandRestart(true); @@ -106,13 +107,13 @@ String webrtcUrl = "http://" + mediamtxHost + ":8889/" + name; Conf conf = new Conf(); String rootPath = System.getProperty("user.dir").replaceAll("\\\\", "/") + "/lib/mediamtx/"; String rootPath = System.getProperty("user.dir").replaceAll("\\\\", "/") + "/server/mediamtx/"; if (isCode.equals("1")) { conf.setSource("publisher"); //默认软解码 String cmd = "ffmpeg -rtsp_transport tcp -i " + sourceUrl + " -vcodec libx264 -preset:v ultrafast -r 25 -keyint_min 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; String cmd = ffmpegPath + "/ffmpeg -rtsp_transport tcp -i " + sourceUrl + " -vcodec libx264 -preset:v ultrafast -r 25 -keyint_min 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; if (mode.equals("0")) {//硬解码 cmd = "ffmpeg -hwaccel cuvid -c:v hevc_cuvid -rtsp_transport tcp -i " + sourceUrl + " -c:v h264_nvenc -r 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -bf 0 -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; cmd = ffmpegPath + "/ffmpeg -hwaccel cuvid -c:v hevc_cuvid -rtsp_transport tcp -i " + sourceUrl + " -c:v h264_nvenc -r 25 -g 60 -sc_threshold 0 -threads 6 -b:v 2048k -bf 0 -acodec opus -strict -2 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH"; } conf.setRunOnDemand(cmd); conf.setRunOnDemandRestart(true); ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
@@ -1,6 +1,9 @@ package com.ruoyi.web.controller.system; import java.util.List; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -27,6 +30,7 @@ * * @author ruoyi */ @Api(tags = "部门信息") @RestController @RequestMapping("/system/dept") public class SysDeptController extends BaseController @@ -67,7 +71,16 @@ deptService.checkDeptDataScope(deptId); return success(deptService.selectDeptById(deptId)); } /** * 根据部门编号获取详细信息 */ @ApiOperation("根据部门编号获取详细信息无数据权限") @PreAuthorize("@ss.hasPermi('system:dept:query')") @GetMapping(value = "/NoDataScope/{deptId}") public AjaxResult getInfoNoDataScope(@PathVariable Long deptId) { return success(deptService.selectDeptById(deptId)); } /** * 新增部门 */ ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -235,12 +235,22 @@ */ @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/deptTree") @ApiOperation("获取部门树列表") public AjaxResult deptTree(SysDept dept) { return success(deptService.selectDeptTreeList(dept)); } /** * 获取部门树列表 */ @GetMapping("/deptTreeNoDataScope") @ApiOperation("获取部门树列表无数据权限") public AjaxResult deptTree1(SysDept dept) { return success(deptService.selectDeptTreeListNoDataScope(dept)); } /** * 获取部门树列表 */ @ApiOperation("获取部门树列表noPerm") @GetMapping("/deptTree/noPerm") public AjaxResult deptTreeNoPerm(SysDept dept) { return success(deptService.selectDeptTreeList(dept)); ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -20,7 +20,7 @@ * @return 部门信息集合 */ public List<SysDept> selectDeptList(SysDept dept); public List<SysDept> selectDeptListNoDataScope(SysDept dept); /** * 根据角色ID查询部门树信息 * ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
@@ -32,7 +32,7 @@ * @return 部门树信息集合 */ public List<TreeSelect> selectDeptTreeList(SysDept dept); public List<TreeSelect> selectDeptTreeListNoDataScope(SysDept dept); /** * 构建前端所需要树结构 * ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -62,6 +62,12 @@ return buildDeptTreeSelect(depts); } @Override public List<TreeSelect> selectDeptTreeListNoDataScope(SysDept dept) { List<SysDept> depts = deptMapper.selectDeptListNoDataScope(dept); return buildDeptTreeSelect(depts); } /** * 构建前端所需要树结构 * ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -46,7 +46,23 @@ ${params.dataScope} order by d.parent_id, d.order_num </select> <select id="selectDeptListNoDataScope" parameterType="SysDept" resultMap="SysDeptResult"> <include refid="selectDeptVo"/> where d.del_flag = '0' <if test="deptId != null and deptId != 0"> AND dept_id = #{deptId} </if> <if test="parentId != null and parentId != 0"> AND parent_id = #{parentId} </if> <if test="deptName != null and deptName != ''"> AND dept_name like ('%${deptName}%') </if> <if test="status != null and status != ''"> AND status = #{status} </if> order by d.parent_id, d.order_num </select> <select id="selectDeptListByRoleId" resultType="Long"> select d.dept_id from sys_dept d server/mediamtx/ffmpeg.exeBinary files differ