Przeglądaj źródła

Merge pull request #785 from xiaoQQya/wvp-28181-2.0

新增对 H265 编码视频截图的支持
648540858 2 lat temu
rodzic
commit
ed08c7ef77

+ 4 - 2
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java

@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.common;
 import io.swagger.v3.oas.annotations.media.Schema;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 @Schema(description = "流信息")
 public class StreamInfo implements Serializable, Cloneable{
@@ -168,7 +169,7 @@ public class StreamInfo implements Serializable, Cloneable{
     }
 
     public void setRtmp(String host, int port, int sslPort, String app, String stream, String callIdParam) {
-        String file = String.format("%s/%s/%s", app, stream, callIdParam);
+        String file = String.format("%s/%s%s", app, stream, callIdParam);
         if (port > 0) {
             this.rtmp = new StreamURL("rtmp", host, port, file);
         }
@@ -178,7 +179,7 @@ public class StreamInfo implements Serializable, Cloneable{
     }
 
     public void setRtsp(String host, int port, int sslPort, String app, String stream, String callIdParam) {
-        String file = String.format("%s/%s/%s", app, stream, callIdParam);
+        String file = String.format("%s/%s%s", app, stream, callIdParam);
         if (port > 0) {
             this.rtsp = new StreamURL("rtsp", host, port, file);
         }
@@ -237,6 +238,7 @@ public class StreamInfo implements Serializable, Cloneable{
     }
 
     public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) {
+        callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&");
         String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam);
         if (port > 0) {
             this.rtc = new StreamURL("http", host, port, file);

+ 2 - 2
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java

@@ -323,9 +323,9 @@ public class ZLMRESTfulUtils {
         sendPost(mediaServerItem, "kick_sessions",param, null);
     }
 
-    public void getSnap(MediaServerItem mediaServerItem, String flvUrl, int timeout_sec, int expire_sec, String targetPath, String fileName) {
+    public void getSnap(MediaServerItem mediaServerItem, String streamUrl, int timeout_sec, int expire_sec, String targetPath, String fileName) {
         Map<String, Object> param = new HashMap<>(3);
-        param.put("url", flvUrl);
+        param.put("url", streamUrl);
         param.put("timeout_sec", timeout_sec);
         param.put("expire_sec", expire_sec);
         sendGetForImg(mediaServerItem, "getSnap", param, targetPath, fileName);

+ 1 - 0
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java

@@ -547,6 +547,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
 
         Map<String, Object> param = new HashMap<>();
         param.put("api.secret",mediaServerItem.getSecret()); // -profile:v Baseline
+        param.put("ffmpeg.snap", "%s -rtsp_transport tcp -i %s -y -f mjpeg -t 0.001 %s");
         param.put("hook.enable","1");
         param.put("hook.on_flow_report","");
         param.put("hook.on_play",String.format("%s/on_play", hookPrex));

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java

@@ -266,7 +266,7 @@ public class PlayServiceImpl implements IPlayService {
                 onPublishHandlerForPlay(mediaServerItemInuse, response, device.getDeviceId(), channelId);
                 hookEvent.response(mediaServerItemInuse, response);
                 logger.info("[点播成功] deviceId: {}, channelId: {}", device.getDeviceId(), channelId);
-                String streamUrl = String.format("http://127.0.0.1:%s/%s/%s.live.flv", mediaServerItemInuse.getHttpPort(), "rtp",  ssrcInfo.getStream());
+                String streamUrl = String.format("rtsp://127.0.0.1:%s/%s/%s", mediaServerItemInuse.getRtspPort(), "rtp",  ssrcInfo.getStream());
                 String path = "snap";
                 String fileName = device.getDeviceId() + "_" + channelId + ".jpg";
                 // 请求截图

+ 1 - 1
web_src/src/components/channelList.vue

@@ -69,7 +69,7 @@
             <span v-if="scope.row.longitude*scope.row.latitude === 0">无</span>
           </template>
         </el-table-column>
-        <el-table-column prop="ptztypeText" label="云台类型" min-width="120"/>
+        <el-table-column prop="PTZTypeText" label="云台类型" min-width="120"/>
         <el-table-column label="开启音频" min-width="120">
           <template slot-scope="scope">
             <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">

+ 1 - 7
web_src/src/components/common/jessibuca.vue

@@ -167,13 +167,7 @@ export default {
         _this.isNotMute = !msg;
       });
       jessibuca.on("audioInfo", function (msg) {
-        // console.log("audioInfo", msg);
-      });
-
-      jessibuca.on("videoInfo", function (msg) {
-        // this.videoInfo = msg;
-        console.log("videoInfo", msg);
-
+        console.log("audioInfo", msg);
       });
 
       jessibuca.on("bps", function (bps) {