2017 © Pedro Peláez
 

library ffmpeglib

FFMpeg Library

image

packet/ffmpeglib

FFMpeg Library

  • Sunday, July 15, 2018
  • by Kaloyan98
  • Repository
  • 0 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

FFmpeg-Library

FFMPEG library, available to anyone., (*1)

This library is create for personal use, but if you want to use it feel free to use it :) . To use it you will need to go deeper and see what the functions are doign, since it is a personal use i am not going to document everything, (*2)

How To use

First you need all of the libraries to use it, (*3)

use FFMpegLib\Initializer;
use FFMpegLib\Executor\Executor;
use FFMpegLib\Commands\VideoDurationCommand;
use FFMpegLib\Commands\CreateImagesCommand;
use FFMpegLib\Commands\GifCommand;
use FFMpegLib\FileFinder\FileFinder;

Then you need to initalize it, (*4)

Initializer::initializeFFMpeg();

You can get video duration with, (*5)

$videoDurationCommand = new VideoDurationCommand('video.flv', APP_PATH);

Executor::executeCommand($videoDurationCommand);

$videoDurationCommand->getDuration(); // it returns an instance of Time

To create images suitable for gif:, (*6)

$imagesPath = APP_PATH . '/assets/images/image.png';
$videoPath = APP_PATH . '/assets/videos/video.flv';

$createImagesCommand = new CreateImagesCommand(
    $videoPath, 
    $imagesPath, 
    '00:30:40', 
    '00:0:03', 
    $videoDurationCommand->getDuration());

Executor::executeCommand($createImagesCommand);

Take note you need to delete the images yourself as the option is not yet implemented, (*7)

You can create a gif with:, (*8)

$gifCommand = new GifCommand(APP_PATH . '/assets/images/image.png', APP_PATH . '/assets/images/t.gif');
Executor::executeCommand($gifCommand);

You need to specify the full path of the video for every command except for the duration, there i use a finder for the base path, but you can pass the full path as well., (*9)

to get the images/frames created from createImagesCommand use, (*10)

$createImagesCommand->framesCreated();

The time Class, (*11)

methods:, (*12)

getSeconds(); //returns seconds, you need a Time object to call all of theese methods
getMinutes();
getHours();
getFullTime();
getTimeInSeconds();
getTimeInMinutes();
create();// static method -- Time::create()
createFromString(); // static method -- Time::createFromString()

The Versions

15/07 2018

dev-master

9999999-dev

FFMpeg Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kaloyan Yosifov

15/07 2018

1.0.0

1.0.0.0

FFMpeg Library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kaloyan Yosifov