PHPackages                             codescale/ffmpeg-php - 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. codescale/ffmpeg-php

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

codescale/ffmpeg-php
====================

PHP wrapper for FFmpeg application

3.2.2(3y ago)494274.0k↓59.3%93[2 issues](https://github.com/CodeScaleInc/ffmpeg-php/issues)1BSD-3-ClausePHPPHP &gt;=7CI passing

Since May 5Pushed 1y ago31 watchersCompare

[ Source](https://github.com/CodeScaleInc/ffmpeg-php)[ Packagist](https://packagist.org/packages/codescale/ffmpeg-php)[ Docs](https://github.com/char0n/ffmpeg-php)[ RSS](/packages/codescale-ffmpeg-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (4)Versions (11)Used By (1)

[![Build Status](https://github.com/char0n/ffmpeg-php/actions/workflows/php.yml/badge.svg)](https://github.com/char0n/ffmpeg-php/actions)

FFmpegPHP
=========

[](#ffmpegphp)

FFmpegPHP is a pure OO [PSR-4 compatible](https://www.php-fig.org/psr/psr-4/) PHP port of [ffmpeg-php](http://ffmpeg-php.sourceforge.net/) library (that was written in C). It adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. It has methods for returning frames from movie files as images that can be manipulated using PHP image functions. This works well for automatically creating thumbnail images from movies. FFmpegPHP is also useful for reporting the duration and bitrate of audio files (mp3, wma...). FFmpegPHP can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv...)

Drop-in replacement for ffmpeg-php
----------------------------------

[](#drop-in-replacement-for-ffmpeg-php)

FFmpegPHP can be used as a drop in replacement for [ffmpeg-php](http://ffmpeg-php.sourceforge.net/) library.

Documentation
-------------

[](#documentation)

FFmpegPHP API documentation can be found here .

Requirements
------------

[](#requirements)

- PHP &gt;=7
- PHP extensions: gd, mbstring, xml
- [ffmpeg](https://www.ffmpeg.org/) or ffprobe

Installation
------------

[](#installation)

### Source code

[](#source-code)

Grab the source code located in `src/` directory and use it as you seem appropriate.

### Composer installation

[](#composer-installation)

Grab the `composer.phar` which can install packages published on [packagist](https://packagist.org/).

```
 $ wget https://raw.githubusercontent.com/composer/getcomposer.org/1b137f8bf6db3e79a38a5bc45324414a6b1f9df2/web/installer -O - -q | php
```

This command will create file called `composer.phar`.

Create a file called `composer.json` and paste the following JSON into it:

```
 {
    "require": {
        "char0n/ffmpeg-php": "^3.0.0"
    }
 }
```

Install the FFmpegPHP by running the following command:

```
$ php composer.phar install
```

After this command is successfully executed, the new directory called `vendor/` is created. File structure of your current working directory should now look like this:

```
 - composer.json
 - composer.phar
 - vendor/

```

To verify that everything works as expected create new file called `test.php` inside your current working directory with the following content.

```
