2017 © Pedro Peláez
 

library bnp-ffmpeg-module

This module provides a simple wrapper for the PHP_FFmpeg library, exposing the library as a Zend Framework service

image

buonaparte/bnp-ffmpeg-module

This module provides a simple wrapper for the PHP_FFmpeg library, exposing the library as a Zend Framework service

  • Thursday, June 12, 2014
  • by buonaparte
  • Repository
  • 2 Watchers
  • 1 Stars
  • 72 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

BnpFFMpegModule

Build Status Coverage Status, (*1)

This module provides a simple wrapper for the PHP_FFmpeg library, exposing the library as a ZendFramework service., (*2)

Installation

Setup

  1. Add this project to your composer.json:, (*3)

    json "require": { "buonaparte/bnp-ffmpeg-module": "dev-master" }, (*4)

  2. Now tell composer to download BnpFFMpegModule by running the command:, (*5)

    bash $ php composer.phar update, (*6)

Post installation

Enabling it in your application.config.php file., (*7)

``` php <?php return array( 'modules' => array( // ... 'BnpFFMpegModule', ), // ... );, (*8)



Configuration ------------- Configure the module, by copying and adjusting `config/module.config.php.dist` to your config include path: ``` php $ffmpegConfig = array( 'configuration' => array( 'ffmpeg.threads' => 4, 'ffmpeg.timeout' => 300, 'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg', ), /** * Custom logger service, must resolve to a Psr\Logger\LoggerInterface instance pulled from the ServiceManager */ 'logger' => 'ffmpeg_logger', /** * Custom FFProbe service, pulled from the ServiceManager */ 'ffprobe' => 'ffprobe_service' ); return array( /** * Root Module configuration */ 'bnp-ffmpeg-module' => array( /** * For single ffmpeg service instance you can just uncomment the bellow line */ // 'ffmpeg' => $ffmpegConfig, /** * For multiple ffmpeg services with different configuration you will specify them in an array, * from to the service name to service configuration */ // 'ffmpeg' => array( // 'FFMpeg1' => array_merge_recursive($ffmpegConfig, array()), // 'FFMpeg2' => array_merge_recursive($ffmpegConfig, array()), // ), /** * FFProbe configuration */ 'ffprobe' => array( 'configuration' => array( 'ffprobe.timeout' => 30, 'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe', ), /** * Custom logger service must resolve to a Psr\Logger\LoggerInterface instance pulled from the ServiceManager */ 'logger' => 'ffprobe_logger', /** * Custom cache service must resolve to a Doctrine\Common\Cache\Cache instance pulled from the ServiceManager */ 'cache' => 'ffprobe_cache' ) ), /** * Service Manager config */ 'service_manager' => array( // 'factories' => array( // /** // * FFProbe service factory // */ // 'FFProbe' => 'BnpFFMpegModule\Factory\FFProbeServiceFactory', // /** // * For single ffmpeg service instance you can just register the factory for the service name // */ // 'FFMpeg' => 'BnpFFMpegModule\Factory\FFMpegServiceFactory' // ), // 'abstract_factories' => array( // /** // * For multiple ffmpeg service instances you must register the FFMpeg abstract factory // */ // 'BnpFFMpegModule\Factory\FFMpegAbstractServiceFactory' // ) ) );

Usage

$ffmpeg = $serviceLocator->get('FFMpeg');

// Open video
$video = $ffmpeg->open('/your/source/folder/input.avi');

// Resize to 720x480
$video
    ->filters()
    ->resize(new Dimension(720, 480), ResizeFilter::RESIZEMODE_INSET)
    ->synchronize();

// Start transcoding and save video
$video->save(new X264(), '/your/target/folder/video.mp4');

The Versions

12/06 2014

dev-master

9999999-dev

This module provides a simple wrapper for the PHP_FFmpeg library, exposing the library as a Zend Framework service

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Denis Mostovoi

zf2