dumpk/elastcoder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dumpk/elastcoder

Composer 安装命令:

composer require dumpk/elastcoder

包简介

AWS Elastic Transcoder Service Integration

README 文档

README

Build Status Latest Stable Version Author

AWS Elastic Transcoder integration for Laravel. This is a simple wrapper if you don't want to go too deep with the AWS SDK for PHP 3.x!.

Installation

Require this package with composer:

composer require dumpk/elastcoder

Add the service provider to your config/app.php file:

Dumpk\Elastcoder\ElastcoderServiceProvider::class

Publish config file by running :

php artisan vendor:publish --tag=elastcoder

Add this variables to your .env with your Amazon credentials

AWS_ACCESS_KEY_ID={AMAZONACCESSKEY}
AWS_SECRET_ACCESS_KEY={SECRETAMAZONSOMETHINGLONG}
AWS_REGION={YOURREGION}

Usage

Add the ElastcoderAWS class to your class header

use Dumpk\Elastcoder\ElastcoderAWS;

Now you just need to instance your class

$elastcoder = new ElastcoderAWS();

You'll need to have your video uploaded to S3 before using this library, so that means that you already have the key for the file you want to encode. The configuration has to look like:

$config = [
    'PresetId' => '432423-dsda',
    'width'  => 1920,
    'height' => 1080,
    'aspect' => '16:9',
	'ext'	 => 'mp4',
	'PipelineId' => '343244232-n2fuqq4',
    'Watermarks' => [[
        'PresetWatermarkId' => 'BottomRight',
        'InputKey'          => '1080.png',
    ]],
    'TimeSpan' => [
        'StartTime' => '0.4',
        'Duration'  => '5.3'
    ],
]

There's an example file you can throw in on your config folder in dumpk/elastcoder/example/elastcoder.php remember to change the values for the pipeline and presetId you want and you have configured on your AWS account.

So now you can call the transcoding function:

$job = $elastcoder->transcodeVideo($asset->key, $destinationKey, $config, $thumbPattern);

You can also transcode audio files like so :

$job = $elastcoder->transcodeAudio($inputfile,$uotputfile,$artwork)

This will return a job with an array, where you can find the "Id" of the Job, you'll need to check the job for completeness to know if your video is ready. Buy you already know that, so for your convienience you can use:

$job = $elastcoder->getJob($job["Id"]);

And check if $job['Status'] == 'complete'

Also you can change the ACL of your file, because you might want to give access to everyone to see your amazing video, so:

$elastcoder->setPublicObject($key, $bucket);

If you want to be more specific about that and have different types of permissions, you can use:

$elastcoder->setObjectACL($key, $bucket, $acl);

$acl can be a string with this values => private|public-read|public-read-write|authenticated-read|bucket-owner-read|bucket-owner-full-control

dumpk/elastcoder 适用场景与选型建议

dumpk/elastcoder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19.75k 次下载、GitHub Stars 达 27, 最近一次更新时间为 2015 年 10 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「aws」 「laravel」 「transcoder」 「amazon elastic transcoder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 dumpk/elastcoder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dumpk/elastcoder 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 19.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 17
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 27
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-29