MoneyPrinterTurbo icon indicating copy to clipboard operation
MoneyPrinterTurbo copied to clipboard

【期望】webui生成视频后提供在线预览下载功能

Open Ikaros-521 opened this issue 10 months ago • 5 comments

如题 临时凑合改了改 webui

# 在Streamlit应用中创建视频
def create_video(title: str, video_path: str):
    # 添加一个标题
    st.title(title)

    # 添加视频,从文件加载
    video_file = open(video_path, 'rb')  # 确保替换为你的视频文件名
    video_bytes = video_file.read()

    # 显示视频
    st.video(video_bytes)
logger.info("开始生成视频")

resp_json = tm.start(task_id=task_id, params=cfg)

if resp_json:
    logger.info(f"{resp_json}")
    if "videos" in resp_json:
        for video_path in resp_json["videos"]:
            create_video(task_id, video_path)

Ikaros-521 avatar Mar 29 '24 02:03 Ikaros-521