Quellcode durchsuchen

视频获取编码、转码受视频类型影响(去除)

tags/正式3.14.1
王宁 vor 3 Monaten
Ursprung
Commit
52126ead6e

+ 2
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionClassService.java Datei anzeigen

@@ -221,7 +221,7 @@ public class QuestionClassService {
221 221
 
222 222
     //视频转换mq
223 223
     private void convertVideo(TQuestionExplain research) {
224
-        if ("mp4".equals(research.getSuffix()) && !"h264".equals(research.getMp4code())) {
224
+        if (!"h264".equals(research.getMp4code())) {
225 225
             messageSender.convertVideo(research.getQcpid(), research.getFilepath(), "explain");
226 226
         }
227 227
     }
@@ -375,7 +375,7 @@ public class QuestionClassService {
375 375
         List<TQuestionExplain> list = questionExplainMapper.listByQuestionId(questionExplain.getQuestionid(),questionExplain.getQctype());
376 376
         if(list!=null && list.size()>0){
377 377
             for(TQuestionExplain qe : list){
378
-                if ("mp4".equals(qe.getSuffix()) && !"h264".equals(qe.getMp4code())) {
378
+                if (!"h264".equals(qe.getMp4code())) {
379 379
                     messageSender.convertVideo(qe.getQcpid(), qe.getFilepath(), "explain");
380 380
                 }
381 381
             }

+ 7
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java Datei anzeigen

@@ -144,8 +144,13 @@ public class GuideService {
144 144
                     Integer resourceclass = r.getResourceclass();
145 145
                     if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
146 146
                         r.setConverted(1);
147
-                    } else if (resourceclass == 5 && ("flv".equals(r.getSuffix()) || "h264".equals(r.getMp4code()))) {
148
-                        r.setConverted(1);
147
+                    } else if (resourceclass == 5) {
148
+                        if("h264".equals(r.getMp4code())){
149
+                            r.setConverted(1);
150
+                        } else {
151
+                            r.setConverted(0);
152
+                        }
153
+
149 154
                     }
150 155
                     //保存资源信息
151 156
                     resourceMapper.insertSelective(r);

+ 8
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/ResourceService.java Datei anzeigen

@@ -82,8 +82,14 @@ public class ResourceService {
82 82
         Integer resourceclass = model.getResourceclass();
83 83
         if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
84 84
             model.setConverted(1);
85
-        } else if (resourceclass == 5 && ("flv".equals(model.getSuffix()) || "h264".equals(model.getMp4code()))) {
86
-            model.setConverted(1);
85
+        } else if (resourceclass == 5) {
86
+            if("h264".equals(model.getMp4code())){
87
+                model.setConverted(1);
88
+            } else {
89
+                model.setConverted(0);
90
+            }
91
+        } else {
92
+
87 93
         }
88 94
         resourceMapper.insertSelective(model);//保存资源
89 95
 

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/utils/ConvertUtil.java Datei anzeigen

@@ -85,7 +85,7 @@ public class ConvertUtil extends JedisUtil {
85 85
     public String videoTransfer(ResourceVo resource) {
86 86
         String resourceurl = resource.getResourceurl();
87 87
         String suffix = resource.getSuffix();
88
-        if ("mp4".equals(suffix) && !"h264".equals(resource.getMp4code())) {
88
+        if (!"h264".equals(resource.getMp4code())) {
89 89
             if (redisHandle(resource.getResourceurl(), resource.getResourceid())) return null;
90 90
             resourceurl = messageSender.convertResource(resource);
91 91
         }

Laden…
Abbrechen
Speichern