Codec\AudioCodec
A string-backed enum naming the audio encoder for
MediaEncoder::addAudio(). The backing value is the FFmpeg
encoder name (or "copy"), so the choice is an output decision that lives on the
addAudio() call — not on the stream.
| Case | Backing value | Notes |
|---|---|---|
AAC | aac | FFmpeg’s native AAC encoder (always available). |
MP3 | libmp3lame | Requires FFmpeg built --enable-libmp3lame. |
Opus | libopus | Requires --enable-libopus. |
FLAC | flac | Lossless; native encoder. |
Copy | copy | Stream-copy / remux — no re-encode. |
If the chosen encoder isn’t built into the running FFmpeg, save() throws
EncoderNotFoundException.
Example
Section titled “Example”use FFmpeg\Codec\AudioCodec;
AudioCodec::AAC->value; // "aac"$encoder->addAudio($stream, AudioCodec::Copy); // remux, no re-encodeSee also
Section titled “See also”An Artisan Build project.
Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project.
Proudly sponsored by Tighten.