Skip to content

生成视频时,不要根据请求送来的scene,而是应该从数据库取值 #166

Description

@dthcle

以下函数的实现,不应该从request.scenes中取,因为前端的数据有限,应该从数据库中读取所有对应的内容,作为生成视频的基础。
注意不要遗漏了部分信息
@router.post("/compose")
async def compose_video(request: VideoComposeRequest):
try:
video_path = video_service.generate_video_from_scenes(
scenes=request.scenes,
project_title=request.project_title,
add_bgm=request.add_bgm,
bgm_path=request.bgm_path,
)

    return {
        "success": True,
        "video_path": video_path,
    }
except Exception as e:
    raise HTTPException(status_code=500, detail=str(e))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions