2017 © Pedro Peláez
 

symfony-bundle media

Symfony Bundle to handle image and video

image

renus/media

Symfony Bundle to handle image and video

  • Sunday, August 23, 2015
  • by renus
  • Repository
  • 1 Watchers
  • 2 Stars
  • 153 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

RenusMediaBundle

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., (*1)

To use RenusMediaBundle in your project add it via composer, (*2)

Installation

prerequisites

To use RenusMediaBundle you must install and know the path of 'ffmpeg' binary (on Debian):, (*3)

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 :, (*4)

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, (*5)

extract an image from video

extract the image at 55 seconds, (*6)

<?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, (*7)

<?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), (*8)

<?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., (*9)

<?php

$this->container->get('renus.image')
                ->init('/path/to/image.jpg')
                ->crop('/path/to/crop-thumb.jpg', 100, 25, 300, 250);

The Versions

23/08 2015

dev-master

9999999-dev

Symfony Bundle to handle image and video

  Sources   Download

MIT

by Renaud Mioque

picture video handle bundle

23/08 2015

0.5

0.5.0.0

Symfony Bundle to handle image and video

  Sources   Download

MIT

by Renaud Mioque

picture video handle bundle

30/06 2015

0.4

0.4.0.0

Symfony Bundle to handle image and video

  Sources   Download

MIT

by Renaud Mioque

picture video handle bundle

17/04 2015

0.3

0.3.0.0

Symfony Bundle to handle image and video

  Sources   Download

MIT

by Renaud Mioque

picture video handle bundle

11/04 2015

0.2

0.2.0.0

Symfony Bundle to handle image and video

  Sources   Download

MIT

by Renaud Mioque

picture video handle bundle

11/04 2015

0.1

0.1.0.0

Symfony Bundle to handle image and video

  Sources   Download

MIT

by Renaud Mioque

picture video handle bundle