tikiwiki/media-alchemyst
Composer 安装命令:
composer require tikiwiki/media-alchemyst
包简介
An Object Oriented wrapper for easy multimedia conversion, based on Imagine, FFMpeg, SwfTools, Unoconv and other libs
README 文档
README
A PHP 7.0+ lib to transmute media files.
This project is a fork of media-alchemyst/media-alchemyst.
- Want to extract audio from a video file ?
- Want to convert an office document to an image?
- Want to resize images ?
- Want to generate a Gif animation from a video ?
Media-Alchemyst is a tool to transmute your medias from media-type to media-type.
Usage example
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\Specification\Animation;
use MediaAlchemyst\Specification\Image;
use MediaAlchemyst\Specification\Video;
$alchemyst = Alchemyst::create();
$video = new Video();
$video->setDimensions(320, 240)
->setFramerate(15)
->setGOPSize(200);
// AMAZING
$alchemyst
->turnInto('movie.mp4', 'animation.gif', new Animation())
->turnInto('movie.mp4', 'screenshot.jpg', new Image())
->turnInto('movie.mp4', 'preview.ogv', $video);
What is currently supported ?
- Working install of FFmpeg (for Audio / Video processing)
- GPAC (for X264 Video processing)
- Perl (for metadata analysis)
- GraphicsMagick and its Gmagick PHP Extension (recommended) or ImageMagick (Image processing)
- Universal Office Converter (unoconv) which supports about 100 different document formats
- SWFTools (for Flash files processing)
Customize drivers
Drivers preferences can be specified through the DriversContainer :
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\DriversContainer;
$drivers = new DriversContainer();
$drivers['configuration'] = array(
'ffmpeg.threads' => 4,
'ffmpeg.ffmpeg.timeout' => 3600,
'ffmpeg.ffprobe.timeout' => 60,
'ffmpeg.ffmpeg.binaries' => '/path/to/custom/ffmpeg',
'ffmpeg.ffprobe.binaries' => '/path/to/custom/ffprobe',
'imagine.driver' => 'imagick',
'gs.timeout' => 60,
'gs.binaries' => '/path/to/custom/gs',
'mp4box.timeout' => 60,
'mp4box.binaries' => '/path/to/custom/MP4Box',
'swftools.timeout' => 60,
'swftools.pdf2swf.binaries' => '/path/to/custom/pdf2swf',
'swftools.swfrender.binaries' => '/path/to/custom/swfrender',
'swftools.swfextract.binaries' => '/path/to/custom/swfextract',
'unoconv.binaries' => '/path/to/custom/unoconv',
'unoconv.timeout' => 60,
);
$alchemyst = new Alchemyst($drivers);
$alchemyst
->turnInto('movie.mp4', 'animation.gif', new Animation())
Silex service provider ?
Need a Silex service provider ? Of course it's provided !
Please note that Media-Alchemyst service provider requires MediaVorus service provider.
use Silex\Application;
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\MediaAlchemystServiceProvider;
use MediaVorus\MediaVorusServiceProvider;
use PHPExiftool\PHPExiftoolServiceProvider;
$app = new Application();
$app->register(new PHPExiftoolServiceProvider());
$app->register(new MediaAlchemystServiceProvider());
// Have fun OH YEAH
$app['media-alchemyst']->turnInto('movie.mp4', 'animation.gif', new Animation());
You can customize the service provider with any of the following options :
$app->register(new MediaVorusServiceProvider(), array(
'media-alchemyst.configuration' => array(
'ffmpeg.threads' => 4,
'ffmpeg.ffmpeg.timeout' => 3600,
'ffmpeg.ffprobe.timeout' => 60,
'ffmpeg.ffmpeg.binaries' => '/path/to/custom/ffmpeg',
'ffmpeg.ffprobe.binaries' => '/path/to/custom/ffprobe',
'imagine.driver' => 'imagick',
'gs.timeout' => 60,
'gs.binaries' => '/path/to/custom/gs',
'mp4box.timeout' => 60,
'mp4box.binaries' => '/path/to/custom/MP4Box',
'swftools.timeout' => 60,
'swftools.pdf2swf.binaries' => '/path/to/custom/pdf2swf',
'swftools.swfrender.binaries' => '/path/to/custom/swfrender',
'swftools.swfextract.binaries' => '/path/to/custom/swfextract',
'unoconv.binaries' => '/path/to/custom/unoconv',
'unoconv.timeout' => 60,
),
'media-alchemyst.logger' => $logger, // A PSR Logger
));
License
This is MIT licensed, enjoy :)
tikiwiki/media-alchemyst 适用场景与选型建议
tikiwiki/media-alchemyst 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「image processing」 「image」 「audio」 「video processing」 「video」 「audio processing」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tikiwiki/media-alchemyst 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tikiwiki/media-alchemyst 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tikiwiki/media-alchemyst 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
Library for manipulating audio files (validating, transcoding, and tagging)
paywant api php client
The Yii2 extension uses jQuery PrettyPhoto and OwlCarousel js and makes image galary from php array of structure defined.
Convert and operate with FIPS codes for states, counties, etc.
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-05