|
@@ -57,6 +57,8 @@ public class VideoService {
|
|
|
//* -------------------------------- Comment --------------------------------
|
|
|
@Value("${scheduler.linux-path.temp}")
|
|
|
String linuxTempPath;
|
|
|
+ @Value("${scheduler.Xvfb-command}")
|
|
|
+ String XvfbCommand;
|
|
|
@Value("${scheduler.esmini-command}")
|
|
|
String esminiCommand;
|
|
|
@Value("${scheduler.python-command}")
|
|
@@ -91,11 +93,13 @@ public class VideoService {
|
|
|
|
|
|
//3 生成 xosc 文件
|
|
|
String xoscPath = generateXosc(rootDirectoryPathOfLinux, xodrPathOfLinux, osgbPathOfLinux, projectId, projectType);
|
|
|
+ // 启动虚拟窗口
|
|
|
//4 生成图片
|
|
|
String pictureDirectoryPath = rootDirectoryPathOfLinux + "picture";
|
|
|
FileUtil.createDirectory(pictureDirectoryPath);
|
|
|
String esminiCommandTemp = esminiCommand + " " + xoscPath + " " + pictureDirectoryPath + "/screenshot " + StringUtil.doubleToString(Double.parseDouble(maxSimulationTime), 2);
|
|
|
- String esminiResult = LinuxUtil.execute(esminiCommandTemp);
|
|
|
+ LinuxUtil.execute2(XvfbCommand, esminiCommandTemp);
|
|
|
+// String esminiResult = LinuxUtil.execute(esminiCommandTemp);
|
|
|
//5 生成视频
|
|
|
String videoTargetPathOfLinux = rootDirectoryPathOfLinux + "video/" + videoName;
|
|
|
FileUtil.createParentDirectory(videoTargetPathOfLinux);
|
|
@@ -109,6 +113,7 @@ public class VideoService {
|
|
|
);
|
|
|
//6 将视频上传到 minio
|
|
|
MinioUtil.uploadFromFile(minioClient, videoTargetPathOfLinux, bucketName, videoTargetPathOfMinio);
|
|
|
+ log.info("上传成功:" + videoTargetPathOfMinio);
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
|
|
|
}
|
|
|
|