Download the PHP package owen-oj/laravel-getid3 without Composer
On this page you can find all versions of the php package owen-oj/laravel-getid3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download owen-oj/laravel-getid3
More information about owen-oj/laravel-getid3
Files in owen-oj/laravel-getid3
Package laravel-getid3
Short Description This package is a wrapper around james-heinrich/getid3 to extract various information from media files
License MIT
Homepage https://github.com/owen-oj/laravel-getid3
Informations about the package laravel-getid3
laravel-getid3
A Laravel wrapper around james-heinrich/getid3 that extracts audio and video metadata from local files, uploaded files, and remote storage disks (including S3).
Installation
Laravel 5.5+ auto-discovers the service provider. For older versions add
Owenoj\LaravelGetId3\GetId3ServiceProvider::classto theprovidersarray inconfig/app.php.
Instantiation
Quick start
Available Methods
File information
| Method | Return type | Description |
|---|---|---|
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
| Method | Return type | Description |
|---|---|---|
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
| Method | Return type | Description |
|---|---|---|
getPlaytime() |
string\|null |
Formatted duration (e.g. "3:45") |
getPlaytimeSeconds() |
float |
Duration in seconds (e.g. 225.48) |
Tags / metadata
| Method | Return type | Description |
|---|---|---|
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
| Method | Return type | Description |
|---|---|---|
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") |
Audio stream
| Method | Return type | Description |
|---|---|---|
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) |
Video stream
| Method | Return type | Description |
|---|---|---|
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 |
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
Please see the changelog for more information on what has changed recently.
Testing
Contributing
Please see contributing.md for details and a todo list.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Owen Jubilant
- All Contributors
License
MIT. Please see the license file for more information.
All versions of laravel-getid3 with dependencies
illuminate/http Version ^11.0|^12.0|^13.0
james-heinrich/getid3 Version ^1.9
