ac/mutate

适用于 PHP 5.3+ 的命令行文件转码应用程序。

0.8.0 2012-08-20 14:59 UTC

This package is not auto-updated.

Last update: 2024-09-14 12:32:43 UTC


README

Mutate 是一个文件转码 CLI 应用程序。它基于 AC Transcoding 库提供了一个友好的命令行界面。

此应用程序正在积极开发中。它与 Transcoding 库同步开发。

安装

目前唯一安装方式是通过 composer。尝试以下命令

cd </path/to/mutate_root>
php composer.phar install

一旦安装了依赖项,您需要检查设置 mutate.conf.php 以确保它们在您的系统上正常工作。Mutate 为其他程序提供了包装器,这些程序可能需要独立安装到您的系统上。

基本独立使用

尝试 mutate list 以查看所有可用命令的列表。

要查看您拥有的可用适配器(以及这些适配器的预设),请运行

$> php bin/mutate status

要简单地使用预设将文件从一个格式转换为另一个格式,您可以使用位于 /bin 目录中的 mutate 脚本。

$> cd /path/to/mutate_root

# convert image format
$> php bin/mutate transcode /path/to/test/file.jpg image_to_gif /path/to/output/file.gif

# convert video (if the output file path is not provided, mutate will automatically choose a filename for you in the same directory)
$> php bin/mutate transcode /path/to/test/file.wmv mp4_720

# run a transcode job (a grouping of multiple presets)
$> php bin/mutate transcode:job /path/to/test/uploaded.wmv html5

非独立使用

Mutate 提供了自己的转码器,该转码器接受一个配置数组并自动加载适配器、预设和任务。如果您愿意,您可以在代码中使用此转码器代替基础的 AC\Component\Transcoding\Transcoder

//build the Mutate transcoder yourself (it automatically registers all adapters/presets/jobs included with the ac/transcoding component, depending on the configuration you pass it)
$transcoder = new AC\Mutate\Transcoder(array(
    //include any custom config for the underlying adapters, or logging, here
));

测试

您需要 PHPUnit 来运行它们。

待办事项列表

参见 TODO.md