承接 renus/media 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

renus/media

最新稳定版本:0.5

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

  1. Add this bundle to your project in composer.json:
{
    "require": {
        "renus/media": "0.*",
    }
}
  1. Install with composer
composer.phar require renus/media dev-master
  1. 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);

统计信息

  • 总下载量: 170
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固