Encoder Architecture
The LCK SDK uses a platform-abstracted encoder interface with hardware-accelerated implementations.ILCKEncoder Interface
ILCKEncoder extends both TSharedFromThis<ILCKEncoder, ESPMode::ThreadSafe> and FRunnable — encoding runs on a dedicated background thread.
Texture encoding uses FTextureRHIRef for direct GPU access, not UTextureRenderTarget2D.ILCKEncoderFactory
Factory interface for creating platform-specific encoders.Encoder Selection
Encoders register via Unreal’s modular feature system and are discovered at runtime:Platform Implementations
- Windows
- Android
FLCKWindowsEncoder
Uses Windows Media Foundation for hardware-accelerated H.264 encoding.Features:- Hardware acceleration via GPU
- H.264 Baseline to High profile
- AAC-LC audio encoding
- Direct GPU texture access
- Windows 10 or later
- DirectX 11 compatible GPU
- Media Foundation runtime
- NVIDIA GeForce GTX 600+
- AMD Radeon HD 7000+
- Intel HD Graphics 4000+
Encoding Pipeline
1
Frame Capture
Scene capture component renders to render target texture
2
Texture Transfer
GPU texture data transferred to encoder (zero-copy when possible)
3
Video Encoding
Hardware encoder compresses frame to H.264
4
Audio Mixing
FLCKAudioMix combines audio sources
5
Audio Encoding
PCM audio encoded to AAC
6
Muxing
Video and audio streams combined into MP4 container
Performance Considerations
Frame Timing
Memory Usage
Thread Safety
EncodeTexture()must be called from game threadEncodeAudio()is safe from any thread- Internal encoding runs on dedicated worker threads