pawlox/video-thumbnail

Video thumbnails
279,778 23
Install
composer require pawlox/video-thumbnail
Latest Version:v5.2.0
PHP:>=8.0
Laravel:10 · 11 · 12
Older releases:5 – 9
License:MIT
Last Updated:Mar 26, 2025
Links: GitHub  ·  Packagist
Maintainer: pawlox

Video Thumbnail

Simple package for generating video thumbnail in Laravel using FFMpeg.

Support my work

If you want to support my work in other way than contributing the code itself, you can always pass me some small donation :beer: at https://paypal.me/pawlox :)

Installation

Composer install:

composer require pawlox/video-thumbnail

After package installation, add the ServiceProvider to the providers array in config/app.php

Pawlox\VideoThumbnail\VideoThumbnailServiceProvider::class

And to the aliases array

'VideoThumbnail' => Pawlox\VideoThumbnail\Facade\VideoThumbnail::class

Also you can publish package config file with:

php artisan vendor:publish --tag=video-thumbnail

and set ffmpeg and ffprobe paths in .env file:

FFMPEG="/usr/bin/ffmpeg"
FFPROBE="/usr/bin/ffprobe"

Versions

Laravel PHP pawlox/video-thumbnail php-ffmpeg/php-ffmpeg
>= ^5.0 and < ^5.8 < 7.4 ^1.* 0.11.0
^5.8 and ^6.* >= 7.4 and <= 8.1 ^2.* 0.13.0
^7.* and ^8.* >= 7.4 and <= 8.1 ^3.* 0.19.0
^9.* >= 8.0 ^4.* 1.*

Usage

VideoThumbnail::createThumbnail(
    $videoUrl, 
    $storageUrl, 
    $fileName, 
    $second, 
    $width = 640, 
    $height = 480
);

$videoUrl - absolute path to video file,
$storageUrl - absolute path where the thumbnail should be save,
$fileName - name of thumbnail file,
$second - from which second of the movie thumbnail should be created,
$width [Optional] - width (in pixels) of the thumbnail (default 640),
$height [Optional] - height (in pixels) of the thumbnail (default 480).

Example

VideoThumbnail::createThumbnail(
    public_path('files/movie.mp4'), 
    public_path('files/thumbs/'), 
    'movie.jpg', 
    2, 
    1920, 
    1080
);

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607

Version History

Version Released PHP Laravel License
v5.2.0 >=8.0 ^10.0|^11|^12 MIT
v5.1.0 >=8.0 ^10.0|^11 MIT
v5.0.0 >=8.0 ^10.0 MIT
v4.0.0 >=8.0 ^9.0 MIT
v3.0.0 >=7.4 ^7.0|^8.0 MIT