Browse Source

工作空间 直播推流拉流测试

S0025136190 1 year ago
parent
commit
0a632b136e

+ 4 - 2
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/map/GroupTypeEnum.java

@@ -16,14 +16,16 @@ import java.util.Arrays;
         "(type=2 is an APP element group, PILOT will add map elements to this element group by default, " +
         "and there must be an APP shared element group. " +
         "It is recommended that in the same workspace, there are And there is only one APP shared element group)<p/>",
-        enumAsRef = true, type = "int", allowableValues = {"0", "1", "2"})
+        enumAsRef = true, type = "int", allowableValues = {"0", "1", "2", "3"})
 public enum GroupTypeEnum {
 
     CUSTOM(0),
 
     DEFAULT(1),
 
-    SHARED(2);
+    SHARED(2),
+
+    PICTURE(3);
 
     private final int type;
 

+ 4 - 2
Backend/sample/src/main/java/com/dji/sample/manage/service/impl/LiveStreamServiceImpl.java

@@ -74,7 +74,7 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
         }
 
         ILivestreamUrl url = LiveStreamProperty.get(liveParam.getUrlType());
-        url = setExt(liveParam.getUrlType(), url, liveParam.getVideoId());
+        //url = setExt(liveParam.getUrlType(), url, liveParam.getVideoId());
 
         TopicServicesResponse<ServicesReplyData<String>> response = abstractLivestreamService.liveStartPush(
                 SDKManager.getDeviceSDK(responseResult.getData().getDeviceSn()),
@@ -94,7 +94,9 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
             case AGORA:
                 break;
             case RTMP:
-                live.setUrl(url.toString().replace("rtmp", "webrtc"));
+                live.setUrl("webrtc://smsp.jkec.info:18000/rtc/stream_27");
+                //live.setUrl("webrtcs://smsp.jkec.info:4443/rtc/stream_27");
+//                live.setUrl(url.toString().replace("rtmp", "webrtc"));
                 break;
             case GB28181:
                 LivestreamGb28181Url gb28181 = (LivestreamGb28181Url) url;

+ 9 - 0
Backend/sample/src/main/java/com/dji/sample/map/service/impl/GroupServiceImpl.java

@@ -37,6 +37,7 @@ public class GroupServiceImpl implements IGroupService {
     private static final String PILOT_SHARE_LAYER = "默认文件夹";
     private static final String DEFAULT_LAYER = "默认标注";
     private static final String CUSTOM_FLIGHT_AREA = "自定义飞行范围";
+    private static final String PICTURE_SHARE_AREA = "图片标注";
 
     @Override
     public List<GetMapElementsResponse> getAllGroupsByWorkspaceId(String workspaceId, String groupId, Boolean isDistributed) {
@@ -66,6 +67,14 @@ public class GroupServiceImpl implements IGroupService {
                     .createTime(System.currentTimeMillis())
                     .updateTime(System.currentTimeMillis())
                     .build());
+            //创建图片标注文件夹
+            mapper.insert(GroupEntity.builder().groupId(UUID.randomUUID().toString())
+                    .groupName(PICTURE_SHARE_AREA)
+                    .groupType(GroupTypeEnum.PICTURE.getType())
+                    .workspaceId(workspaceId)
+                    .createTime(System.currentTimeMillis())
+                    .updateTime(System.currentTimeMillis())
+                    .build());
         }
     }
 

+ 2 - 2
Backend/sample/src/main/resources/application-test.yml

@@ -150,8 +150,8 @@ livestream:
 
     # RTMP  Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream.
     rtmp:
-      url: rtmp://203.156.230.22:19350/rlive/stream_27?sign=nwo03DJb&  # Example: 'rtmp://192.168.1.1/live/'
-#    rtsp:
+      url: rtmp://203.156.230.22:19350/rlive/stream_27?sign=nwo03DJb  # Example: 'rtmp://192.168.1.1/live/'
+    #    rtsp:
 #      username: Please enter the username.
 #      password: Please enter the password.
 #      port: 8554

+ 7 - 7
Web/src/api/http/config.ts

@@ -5,23 +5,23 @@ export const CURRENT_CONFIG = {
   appLicense: 'ZK7Dzih4Qc9JCZhDiyDsWJwTW+1rhnnzT1SqDxbdSPVV24bbDC4r1KNjXo7tIPBnPne7ipnXeefP0lJ0OHvxMpkKiag5lFCIndKSvYYdQkyScT3dahCXjmYsd0YyWyHj4tvXoR2DRVq1PdBHLB1iUo2FGLCIZ8QHbGyqglyGdHY=',
   // livestreaming
   // RTMP  Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream.
-  rtmpURL: 'Please enter the rtmp access address.', // Example: 'rtmp://192.168.1.1/live/'
+  rtmpURL: 'rtmp://203.156.230.22:19350/rlive/stream_27?sign=nwo03DJb', // Example: 'rtmp://192.168.1.1/live/'
   // GB28181 Note:If you don't know what these parameters mean, you can go to Pilot2 and select the GB28181 page in the cloud platform. Where the parameters same as these parameters.
-  gbServerIp: 'Please enter the server ip.',
+  /*gbServerIp: 'Please enter the server ip.',
   gbServerPort: 'Please enter the server port.',
   gbServerId: 'Please enter the server id.',
   gbAgentId: 'Please enter the agent id',
   gbPassword: 'Please enter the agent password',
   gbAgentPort: 'Please enter the local port.',
-  gbAgentChannel: 'Please enter the channel.',
+  gbAgentChannel: 'Please enter the channel.',*/
   // RTSP
-  rtspUserName: 'Please enter the username.',
+  /*rtspUserName: 'Please enter the username.',
   rtspPassword: 'Please enter the password.',
-  rtspPort: '8554',
+  rtspPort: '8554',*/
   // Agora
-  agoraAPPID: 'Please enter the agora app id.',
+  /*agoraAPPID: 'Please enter the agora app id.',
   agoraToken: 'Please enter the agora temporary token.',
-  agoraChannel: 'Please enter the agora channel.',
+  agoraChannel: 'Please enter the agora channel.',*/
   // 高德地图
   amapKey: '9ccf8815eb701c6aab8cd63e739df0fa',
 }

+ 1 - 1
Web/src/components/livestream-others.vue

@@ -206,7 +206,7 @@ const onStart = async () => {
   switch (livetypeSelected.value) {
     case 1: {
       // RTMP
-      liveURL = config.rtmpURL + timestamp
+      liveURL = config.rtmpURL //+ timestamp
       break
     }
     case 2: {

+ 1 - 1
Web/src/pages/page-pilot/pilot-liveshare.vue

@@ -163,7 +163,7 @@ const agoraParam = reactive({
   channelId: config.agoraChannel
 })
 const rtmpParam = {
-  url: config.rtmpURL + new Date().getTime()
+  url: config.rtmpURL //+ new Date().getTime()
 }
 const rtspParam: RTSPParam = {
   userName: CURRENT_CONFIG.rtspUserName,