Skip to content

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.

CaseBacking valueNotes
H264libx264H.264 / AVC. Requires FFmpeg built --enable-libx264.
H265libx265H.265 / HEVC. Requires --enable-libx265.
VP9libvpx-vp9VP9. Requires --enable-libvpx.
CopycopyStream-copy / remux — no re-encode.

If the chosen encoder isn’t built into the running FFmpeg, save() throws EncoderNotFoundException.

use FFmpeg\Codec\VideoCodec;
VideoCodec::H264->value; // "libx264"
$encoder->addVideo($stream, VideoCodec::Copy); // remux, no re-encode

MediaEncoder · AudioCodec

An Artisan Build project.

Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project.

Proudly sponsored by Tighten.