|
|
@@ -336,6 +336,8 @@ class AIVideoGenerationService
|
|
|
'last_frame_url' => $statusInfo['last_frame_url'] ?? '',
|
|
|
'updated_at' => $now
|
|
|
];
|
|
|
+ $compressed_video_url = compressVideo($segmentUpdateData['video_url']);
|
|
|
+ if ($compressed_video_url) $segmentUpdateData['preview_video_url'] = $compressed_video_url;
|
|
|
|
|
|
// 只有当video_duration存在且大于0时才更新
|
|
|
if (isset($statusInfo['video_duration']) && $statusInfo['video_duration'] > 0) {
|
|
|
@@ -598,6 +600,8 @@ class AIVideoGenerationService
|
|
|
'last_frame_url' => $statusInfo['last_frame_url'] ?? '',
|
|
|
'updated_at' => $now
|
|
|
];
|
|
|
+ $compressed_video_url = compressVideo($segmentUpdateData['video_url']);
|
|
|
+ if ($compressed_video_url) $segmentUpdateData['preview_video_url'] = $compressed_video_url;
|
|
|
|
|
|
// 只有当video_duration存在且大于0时才更新
|
|
|
if (isset($statusInfo['video_duration']) && $statusInfo['video_duration'] > 0) {
|
|
|
@@ -884,6 +888,8 @@ class AIVideoGenerationService
|
|
|
$video_name = $video_name . $video_ext;
|
|
|
$url = uploadStreamByTos('video', file_get_contents($video_url), $video_name);
|
|
|
$updateData['result_url'] = $url;
|
|
|
+ $compressed_video_url = compressVideo($updateData['result_url']);
|
|
|
+ if ($compressed_video_url) $updateData['preview_video_url'] = $compressed_video_url;
|
|
|
|
|
|
dLog('generate')->info('Seedance 视频保存成功: ' . $url);
|
|
|
} catch (\Exception $e) {
|
|
|
@@ -986,6 +992,9 @@ class AIVideoGenerationService
|
|
|
if (isset($updateData['result_url'])) {
|
|
|
$segmentUpdateData['video_url'] = $updateData['result_url'];
|
|
|
}
|
|
|
+ if (isset($updateData['preview_video_url'])) {
|
|
|
+ $segmentUpdateData['preview_video_url'] = $updateData['preview_video_url'];
|
|
|
+ }
|
|
|
} elseif ($taskStatus === MpGenerateVideoTask::STATUS_FAILED) {
|
|
|
$segmentUpdateData['video_task_status'] = '失败';
|
|
|
} elseif ($taskStatus === MpGenerateVideoTask::STATUS_PROCESSING) {
|
|
|
@@ -1376,6 +1385,8 @@ class AIVideoGenerationService
|
|
|
'last_frame_url' => $statusInfo['last_frame_url'] ?? '',
|
|
|
'updated_at' => $now
|
|
|
];
|
|
|
+ $compressed_video_url = compressVideo($segmentUpdateData['video_url']);
|
|
|
+ if ($compressed_video_url) $segmentUpdateData['preview_video_url'] = $compressed_video_url;
|
|
|
|
|
|
// 只有当video_duration存在且大于0时才更新
|
|
|
if (isset($statusInfo['video_duration']) && $statusInfo['video_duration'] > 0) {
|