emgag/video-thumbnail-sprite
最新稳定版本:v1.0.3
Composer 安装命令:
composer require emgag/video-thumbnail-sprite
包简介
PHP library for generating video thumbnail sprites
README 文档
README
WARNING: This library is no longer maintained /WARNING
PHP library for generating video thumbnail sprites to be used for thumbnails in JWPlayer's seek bar.
System requirements
PHP 7.x (see release 0.2 for the latest version supporting PHP 5.5/5.6).
Following binaries need to be installed
- Either ffmpeg (tested with >= v2.2) or ffmpegthumbnailer
- imagemagick (tested with >= v6.6)
Installation
composer require emgag/video-thumbnail-sprite
Usage
use Emgag\Video\ThumbnailSprite\ThumbnailSprite; $sprite = new ThumbnailSprite(); $ret = $sprite->setSource('path-to-source-video.mp4') ->setOutputDirectory('dir-to-store-sprite-and-vtt') // filename prefix for image sprite and WebVTT file (defaults to "sprite", resulting in "sprite.jpg" and "sprite.vtt") ->setPrefix('sprite') // absolute URL of sprite image or relative to where the WebVTT file is stored ->setUrlPrefix('http://example.org/sprites') // sampling rate in seconds ->setRate(10) // minimum number of images (will modify sampling rate accordingly if it would result in fewer images than this) ->setMinThumbs(20) // width of a single thumbnail in px ->setWidth(120) ->generate(); // $ret = ['vttFile' => 'path-to-vtt-file', 'sprite' => 'path-to-sprite-file']
There are two different thumbnailing methods available, ffmpeg (default) or ffmpegthumbnailer.
// default, is set implicitly if not provided $sprite->setThumbnailer(new Thumbnailer\Ffmpeg()); // change thumbnailer to ffmpegthumbnailer $sprite->setThumbnailer(new Thumbnailer\FfmpegThumbnailer());
To keep individual source images of the sprite instead of removing it after assembling the sprite into a single image:
$sprite->setOutputImageDirectory('dir-to-store-images');
Acknowledgments
- Inspired by vlanard/videoscripts and scaryguy/jwthumbs.
- Thanks to Mehrdad-Dadkhah for adding ffmpegthumbnailer support and other additional features.
Uses:
- captioning/captioning
- emgag/flysystem-tempdir
- intervention/image
- php-ffmpeg/php-ffmpeg
- symfony/process
- thephpleague/flysytem
License
video-thumbnail-sprite is licensed under the MIT License.
emgag/video-thumbnail-sprite 适用场景与选型建议
emgag/video-thumbnail-sprite 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.79k 次下载、GitHub Stars 达 26, 最近一次更新时间为 2015 年 05 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ffmpeg」 「sprite」 「jwplayer」 「ffmpegthumbnailer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 emgag/video-thumbnail-sprite 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 emgag/video-thumbnail-sprite 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 emgag/video-thumbnail-sprite 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Official JW Player client
Generate sprites with PHP and twig templates
The UNOFFICIAL sprite of the Silk icons by FamFamFam (http://www.famfamfam.com/lab/icons/silk/)
A PHP command line tool for converting SVG images to a set of CSS icons (SVG & PNG, single icons and / or CSS sprites) with support for image optimization and Sass output
Thumbnails for videos
The `ThraceMediaBundle` handles file, video, audio and image upload plus some image manipulations.
统计信息
- 总下载量: 5.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 26
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-19