ac/transcoding-bundle

为您的 Symfony2 项目提供使用 AC 转码组件的容器服务。

0.4.3 2014-05-03 01:03 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:04:52 UTC


README

本包提供容器服务,用于在您的代码中加载文件转码器。

本包与 http://github.com/AmericanCouncils/Transcoding 仓库同步开发。

配置

您可以将下面的配置块复制/粘贴到您的 app/config.yml 中,并根据需要修改

ac_transcoding:
    ffmpeg: 
        enabled: true           #if false, other keys need not be specified
        path: /usr/bin/ffmpeg
        timeout: 0
    handbrake:
        enabled: true           #if false, other keys need not be specified
        path: /usr/local/bin/HandBrakeCLI
        timeout: 0

服务

  • transcoder - 将返回一个 AC\Transcoding\Transcoder 实例,并自动注册任何标记的适配器、预设和监听器

您可以使用 transcoder 服务进行文件转码

$newFile = $container->get('transcoder')->transcodeWithPreset('/path/to/input/file', 'handbrake.classic', '/path/to/output/file');

容器标签

实现了各种容器标签,以允许轻松地将自定义适配器、预设和事件监听器注册到转码中。请参阅以下列表

  • transcoding.adapter
  • transcoding.preset
  • transcoding.listener
  • transcoding.subscriber

命令

本包提供了一些命令,可以通过命令行访问转码器

  • transcoder:transcode [infile] [preset] [outfile] - 使用预设转码输入文件,创建输出文件。如果需要,您可以使用此命令测试自定义预设和适配器。
  • transcoder:status - 显示基于当前配置的启用和正在工作的适配器列表,以及可用预设列表。