aequasi/screenshotr

从视频创建屏幕截图

1.1.1 2015-09-02 21:23 UTC

This package is auto-updated.

Last update: 2024-09-05 19:22:14 UTC


README

视频截图工具

安装

需要将ffmpeg和ffprobe可执行文件添加到您的路径中: https://www.ffmpeg.org/

$ composer require aequasi/screenshotr "^1.0"

用法

// Second argument is the tmp dir the images are created in. Defaults to /tmp
$screenShotr = new \ScreenShotr\Core('/path/to/movie/file');

// Generate a single screenshot at the 300 second mark, returns a \SplFileInfo to a file in /tmp
$screenshot = $screenShotr->generateScreenshot(300);

// Generate screenshots for a file, every 5 seconds, starting at the 300 second mark
// Returns an array of \SpFileInfo objects like above
$screenshots = $screenShotr->generateScreenshotsEveryFrame(300, 5);