PHPackages                             selective/video-type - 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. selective/video-type

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

selective/video-type
====================

Video type detection

1.2.0(6mo ago)2113MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI failing

Since Sep 3Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/selective-php/video-type)[ Packagist](https://packagist.org/packages/selective/video-type)[ Docs](https://github.com/selective-php/video-type)[ RSS](/packages/selective-video-type/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

selective/video-type
====================

[](#selectivevideo-type)

Video type detection library for PHP.

[![Latest Version on Packagist](https://camo.githubusercontent.com/e60a47746cddd66912531fa7ec2fadf5ed409dce779a03d83fa67b41546d4e33/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73656c6563746976652d7068702f766964656f2d747970652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/selective/video-type)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![build](https://github.com/selective-php/video-type/workflows/build/badge.svg)](https://github.com/selective-php/video-type/actions)[![Total Downloads](https://camo.githubusercontent.com/54530297b15920c1470086cb337255c7cc2c1020e7c26ede256e142bd59e70ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656c6563746976652f766964656f2d747970652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/selective/video-type/stats)

Features
--------

[](#features)

- Detection of the video type based on its header
- No dependencies
- Very fast

### Supported formats

[](#supported-formats)

- **AVI** (Audio Video Interleave)
- **MKV**
- **MP4**
- **MPEG-1** Part 2
- **MPEG-2** Part 2
- **OGG** OGV
- **3G2** 3GPP2
- **3GP** 3GPP
- **WEBM**
- **QuickTime**
- **RealMedia**
- **WMV** (Windows Media Video)
- **FLV** (Adobe Flash Video)
- **MXF** (Material Exchange Format)

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

[](#requirements)

- PHP 8.1 - 8.5

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

[](#installation)

```
composer require selective/video-type

```

Usage
-----

[](#usage)

### Detect the video type of file

[](#detect-the-video-type-of-file)

```
use Selective\VideoType\VideoTypeDetector;
use Selective\VideoType\Provider\DefaultVideoProvider;
use SplFileObject;

$file = new SplFileObject('example.mp4');

$detector = new VideoTypeDetector();

// Add video detectors
$detector->addProvider(new DefaultVideoProvider());
$videoType = $detector->getVideoTypeFromFile($file);

// Get the video format
echo $videoType->getFormat(); // mp4

// Get the mime type
echo $videoType->getMimeType(); // video/mp4
```

### Detect the video type of in-memory object

[](#detect-the-video-type-of-in-memory-object)

```
$video = new SplTempFileObject();

$video->fwrite('my file content');

$detector = new VideoTypeDetector();

// Add video detectors
$detector->addProvider(new DefaultVideoProvider());

echo $detector->getVideoTypeFromFile($file)->getFormat();
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance68

Regular maintenance activity

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 67.2% 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 ~752 days

Total

4

Last Release

189d ago

Major Versions

0.1.0 → 1.0.02019-09-07

PHP version history (2 changes)0.1.0PHP ^7.2

1.2.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/89d408d7f6ed65cdbeba70a2da2d0a8a1135fc37ebc07c44989f509221cc91bd?d=identicon)[odan](/maintainers/odan)

---

Top Contributors

[![odan](https://avatars.githubusercontent.com/u/781074?v=4)](https://github.com/odan "odan (39 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (17 commits)")[![heinrichschiller](https://avatars.githubusercontent.com/u/25958414?v=4)](https://github.com/heinrichschiller "heinrichschiller (1 commits)")[![qligier](https://avatars.githubusercontent.com/u/3299399?v=4)](https://github.com/qligier "qligier (1 commits)")

---

Tags

forensicphpvideovideo-formatstypevideoformat

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/selective-video-type/health.svg)

```
[![Health](https://phpackages.com/badges/selective-video-type/health.svg)](https://phpackages.com/packages/selective-video-type)
```

###  Alternatives

[php-ffmpeg/php-ffmpeg

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

5.0k21.7M165](/packages/php-ffmpeg-php-ffmpeg)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[vimeo/vimeo-api

Official PHP library for the Vimeo API.

4637.1M32](/packages/vimeo-vimeo-api)[vimeo/laravel

A Vimeo bridge for Laravel

4161.5M4](/packages/vimeo-laravel)[codescale/ffmpeg-php

PHP wrapper for FFmpeg application

495270.5k1](/packages/codescale-ffmpeg-php)[opentok/opentok

OpenTok is a platform for creating real time streaming video applications, created by TokBox.

1413.0M10](/packages/opentok-opentok)

PHPackages © 2026

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