1
This commit is contained in:
@@ -117,6 +117,7 @@ async def prepare_api_upscale_task(
|
|||||||
source_width: int = 0,
|
source_width: int = 0,
|
||||||
source_height: int = 0,
|
source_height: int = 0,
|
||||||
source_duration: float = 0.0,
|
source_duration: float = 0.0,
|
||||||
|
source_file_size_bytes: int = 0
|
||||||
) -> "VideoUpscaleTask | None":
|
) -> "VideoUpscaleTask | None":
|
||||||
"""为 API 任务创建超分子任务。
|
"""为 API 任务创建超分子任务。
|
||||||
|
|
||||||
@@ -162,7 +163,7 @@ async def prepare_api_upscale_task(
|
|||||||
source_local_path=api_task.local_path or source_local_path, # 优先使用已下载的本地文件
|
source_local_path=api_task.local_path or source_local_path, # 优先使用已下载的本地文件
|
||||||
source_remote_url=api_task.remote_result_url, # 火山 MediaKit 需要远程 URL
|
source_remote_url=api_task.remote_result_url, # 火山 MediaKit 需要远程 URL
|
||||||
input_source_type="provider_remote",
|
input_source_type="provider_remote",
|
||||||
source_file_size_bytes=0,
|
source_file_size_bytes=source_file_size_bytes,
|
||||||
source_width=source_width,
|
source_width=source_width,
|
||||||
source_height=source_height,
|
source_height=source_height,
|
||||||
source_duration_seconds=source_duration,
|
source_duration_seconds=source_duration,
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ async def _download_generation_result(self, task_id: str) -> dict[str, Any]:
|
|||||||
try:
|
try:
|
||||||
abs_path = os.path.abspath(dest_path)
|
abs_path = os.path.abspath(dest_path)
|
||||||
if os.path.exists(abs_path):
|
if os.path.exists(abs_path):
|
||||||
task.source_file_size_bytes = os.path.getsize(abs_path)
|
source_file_size_bytes = os.path.getsize(abs_path)
|
||||||
# 使用 probe_video 探测实际视频尺寸和时长
|
# 使用 probe_video 探测实际视频尺寸和时长
|
||||||
from app.services.video_upscale.media_service import probe_video
|
from app.services.video_upscale.media_service import probe_video
|
||||||
source_info = await probe_video(abs_path)
|
source_info = await probe_video(abs_path)
|
||||||
@@ -549,6 +549,7 @@ async def _download_generation_result(self, task_id: str) -> dict[str, Any]:
|
|||||||
source_width=source_width,
|
source_width=source_width,
|
||||||
source_height=source_height,
|
source_height=source_height,
|
||||||
source_duration=source_duration,
|
source_duration=source_duration,
|
||||||
|
source_file_size_bytes=source_file_size_bytes
|
||||||
)
|
)
|
||||||
|
|
||||||
# 如果已存在超分任务(重复调用),检查超分状态
|
# 如果已存在超分任务(重复调用),检查超分状态
|
||||||
|
|||||||
Reference in New Issue
Block a user