adachsoft/video-generation-minimax
Composer 安装命令:
composer require adachsoft/video-generation-minimax
包简介
MiniMax video generation adapter for AdachSoft video-generation-contracts.
README 文档
README
MiniMax video generation adapter for the adachsoft/video-generation-contracts package.
This library provides a concrete implementation of a video generation client that talks to the MiniMax API and conforms to the shared video-generation-contracts DTOs and interfaces.
Features
- Simple MiniMax video generation client built on top of Guzzle.
- Text-to-video and image-to-video support via shared DTOs.
- Ready-to-use CLI script for quick video generation:
--imgto provide an input image (URL or local file),--textor positional prompt argument,--durationto control the length of the generated video (in seconds).
- Factory for creating a configured
MinimaxVideoGeneratorinstance. - Webhook handler for MiniMax callbacks.
Installation
Use Composer to install the package:
composer require adachsoft/video-generation-minimax
This library targets modern PHP 8.x and relies on:
adachsoft/video-generation-contractsadachsoft/collectionguzzlehttp/guzzle
For development and running the CLI locally you will also typically use:
vlucas/phpdotenvfor loading.envfiles.
Configuration
The MiniMax API key is read from the MINMAX_KEY environment variable. The recommended way is to store it in a local .env file in your project root:
MINMAX_KEY=your-minimax-api-key
When using the provided bin/cli script, the .env file is loaded automatically (if present) using vlucas/phpdotenv.
CLI usage
This repository ships with a simple CLI helper script in bin/cli which you can use to quickly generate a video using the MiniMax API.
Basic usage:
php bin/cli [--img IMAGE_URL_OR_PATH] [--text PROMPT] [--duration SECONDS] [prompt] [output-file.mp4]
Options and arguments:
--img IMAGE_URL_OR_PATH(optional)- HTTP(S) URL or local path to an image.
- Local paths are loaded and converted to a data URL (base64) before being sent to MiniMax.
--text PROMPT(optional)- Text prompt used for video generation.
- If omitted, the first positional argument is treated as the prompt.
--duration SECONDS(optional)- Length of the generated video in seconds.
- Must be a positive integer.
- Defaults to
6seconds when not provided.
prompt(positional, optional if--textis used)- Prompt text when you do not use
--text.
- Prompt text when you do not use
output-file.mp4(positional, optional)- Output filename for the generated video.
- When omitted, a timestamp-based filename is generated automatically.
The resulting file is saved in the var/data directory inside the project root.
CLI examples
Text-to-video with default duration (6 seconds):
php bin/cli --text "A futuristic city skyline at night" output.mp4
Image-to-video with explicit duration:
php bin/cli \
--img ./examples/input.jpg \
--text "Camera slowly zooming in" \
--duration 12 \
./output/zoom_in.mp4
Using only positional arguments (prompt and output file):
php bin/cli "Colorful particles swirling in space" particles.mp4
Programmatic usage
If you want to integrate MiniMax video generation directly into your application, use the MinimaxVideoGeneratorFactory and DTOs from adachsoft/video-generation-contracts.
<?php
declare(strict_types=1);
use AdachSoft\VideoGenerationContracts\Dto\VideoRequestDto;
use AdachSoft\VideoGenerationContracts\Enum\VideoAspectRatioEnum;
use AdachSoft\VideoGenerationContracts\Enum\VideoFormatEnum;
use AdachSoft\VideoGenerationContracts\Enum\VideoQualityEnum;
use AdachSoft\VideoGenerationMinimax\Factory\MinimaxVideoGeneratorFactory;
$apiKey = getenv('MINMAX_KEY');
$generator = MinimaxVideoGeneratorFactory::create(
apiToken: $apiKey,
);
$request = new VideoRequestDto(
format: VideoFormatEnum::Mp4,
aspectRatio: VideoAspectRatioEnum::Landscape,
quality: VideoQualityEnum::Standard,
durationSeconds: 6,
prompt: 'A simple prompt',
);
$job = $generator->generate($request);
// Poll for status, then fetch the result using the generator
You can extend this basic example with input media (image or video) by constructing an InputMediaCollection and passing it to VideoRequestDto.
Testing
This project uses PHPUnit and PSR-4 autoloading for tests under the
AdachSoft\\VideoGenerationMinimax\\Tests namespace.
Typical test run:
vendor/bin/phpunit
License
This library is released under the MIT License. See the LICENSE file for details.
adachsoft/video-generation-minimax 适用场景与选型建议
adachsoft/video-generation-minimax 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「client」 「adapter」 「generation」 「video」 「ai」 「minimax」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 adachsoft/video-generation-minimax 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 adachsoft/video-generation-minimax 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 adachsoft/video-generation-minimax 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Toolset for generating PHP code
Adapter designed to add Framework Agnosticism for Caching within PHP Packages.
flysystem cache Adapter
Virtual Filesystem Storage Adapter for Laravel
Fabricates patterns.
A simple interface for composite Flysystem adapters
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-22