Video

VideoPlayer

Decodes a video file or URL and exposes the current frame as a Texture.

Codec Containers Notes
VP9 .webm, .mp4
AV1 .webm, .mp4 Best compression and quality
WebP .webp Supports transparency
H.264 .mp4 Windows only via Media Foundation, not recommended
var player = new VideoPlayer();
player.OnLoaded += () => Log.Info( $"Loaded {player.Width}x{player.Height}" );
player.Play( FileSystem.Mounted, "videos/intro.webm" );

Streaming over HTTP/HTTPS is also supported:

player.Play( "https://example.com/stream.webm" );

VideoPlayer.Texture updates each frame and can be used anywhere a Texture is accepted.

panel.Style.SetBackgroundImage( player.Texture );
material.Set( "Texture", player.Texture );

Audio settings live on the Audio accessor:

player.Audio.Volume = 0.5f;
player.Audio.Position = WorldPosition;
player.Audio.TargetMixer = Mixer.FindMixerByName( "Music" );

VideoWriter

Encodes a sequence of RGBA frames into a video file. Used internally by the screen recorder.

Codec Containers Notes
VP9 .webm, .mp4 Best compatbility
AV1 .webm, .mp4 Best compression and quality
WebP .webp Animated WebP, supports transparency

WebM supports transparency. The EncodingPreset on VideoWriter.Config controls speed vs quality: Fast for real-time recording, Balanced for general use, Quality for offline export.

var writer = new VideoWriter( "recordings/output.mp4", new VideoWriter.Config
{
    Width = 1920,
    Height = 1080,
    FrameRate = 60,
    Bitrate = 14,
    Codec = VideoWriter.Codec.AV1,
    Container = VideoWriter.Container.MP4,
    Preset = VideoWriter.EncodingPreset.Fast,
    AudioCodec = VideoWriter.AudioCodec.Opus,
} );

writer.AddFrame( rgbaBytes );

await writer.FinishAsync();





Created 22 Apr 2026
Updated 22 Apr 2026