renus/media
Composer 安装命令:
composer require renus/media
包简介
Symfony Bundle to handle image and video
README 文档
README
RenusMediaBundle is a collection of code within a Symfony 2 Bundle to handle image and video, you can create an image or animated gif from a video source or resize, obfuscate and crop an image in Symfony 2.
To use RenusMediaBundle in your project add it via composer
Installation
prerequisites
To use RenusMediaBundle you must install and know the path of 'ffmpeg' binary (on Debian):
apt-get install ffmpeg php5-ffmpeg php5-imagick
configuration
if you use a non standard Debian installation, you must specify the path to ffmpeg in your parameters file :
parameters:
binary: '/usr/bin/ffmpeg'
installation
- Add this bundle to your project in composer.json:
{
"require": {
"renus/media": "0.*",
}
}
- Install with composer
composer.phar require renus/media dev-master
- Register the bundle
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new \Renus\MediaBundle\RenusMediaBundle(), ); // ... }
Usage
In Symfony 2 controller, you can use it like a service
extract an image from video
extract the image at 55 seconds
<?php $this->container->get('renus.video')->getPicsFromVideo( '/path/to/video/vid1.m4v', 55, '/path/to/generate/image/vid1.jpg' );
create an animated gif from video
get an image every 10 seconds to build the animated gif
<?php $this->container->get('renus.video')->generateAnimatedGifFromVideo( '/path/to/video/vid1.m4v', 10, '/path/to/generate/image/vid1.gif' );
resize an image
Choose the destination path and the max size (300px here)
<?php $this->container->get('renus.image') ->init('/path/to/image.jpg') ->createThumb('/path/to/resize-thumb.jpg', 300);
crop an image
Choose the destination path , define the start X point and the start Y point, the width and the height of the selection.
<?php $this->container->get('renus.image') ->init('/path/to/image.jpg') ->crop('/path/to/crop-thumb.jpg', 100, 25, 300, 250);
renus/media 适用场景与选型建议
renus/media 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 170 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 04 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「picture video handle bundle」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 renus/media 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 renus/media 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 renus/media 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Typed file handles for reading and writing with write modes and advisory locking
Handle-based I/O abstractions - composable, testable, and async-ready
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
Glide image processing in a Symfony2 project
The Kiwa Source Collection makes it easy to create HTML Audio, Picture and Video elements with multiple sources.
The yii2-videojs-widget is a Yii 2 wrapper for the [video.js](http://www.videojs.com/). A JavaScript and CSS library that makes it easier to work with and build on HTML5 video. This is also known as an HTML5 Video Player.
统计信息
- 总下载量: 170
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-11