Codec\VideoCodec
A string-backed enum naming the video encoder for
MediaEncoder::addVideo(). The backing value is the FFmpeg
encoder name (or "copy"), so the choice is an output decision that lives on the
addVideo() call — not on the stream.
| Case | Backing value | Notes |
|---|---|---|
H264 | libx264 | H.264 / AVC. Requires FFmpeg built --enable-libx264. |
H265 | libx265 | H.265 / HEVC. Requires --enable-libx265. |
VP9 | libvpx-vp9 | VP9. Requires --enable-libvpx. |
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\VideoCodec;
VideoCodec::H264->value; // "libx264"$encoder->addVideo($stream, VideoCodec::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.