|
|
@@ -341,6 +341,7 @@ public class MediaAnalysisServiceImpl implements MediaAnalysisService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public VideoAnalysisVo getVideoSentiment(Long userId, Long assignmentId) {
|
|
|
String requestKey = userId + "-" + assignmentId + "-video-sentiment";
|
|
|
log.info("{} 开始获取视频情感分析, userId: {}, assignmentId: {}",
|
|
|
@@ -367,7 +368,6 @@ public class MediaAnalysisServiceImpl implements MediaAnalysisService {
|
|
|
VIDEO_SENTIMENT_HEADER, userId, assignmentId);
|
|
|
throw new MyException(HttpStatus.BAD_REQUEST.value(), "不存在相应记录");
|
|
|
}
|
|
|
-
|
|
|
if (dialogue.getVideoAnalysis() != null && dialogue.getVideoAnalysis().getNewAudioUrl() != null) {
|
|
|
log.debug("{} 返回已存在的视频分析结果", VIDEO_SENTIMENT_HEADER);
|
|
|
return dialogue.getVideoAnalysis();
|
|
|
@@ -403,7 +403,6 @@ public class MediaAnalysisServiceImpl implements MediaAnalysisService {
|
|
|
|
|
|
private VideoAnalysisVo sendRequestToDeepface(List<String> audioSegment, SpeakingAIDialogue dialogue) throws IOException {
|
|
|
log.debug("{} 开始发送视频分析请求, 音频片段数量: {}", VIDEO_SENTIMENT_HEADER, audioSegment.size());
|
|
|
-
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("video_urls", audioSegment);
|
|
|
RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), json.toString());
|