南昌市物联网技防平台-后台
zengh
2021-06-01 cd2cfd37366002f790a2ed1435962d4eff7d5cec
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/rvideo/controller/RvideoController.java
@@ -41,6 +41,7 @@
import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacv.*;
import java.io.IOException;
import java.util.Date;
/**
@@ -226,8 +227,8 @@
      String UUID = DateUtil.time();
      UUIDs=UUID;
      uids=uid;
//      recordVideoThread.filePath = "D:\\software\\minio\\data\\jfpt\\void\\"+UUID + ".mp4";
      filePath = "D:\\video\\"+UUID + ".mp4";
      //filePath = "D:\\video\\"+UUID + ".mp4";
      filePath = "D:\\software\\minio\\data\\jfpt\\void\\"+UUID + ".mp4";
      timesSec = 0L;
      String newJson = StringEscapeUtils.unescapeHtml4(url);
      streamURL =newJson;// 最好设置结束时长 如直接停止程序会造成输出文件的损坏无法正常播放
@@ -256,7 +257,16 @@
               recorder.start();
               System.out.println("推流开始");
               //记录当前时间
               long dqdate = new Date().getTime();
               while (!jid.equals(xcbj)) {
                  //记录现在时间
                  long xzdate = new Date().getTime();
                  if (xzdate > (dqdate + 300000)){
                     break;
                  }
                  if (frame != null){
                     System.out.println("开始");
@@ -290,6 +300,12 @@
                  }
               }
               System.out.println("录制完成,录制时长:" + timesSec + "秒");
               String vaddress = null;
               //返回路径
               vaddress = "https://web.byisf.com/" + PRF_MINIO_URL + UUID + ".mp4";
               //把路径通过警情id添加到警情信息
               alarmService.updateVaddress(vaddress, uids, jid);
            }
         }