Explorar el Código

调整腾讯云抽帧

yumeng hace 4 años
padre
commit
7e800db326

+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -356,8 +356,10 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
     private void getCut(String materialId, String videoUrl, String loadImage, Integer count) {
         try {
             Map<String, Object> coverMap = CloudVideoProcessUtil.videoCutFrameHandle(videoUrl, loadImage);
-            if (Check.isNullMap(coverMap) && count < 4) {
+            if (count < 4) {
                 getCut(materialId, videoUrl, loadImage, count + 1);
+            } else {
+                return;
             }
 
             if (Check.isNullMap(coverMap)) {

+ 7 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/CloudVideoProcessUtil.java

@@ -140,6 +140,12 @@ public class CloudVideoProcessUtil {
         }
     }
 
+    public static void main(String[] args) {
+        String loadImage = "cutFrame/" + 12345 + "/${Number}.jpg";
+        Map<String, Object> stringObjectMap = videoCutFrameHandle("/video/2020-07-22/1595381635927-JX.美白丸混剪.mp4", loadImage);
+        System.err.println(stringObjectMap);
+    }
+
     /**
      * 数据万象发起视频抽帧处理请求
      */
@@ -180,7 +186,7 @@ public class CloudVideoProcessUtil {
         Map JobsDetail = (Map) ((Map) mapResp.get("Response")).get("JobsDetail");
         if (JobsDetail.get("Code").equals("Success")) {
             Map jobStatusMap = null;
-            for (int i = 0; i < 10; i++) {
+            for (int i = 0; i < 30; i++) {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {