PHPackages                             borodin-vasiliy/php-stories - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. borodin-vasiliy/php-stories

ActiveLibrary[Image &amp; Media](/categories/media)

borodin-vasiliy/php-stories
===========================

PHP-Library for create stories using images, text and animation. Use GD-Library

1.2(7y ago)3627813MITPHPPHP &gt;=5.3.0

Since Dec 27Pushed 7y ago5 watchersCompare

[ Source](https://github.com/borodin-vasiliy/php-stories)[ Packagist](https://packagist.org/packages/borodin-vasiliy/php-stories)[ RSS](/packages/borodin-vasiliy-php-stories/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

PHP Stories
===========

[](#php-stories)

PHP-Library for create video-stories (MP4) using images, text and animations for them. Dependence of the GD-library. This library create stories frame by frame and after that create video using ffmpeg. ffmpeg should be installed on your server!

Quick Start
-----------

[](#quick-start)

Install the library using [composer](https://getcomposer.org):

```
composer require borodin-vasiliy/php-stories

```

Examples
--------

[](#examples)

On examples dir you can found 2 samples how to use this library, below i will show how to create stories.

### Create object of the library

[](#create-object-of-the-library)

```

```

How you can see, args of library is array with some params. Which params you can use:

- "width" - width in px of stories layout
- "height" - height in px of stories layout
- "duration" - duration of stories in seconds
- "fps" - frame per second - how many frames will be created for each second of the video

All params are not required. If not set than, library will use default values 720x1280px, 5 seconds, 30 fps.

Now your future stories is ready for adding some elements to the video. In current moment you can add image, text, rectangle, ellipse with animation for them.

### Add objects to stories

[](#add-objects-to-stories)

Library has methods for adding each type of objects. Every time args of method - array of params. All object-types has general params:

- "top" - position of image from top
- "left" - position of image from left
- "opacity" - like css opacity - opacity of element \[0 .. 1\]
- "rotate" - rotation of element \[0 .. 359\]
- "z-index" - like css z-index - at first on layer will be added elements with less z-index
- "start" - second, when element will be added to video
- "end" - second, when element should be removed from video

And objects has additional params for this type. Lets learn, how to add each type of object to video and which params we can use.

### Add image to stories

[](#add-image-to-stories)

```

```

Additional params for images:

- "path" - required - required param with path and filename of image, ex. **DIR**."image/cat.jpg"
- "scale" - 1 default - scale of element, we dont have width and height params, just scale

### Add text to stories

[](#add-text-to-stories)

```

```

Additional params for text:

- "text" - required - Text, that you wanna add
- "path" - required - path to font .ttf file
- "size" - required - like css font-size
- "color" - like css color, ex "#ffffff"
- "width" - not required, if you use this param, text will be automatically splited to lines with setted width
- "align" - like css align \[left, center, right\]
- "shadow" - array of params, if you set them, this text will have shadow:
    - "color" - color of this shadow
    - "top" - offset from main text
    - "left" - offset from main text

### Add rectangle to stories

[](#add-rectangle-to-stories)

```

```

Additional params for rectangle:

- width - required - width of this rectangle
- height - required - height of this rectangle
- color - like css color of this rectangle

### Add ellipse to stories

[](#add-ellipse-to-stories)

```

```

Additional params for ellipse:

- width - required - width of this ellipse
- height - required - height of this ellipse
- color - like css color of this ellipse

Animation
---------

[](#animation)

Each object on video can be animated. Animation is change some param from start-value to animated value. Count of animations not limited. Each animation has own duration. Duration can be less then life-time of this element. When animation is done, animated param will be set like final point.

All types of objects has general params for animation:

- "start" - Second, when this animation should start
- "duration" - duration of animation (You can set or "duration", or "end" param)
- "end" - Second, when this animation should be finished
- "top" - To which position move this object
- "left" - To which position move this object
- "opacity" - To which opacity move this object
- "rotate" - Degree to rotate this element

And additional (just for this type):

- "scale" - for images
- "width" - for rectangle and ellipse
- "height" - for rectangle and ellipse

This library use Fluent Interface. That mean, you add element, after that can add animation for this element:

```

```

Generate stories
----------------

[](#generate-stories)

When you add all elements to your stories and set animation, you ready for generate animation and result video.

```

```

As arg of function - path to temporary dir, where will be saved frames and result video-file (MP4). As result of method generate() you will receive filename of result video in temporary dir. Generated frames will be automatically removed.

Sample of stories
-----------------

[](#sample-of-stories)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

3

Last Release

2675d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2120420244e57da9015ffd53da85cb996c2fe65f2d03f159ae6af15b804af1e4?d=identicon)[BorodinVasiliy](/maintainers/BorodinVasiliy)

---

Top Contributors

[![borodin-vasiliy](https://avatars.githubusercontent.com/u/18699506?v=4)](https://github.com/borodin-vasiliy "borodin-vasiliy (27 commits)")

---

Tags

facebookinstagramvideoanimationsocial networkvkontaktestoriesgenerate storiescreate storiesgenerate videocreate videogenerate animationcreate animation

### Embed Badge

![Health badge](/badges/borodin-vasiliy-php-stories/health.svg)

```
[![Health](https://phpackages.com/badges/borodin-vasiliy-php-stories/health.svg)](https://phpackages.com/packages/borodin-vasiliy-php-stories)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[php-ffmpeg/php-ffmpeg

FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg

5.0k21.7M165](/packages/php-ffmpeg-php-ffmpeg)[chojnicki/video-platforms-parser

Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.

22226.4k](/packages/chojnicki-video-platforms-parser)[intervention/gif

PHP GIF Encoder/Decoder

5520.3M9](/packages/intervention-gif)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.2k2](/packages/and-oauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
