almajiro/ffsachiko

Lightweight FFmpeg Wrapper

dev-master 2019-01-15 05:32 UTC

This package is auto-updated.

Last update: 2024-05-23 16:48:18 UTC


README

68747470733a2f2f7261772e6769746875622e636f6d2f77696b692f616c6d616a69726f2f666673616368696b6f2f696d616765732f666673616368696b6f2e6a7067

68747470733a2f2f7472617669732d63692e6f72672f616c6d616a69726f2f666673616368696b6f2e7376673f6272616e63683d6d6173746572

FFSachiko

The simplest FFmpeg/FFprobe wrapper.

Install (coming soon)

composer required almajiro/ffsachiko

Example

use Almajiro\FFSachiko\FFmpeg;
use Almajiro\FFSachiko\FFmpeg\Parameters\Input;
use Almajiro\FFSachiko\FFmpeg\Parameters\Threads;
use Almajiro\FFSachiko\FFmpeg\Parameters\VideoFilters;
use Almajiro\FFSachiko\FFmpeg\Parameters\VideoFilters\Scale;

$file = '~/videos/owarimonogatari.mp4';

$ffmpeg = new FFmpeg('/usr/local/bin/ffmpeg');

$file = $ffmpeg->open(new Input($file));

// Define how many core want to use
$file->addParameter(new Threads(4));

// Declare new VideoFilters class
$videoFilter = new VideoFilters();

// Resize video size to 640x320
$videoFilter->addFilter(new Scale(640, 320));

$file->addParameter($videoFilter);
$file->saveAs('output/video.mp4')->convert();

Contribution

  1. Fork it ( http://github.com/almajiro/ffsachiko )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

almajiro