承接 adachsoft/video-generation-minimax 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:
    • --img to provide an input image (URL or local file),
    • --text or positional prompt argument,
    • --duration to control the length of the generated video (in seconds).
  • Factory for creating a configured MinimaxVideoGenerator instance.
  • 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-contracts
  • adachsoft/collection
  • guzzlehttp/guzzle

For development and running the CLI locally you will also typically use:

  • vlucas/phpdotenv for loading .env files.

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 6 seconds when not provided.
  • prompt (positional, optional if --text is used)
    • Prompt text when you do not use --text.
  • 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 adachsoft/video-generation-minimax 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-22