PHPackages                             owen-oj/laravel-getid3 - 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. owen-oj/laravel-getid3

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

owen-oj/laravel-getid3
======================

This package is a wrapper around james-heinrich/getid3 to extract various information from media files

v2.6.0(1mo ago)86514.4k↓44.6%13[1 PRs](https://github.com/Owen-oj/laravel-getid3/pulls)1MITPHPCI failing

Since Jan 3Pushed 3w ago2 watchersCompare

[ Source](https://github.com/Owen-oj/laravel-getid3)[ Packagist](https://packagist.org/packages/owen-oj/laravel-getid3)[ Docs](https://github.com/owen-oj/laravel-getid3)[ RSS](/packages/owen-oj-laravel-getid3/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (10)Versions (22)Used By (1)

laravel-getid3
==============

[](#laravel-getid3)

[![Latest Version on Packagist](https://camo.githubusercontent.com/00db6ae4716a3ef3f3d37cae0a0df1bfbbe9473baec17cf47ca920cc8f55a057/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f77656e2d6f6a2f6c61726176656c2d6765746964332e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owen-oj/laravel-getid3)[![Total Downloads](https://camo.githubusercontent.com/f201d4e0b9863e8a4554586e7bd170d79e651db4aed6353ab2e2a828bc2297b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f77656e2d6f6a2f6c61726176656c2d6765746964332e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owen-oj/laravel-getid3)[![StyleCI](https://camo.githubusercontent.com/a89c7a2044186814a2232ad45b1ce2f4b4d22bdb028c8b81440d2580ab0b1ec7/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136333735343535352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/163754555)

A Laravel wrapper around [james-heinrich/getid3](https://github.com/JamesHeinrich/getID3) that extracts audio and video metadata from local files, uploaded files, and remote storage disks (including S3).

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/kkoj)

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

[](#installation)

```
composer require owen-oj/laravel-getid3
```

> Laravel 5.5+ auto-discovers the service provider. For older versions add `Owenoj\LaravelGetId3\GetId3ServiceProvider::class` to the `providers` array in `config/app.php`.

Instantiation
-------------

[](#instantiation)

```
use Owenoj\LaravelGetId3\GetId3;
use Illuminate\Support\Facades\Storage

// From an uploaded file (e.g. from a form request)
$track = GetId3::fromUploadedFile(request()->file('file'));

// From a Laravel storage disk (works with local, S3, etc.)
$track = GetId3::fromDiskAndPath('local', '/some/file.mp3');
$track = GetId3::fromDiskAndPath('s3', 'uploads/video.mp4');
$track = GetId3::fromDiskAndPath(Storage::disk('public'), 'uploads/video.mp4');

// Direct constructor with a file path
$track = new GetId3('/absolute/path/to/file.flac');
```

Quick start
-----------

[](#quick-start)

```
// Raw array of everything getID3 can extract
$track->extractInfo();

// Common audio tags
$track->getTitle();          // "Bohemian Rhapsody"
$track->getArtist();         // "Queen"
$track->getAlbum();          // "A Night at the Opera"
$track->getYear();           // "1975"
$track->getPlaytime();       // "5:55"
$track->getPlaytimeSeconds(); // 354.63

// Common video info
$track->getVideoWidth();     // 1920
$track->getVideoHeight();    // 1080
$track->getVideoAspectRatio(); // "16:9"
$track->getFrameRate();      // 29.97
$track->getVideoCodec();     // "h264"

// Check what kind of media it is
$track->isAudio();  // true / false
$track->isVideo();  // true / false
```

Available Methods
-----------------

[](#available-methods)

### File information

[](#file-information)

MethodReturn typeDescription`extractInfo()``array`Raw getID3 data array — everything the library can extract`getFileFormat()``string|null`Container/wrapper format (e.g. `"mp3"`, `"mp4"`, `"flac"`)`getFileSize()``int|null`File size in bytes`getFileSizeForHumans()``string|null`Human-readable size (e.g. `"4.20 MiB"`)`getMimeType()``string|null`MIME type (e.g. `"audio/mpeg"`, `"video/mp4"`)`getMd5Data()``string|null`MD5 hash of the data stream (when available)`getSha1Data()``string|null`SHA-1 hash of the data stream (when available)### Media-type detection

[](#media-type-detection)

MethodReturn typeDescription`isAudio()``bool``true` when the file has audio and **no** video stream`isVideo()``bool``true` when the file contains a video stream`hasAudio()``bool``true` when an audio stream is present`hasVideo()``bool``true` when a video stream is present### Duration

[](#duration)

MethodReturn typeDescription`getPlaytime()``string|null`Formatted duration (e.g. `"3:45"`)`getPlaytimeSeconds()``float`Duration in seconds (e.g. `225.48`)### Tags / metadata

[](#tags--metadata)

MethodReturn typeDescription`getTitle()``string`Track title; falls back to filename`getArtist()``string|null`Artist name`getAlbum()``string|null`Album name`getComposer()``string|null`Composer`getYear()``string|null`Release year`getGenres()``array`List of genres`getTrackNumber()``string|null`Track number (e.g. `"4/12"`)`getDiscNumber()``string|null`Disc/set number`getCopyrightInfo()``string|null`Copyright string`getComment()``string|null`General comment or description tag`getLyrics()``string|null`Embedded lyrics (unsynchronised lyric tag)`getBpm()``string|null`Beats per minute### Artwork

[](#artwork)

MethodReturn typeDescription`getArtwork()``string|null`Embedded artwork as a base64-encoded string`getArtwork(true)``UploadedFile|null`Artwork saved to a temp file, returned as an `UploadedFile` JPEG`getArtworkData()``string|null`Raw binary artwork data (no base64 overhead)`getArtworkMimeType()``string|null`MIME type of the artwork (e.g. `"image/jpeg"`)```
// Base64 string — embed directly in an  src
$base64 = $track->getArtwork();

// UploadedFile JPEG — move it anywhere Laravel's Storage accepts
$jpeg = $track->getArtwork(true);
Storage::disk('public')->put('covers/'.$jpeg->getFilename(), file_get_contents($jpeg->getPathname()));

// Raw binary — pass straight to an image library
$binary = $track->getArtworkData();
$mime   = $track->getArtworkMimeType(); // "image/png"
```

### Audio stream

[](#audio-stream)

MethodReturn typeDescription`getAudioCodec()``string|null`Codec name (e.g. `"mp3"`, `"aac"`, `"flac"`, `"vorbis"`)`getSampleRate()``int|null`Sample rate in Hz (e.g. `44100`, `48000`)`getBitrate()``int|null`Overall file bitrate in bps`getAudioBitrate()``int|null`Audio track bitrate in bps`getBitrateMode()``string|null``"cbr"`, `"vbr"`, or `"abr"``getChannels()``int|null`Channel count (1 = mono, 2 = stereo, 6 = 5.1, …)`getChannelMode()``string|null`Channel layout string (e.g. `"stereo"`, `"joint stereo"`)`getBitsPerSample()``int|null`Bit depth (e.g. `16`, `24`, `32`)`isLossless()``bool|null``true` for FLAC, ALAC, WAV, AIFF, etc.`getEncoderOptions()``string|null`Encoder options string (e.g. LAME preset)```
$track = GetId3::fromDiskAndPath('local', 'music/track.flac');

echo $track->getAudioCodec();    // "flac"
echo $track->getSampleRate();    // 96000
echo $track->getBitsPerSample(); // 24
echo $track->isLossless()
    ? 'Lossless'
    : 'Lossy';                   // "Lossless"
```

### Video stream

[](#video-stream)

MethodReturn typeDescription`getVideoCodec()``string|null`Codec name (e.g. `"h264"`, `"hevc"`, `"vp9"`, `"av1"`)`getVideoWidth()``int|null`Frame width in pixels`getVideoHeight()``int|null`Frame height in pixels`getVideoDimensions()``array``['width' => int, 'height' => int]``getFrameRate()``float|null`Frames per second (e.g. `29.97`, `60.0`)`getVideoBitrate()``int|null`Video track bitrate in bps`getVideoAspectRatio()``string|null`Simplified aspect ratio (e.g. `"16:9"`, `"4:3"`)`getVideoRotation()``int|null`Clockwise rotation in degrees (0, 90, 180, 270) — set by mobile cameras```
$video = GetId3::fromUploadedFile(request()->file('video'));

if ($video->isVideo()) {
    ['width' => $w, 'height' => $h] = $video->getVideoDimensions();
    echo "{$w}x{$h} @ {$video->getFrameRate()} fps"; // "1920x1080 @ 29.97 fps"
    echo $video->getVideoAspectRatio();               // "16:9"
    echo $video->getVideoCodec();                     // "h264"

    // Handle portrait video from a phone
    if ($video->getVideoRotation() === 90) {
        // swap width/height for display
    }
}
```

> **Container support for video metadata:** Dimensions, frame rate, codec, and rotation are resolved across MP4/QuickTime, Matroska (MKV/WebM), and RIFF/AVI containers automatically.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todo list.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Owen Jubilant](https://github.com/owen-oj)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance94

Actively maintained with recent releases

Popularity52

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 73.8% 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 ~225 days

Recently: every ~299 days

Total

13

Last Release

38d ago

Major Versions

v0.1-beta.1 → v1.02020-06-18

v1.3 → v2.02022-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/696072a2631e412e7034cdffb063a41ea7754c8a719e66cfed044004a9ac5d10?d=identicon)[Owen-oj](/maintainers/Owen-oj)

---

Top Contributors

[![Owen-oj](https://avatars.githubusercontent.com/u/13623015?v=4)](https://github.com/Owen-oj "Owen-oj (59 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![nvahalik](https://avatars.githubusercontent.com/u/632120?v=4)](https://github.com/nvahalik "nvahalik (4 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![bumbummen99](https://avatars.githubusercontent.com/u/4533331?v=4)](https://github.com/bumbummen99 "bumbummen99 (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")[![fan711](https://avatars.githubusercontent.com/u/13937640?v=4)](https://github.com/fan711 "fan711 (1 commits)")[![masterix21](https://avatars.githubusercontent.com/u/6555012?v=4)](https://github.com/masterix21 "masterix21 (1 commits)")[![mrtawil](https://avatars.githubusercontent.com/u/63475475?v=4)](https://github.com/mrtawil "mrtawil (1 commits)")

---

Tags

audioaudio-metadatafile-metadatagetid3id3id3v1id3v2laravellaravel-getid3laravel-packagemusicvideovideo-getid3laravelgetid3laravel-getid3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/owen-oj-laravel-getid3/health.svg)

```
[![Health](https://phpackages.com/badges/owen-oj-laravel-getid3/health.svg)](https://phpackages.com/packages/owen-oj-laravel-getid3)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[intervention/image-laravel

Laravel Integration of Intervention Image

1588.9M183](/packages/intervention-image-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4924.8k5](/packages/ralphjsmit-laravel-glide)

PHPackages © 2026

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