What Problem Does This Solve?
ILCKEncoder abstracts platform-specific video encoding so you don’t have to:
- Windows uses Media Foundation
- Android uses NDK MediaCodec
- Quest uses Vulkan texture interop
ULCKService handles it all.
When to Use This
Read this if:- Building a custom encoder (very advanced)
- Debugging encoding issues
- Understanding LCK’s internal architecture
- Extending LCK to new platforms
ULCKService instead.
Interface Definition
Encoder Factory
Encoders are discovered and created via Unreal’s modular features system:Finding an Encoder at Runtime
Platform Implementations
Windows: FLCKWindowsEncoder
Technologies:IMFSinkWriter— MP4 muxingIMFTransform— H.264 video encodingIMFMediaType— AAC audio encoding- Direct3D 11 texture interop
- Hardware-accelerated encoding via GPU
- Triple-buffered texture pool (avoids GPU stalls)
- Async encoding thread
- Supports DX11 render targets
Android: FLCKAndroidEncoder
Technologies:AMediaCodec— H.264/AAC hardware encodingAMediaMuxer— MP4 container- Vulkan/EGL texture interop
- Android Hardware Buffer
- Hardware-accelerated encoding on Quest
- Vulkan texture export via EGL
- Low-latency pipeline
- Direct write to device storage
- Quest uses Vulkan for rendering
- CPU readback would be too slow (kills performance)
- EGL interop lets encoder access GPU memory directly
- This is why
LCKVulkanmodule must load atEarliestPossiblephase
Data Flow
Audio Encoding
Audio flows from audio sources → mixer → encoder:Thread Safety
Encoding runs on a dedicated background thread:- Encoding is CPU-intensive
- Running on game thread would cause stuttering
- Background thread keeps game smooth
- Queue-based design prevents race conditions
Creating a Custom Encoder
Step 1: Implement ILCKEncoder
Step 2: Create Factory
Step 3: Register via Modular Features
Debugging Encoder Issues
Enable Verbose Logging
Common Encoder Errors
Windows:Android:
Vulkan interop:
LCKVulkan module loads at EarliestPossible phase
Key Takeaways
Platform abstraction — One interface, multiple implementations
Modular features — Runtime encoder discovery and creation
Triple buffering — Prevents GPU stalls on texture readback
Background thread — Encoding doesn’t block game thread
Most devs don’t need this — Use ULCKService for recording
Related
- Architecture — How encoders fit into the system
- Module Loading — Platform-specific encoder modules
- Service Interface — High-level recording API
- Best Practices — Encoding performance tips