|
|
@@ -155,12 +155,12 @@ public class VideoRecognitionServiceImpl implements VideoRecognitionService {
|
|
|
if (playerInfo.getStatusFlag() > AppConstant.PlayerStatus.END) {
|
|
|
return;
|
|
|
}
|
|
|
- try {
|
|
|
- VideoCapture capture = new VideoCapture();
|
|
|
- if (capture.open(playerInfo.getVideo())) {
|
|
|
- System.out.println(capture.get(Videoio.CAP_PROP_FRAME_WIDTH));
|
|
|
- System.out.println(capture.get(Videoio.CAP_PROP_FRAME_HEIGHT));
|
|
|
- executor.execute(() -> {
|
|
|
+ VideoCapture capture = new VideoCapture();
|
|
|
+ if (capture.open(playerInfo.getVideo())) {
|
|
|
+ System.out.println(capture.get(Videoio.CAP_PROP_FRAME_WIDTH));
|
|
|
+ System.out.println(capture.get(Videoio.CAP_PROP_FRAME_HEIGHT));
|
|
|
+ executor.execute(() -> {
|
|
|
+ try {
|
|
|
SVM svm = SVM.load(GetResource.class.getClassLoader().getResource("trainneddata/pubg.xml").getPath());
|
|
|
Mat frame = new Mat();
|
|
|
Mat v = new Mat();
|
|
|
@@ -202,13 +202,16 @@ public class VideoRecognitionServiceImpl implements VideoRecognitionService {
|
|
|
frame.release();
|
|
|
v.release();
|
|
|
System.gc();
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ playerInfo.setStatusFlag(AppConstant.PlayerStatus.PROCESSED);
|
|
|
+ playerInfoService.updatePlayerInfo(playerInfo);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ playerInfo.setStatusFlag(AppConstant.PlayerStatus.PROCESSED);
|
|
|
+ playerInfoService.updatePlayerInfo(playerInfo);
|
|
|
}
|
|
|
- playerInfo.setStatusFlag(AppConstant.PlayerStatus.PROCESSED);
|
|
|
- playerInfoService.updatePlayerInfo(playerInfo);
|
|
|
}
|
|
|
|
|
|
@Override
|