Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Mediainfo

Php Mediainfo Laravel Package

mhor/php-mediainfo

A PHP wrapper around the MediaInfo CLI for reading detailed metadata from audio and video files. It provides a clean object-oriented API for codecs, duration, bitrate, resolution, channels, and track details, returning parsed output for easy inspection.

Deep Wiki
Context7

PHP wrapper around the mediainfo command

Frequently asked questions about Php Mediainfo
How do I install mhor/php-mediainfo in a Laravel application?
Install the package with Composer using composer require mhor/php-mediainfo. You must also install the mediainfo CLI binary on every machine that will run extraction, including local development, CI, and queue workers. After that, wrap the package in a Laravel service or adapter rather than calling it directly from controllers.
Does mhor/php-mediainfo require the mediainfo binary to be installed?
Yes. The package is a thin PHP wrapper around the external mediainfo command-line tool, so the binary is a hard runtime dependency. Installing the Composer package alone is not enough. Add mediainfo to your Docker image, CI setup, and production host provisioning, and pin the binary version for consistency.
Which PHP and Laravel versions does mhor/php-mediainfo support, and is it actively maintained?
The package metadata provided here does not list explicit PHP or Laravel version constraints, so check its composer.json and release history before adopting it. There is also no repository link in the supplied metadata, so verify provenance, license, and recent commit activity yourself. Treat it as a commodity utility and keep it behind an application-owned interface in case you need to replace it.
How do I extract video duration, codec, resolution, and bitrate with mhor/php-mediainfo?
Instantiate the package against a local media file path, and it returns parsed MediaInfo output including track details, codecs, duration, bitrate, resolution, and audio channels. Map that output into your own normalized DTO or JSON structure instead of exposing package-specific shapes to the rest of the application. This keeps your Laravel code stable if the package or MediaInfo output format changes.
Can mhor/php-mediainfo read metadata from files stored on S3 or a remote Laravel disk?
Not directly. Because it invokes the mediainfo CLI, extraction needs a local file path, and the package does not understand Laravel's Storage disk abstraction. Stage remote assets to a temporary local file first, run extraction, then clean up the temp file. Plan for large-file I/O and storage costs in your upload workflow.
Should I run MediaInfo extraction in a queued job or during the HTTP request in Laravel?
Prefer a queued job after the upload completes rather than the synchronous request path. MediaInfo extraction can be slow for large files and depends on an external binary, so it belongs in asynchronous media ingestion or catalog enrichment workflows. Dispatch a job, persist the normalized metadata, and update the asset record when processing finishes.
Is mhor/php-mediainfo safe for processing untrusted user uploads?
Treat uploaded files as untrusted and review how the wrapper escapes command arguments and handles file paths. Do not pass raw user-supplied strings into the command; operate on controlled temporary paths. Also enforce subprocess timeouts and file-size limits, and consider running extraction in an isolated worker or container for defense in depth.
How do I test MediaInfo extraction in Laravel CI pipelines?
Install a pinned mediainfo binary in your CI image and commit small representative audio and video fixtures for contract tests. Assert normalized fields such as duration, codec, bitrate, and dimensions rather than brittle full-output strings. For unit tests, bind a fake MediaMetadataExtractor implementation so most of your test suite does not depend on the binary.
What are good alternatives to mhor/php-mediainfo for Laravel media metadata?
Common alternatives include ffprobe wrappers, getID3 for audio-focused metadata, and ExifTool for broad file metadata. Each has its own binary or pure-PHP tradeoffs. Define your own MediaMetadataExtractor contract so you can swap implementations without rewriting controllers, jobs, or domain logic.
What should happen if mediainfo fails or returns malformed output in production?
Define explicit failure behavior: reject the upload, quarantine the asset, or store partial metadata with a status flag. Catch extraction exceptions, enforce timeouts, and log the binary version, file type, and latency for observability. Roll out behind a feature flag with a manual or existing fallback path until results are trusted.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource