ddeboer/transcoder
PHP library for transcoding audio and video files via FFmpeg, offering a fluent object-oriented API to convert formats, extract frames, and inspect media. Simplifies multimedia processing in any PHP or Laravel project.
Transcoder interface with Iconv, Mbstring, and Recode backends, plus an OneshotTranscoder that tries them in sequence. That is precisely the shape of a "accept files in whatever encoding the customer's legacy system produced" capability. It informs whether we ship charset conversion as a first-class feature or a hidden implementation detail.OneshotTranscoder concept forces a product question we should answer explicitly: when mbstring is absent or iconv silently mangles a string, do we fail the import, or do we fall back and tell the user which engine won? This package argues for the latter, which maps to better error telemetry and clearer user-facing conversion reports.recode backend requires a system binary most container images don't ship. Treat as a reference implementation, not a dependency.Consider it when:
iconv, mbstring, and recode rather than a single hard-coded call.//TRANSLIT) or charset pairs that mb_convert_encoding handles poorly.Look elsewhere when:
recode is rarely installed in containers, so the RecodeTranscoder is dead weight unless you control the image.mb_detect_encoding with a strict allowlist, symfony/string, or a mojibake-specific library instead.iconv with an mbstring fallback covers the large majority of real cases; recode only earns its place for exotic charsets.Executives: "There's a small free library that shows how to convert legacy file encodings reliably by trying multiple conversion engines and falling back gracefully instead of failing. It's MIT-licensed, but it hasn't been updated since 2015 and has almost no adoption, so I don't recommend depending on it. Instead I recommend we adopt the pattern — roughly one engineering day — inside our import pipeline. That unblocks customers whose files come from older systems and de-risks legacy data migrations, with no new maintenance liability and no new vendor."
Engineering: "ddeboer/transcoder is a Transcoder interface with Iconv, Mbstring, and Recode implementations, and an OneshotTranscoder that chains them. Right shape for a text-ingestion service. Wrong lifecycle: PHP 5-era, unmaintained since 2015, and the recode backend needs a system binary we don't ship. Proposal: copy the interface and fallback chain into App\Support\Transcoding, keep only the iconv and mbstring backends, add explicit failure reporting and a charset allowlist, and write our own test matrix with fixture files. About a sprint day, zero new dependency, MIT-clean."
How can I help you explore Laravel packages today?