Browse Source

Merge branch 'test' of https://gitee.com/hcst/adsp-boot into test

# Conflicts:
#	module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
xuzuoyun 5 years ago
parent
commit
c38eb7f7c9

+ 15 - 5
module-common/src/main/java/cn/com/ctop/common/module/utils/MpsUtils.java

@@ -26,11 +26,12 @@ public class MpsUtils {
 //        String[] a = {"1","2","3","4","5"};
 //        combinationSelect(a,3);
 //        arrangementSelect(a,3);
-        String t = "https://ctop-part.oss-cn-beijing.aliyuncs.com/input/VIDEO_HEAD/2019-12-11/25-1576044510677.mp4";
-        int i = t.indexOf("/",10);
-        System.out.println(t.substring(i+1,t.length()-1));
+//        String t = "https://ctop-part.oss-cn-beijing.aliyuncs.com/input/VIDEO_HEAD/2019-12-11/25-1576044510677.mp4";
+//        int i = t.indexOf("/",10);
+//        System.out.println(t.substring(i+1,t.length()-1));
 
-//        MpsUtils mpsUtils = new MpsUtils();
+        MpsUtils mpsUtils = new MpsUtils();
+        mpsUtils.videoWaterMark("video/2019-12-20/20%E7%BD%91%E6%9C%8D-1576822566069.mp4","watermark/water1080-1920.png","8bcf0c98021c40fc96a95d60f55b1f10",720);
 //        List<String> list = new ArrayList<>();
 //        list.add("v1.mp4");
 //        String jobId = mpsUtils.mergeOneVideo("v1.mp4",list,"v1.mp4");
@@ -274,10 +275,19 @@ public class MpsUtils {
         IAcsClient client = getClient();
         String pipelineId = getPipelineId(client);
         SubmitJobsRequest request = new SubmitJobsRequest();
+        JSONObject input = new JSONObject();
+        input.put("Location", ossLocation);
+        input.put("Bucket", "ctop-media");
+        try {
+            input.put("Object", URLEncoder.encode(videoPath, "utf-8"));
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("input URL encode failed");
+        }
+        request.setInput(input.toJSONString());
         JSONObject videoWatermarkInput = new JSONObject();
         videoWatermarkInput.put("Location", ossLocation);
         videoWatermarkInput.put("Bucket", "ctop-media");
-        videoWatermarkInput.put("Object", videoPath);
+        videoWatermarkInput.put("Object", waterMarkPath);
         JSONObject videoWatermark = new JSONObject();
         videoWatermark.put("WaterMarkTemplateId", watermarkTemplateId);
         videoWatermark.put("Type", "Image");