kiririn / webm

为 .webm 视频创建缩略图

dev-master 2015-05-30 16:37 UTC

This package is auto-updated.

Last update: 2024-09-09 14:03:03 UTC


README

以 root 用户在 Debian/Ubuntu 上

apt install ffmpegthumbnailer mediainfo

使用方法

use Kiririn\Webm\Webm;

//You can skip dependency checking: new Webm('path/to/video.webm', true);
$webm = new Webm('path/to/video.webm');
$webm->thumbnail(200, 200);

//Second argument - thumb name with or without extension
$webm->save('path/to', 'thumb.jpeg');

获取更多信息

//Video
$webm->getWidth();
$webm->getHeight();

//Thumb
$webm->getThumbWidth();
$webm->getThumbHeight();

//Duration
$webm->getDuration();