Skip to main content

开放平台视频生成批量操作

项目简介

本项目是基于开放平台的视频生成批量操作,主要包括视频生成功能,通过本demo你可以快速生成多个一致性高度相同的视频备选素材。

提交包含 input_text, image_path 字段的 level_contexts.xlsx 文件

input_text:文本内容

image_path: 图片绝对路径

输出结果为视频任务 id 的 csv文件,

快速尝试

使用

  • 1、安装依赖 python 需要3.10以上版本
pip install minimax-platform-video -U
  • 2、设置环境变量 我们设定好 API Key。
export API_KEY="开放平台key" 
  • 3、准备数据

基础表格里需要准备的数据包含了 input_text, image_path 字段

input_text 为生成提示词,用于控制镜头

image_path 为起始帧的图片,这个图片可以不存在,使用 request_img 命令参数控制是否必须采用起始帧,默认必须存在

  • 4、运行

启动目录为项目根目录

python -m minimax_platform_video.start --input_excel C:\\Users\\Administrator\\Desktop\\data\\level_contexts.xlsx --output_path C:\\Users\\Administrator\\Desktop\\data\\

参数说明

input_excel:为包含input_text,image_path字段的的level_contexts.xlsx文件

output_path:为输出文件路径,生成 video_report.csv文件

可以断点续传,会自动跳过已经生成的任务,

根据需要配置线程

prompt_num_threads: 提示词线程数,默认2

video_num_threads: 视频生成线程数,默认1

  • 5、获取任务结果

启动目录为项目根目录

python -m minimax_platform_video.video_pull --task_video_csv C:\\Users\\Administrator\\Desktop\\data\\video_report.csv --output_path C:\\Users\\Administrator\\Desktop\\data\\

参数说明

input_excel: video_report.csv文件

output_path:为输出文件路径 生成video_pull_report.csv文件

会自动跳过已经获取的任务, 删除根目录cache_data/VideoPullGenerator的文件可以重新获取

根据需要配置线程

num_threads: 线程数,默认2

  • 6、下载视频

启动目录为项目根目录

python -m minimax_platform_video.download_video  --csv_file_path  C:\\Users\\renrui\\Desktop\\data\\video_pull_report.csv --output_path C:\\Users\\renrui\\Desktop\\data\\

参数说明

csv_file_path: video_pull_report.csv文件

output_path:为输出文件路径 视频下载目录

Metadata

Release files for minimax-platform-video 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minimax-platform-video 0.0.4
File Size Uploaded
minimax_platform_video-0.0.4.tar.gz 12.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minimax-platform-video 0.0.4
File Interpreter ABI Platform
minimax_platform_video-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 32.2 kB

Release files / minimax_platform_video-0.0.4.tar.gz

Download URL minimax_platform_video-0.0.4.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
93988f068c77d16ec0f2dc9f187d162feaa26b8801f923e2e2a42ec189c4323a
BLAKE2b-256 checksum
How to use checksums
9e101d50e366fd6d9a3c3e73f331e311ab120fc178f1fd7f59a4f6975285c464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Windows/10

Release files / minimax_platform_video-0.0.4-py3-none-any.whl

Download URL minimax_platform_video-0.0.4-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cf3da697ab97344ee1b85c93ccf19a32cd414e8141845c37eb74cc58082269d
BLAKE2b-256 checksum
How to use checksums
46c8c06cc73da4c797564be52796eae6b2a40968a019ff83f2d010cf7007dd0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Windows/10

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page