What Problem Does This Solve?
Recording and streaming have different requirements. Recording prioritizes quality and file size—you want high bitrate, 60fps, large files you’ll upload later. Streaming prioritizes bandwidth and latency—lower bitrate, 30fps, smaller data sent live.LckCaptureType lets you switch between these modes, which automatically applies the appropriate track descriptor from your quality options (recording vs. streaming settings).
When to Use This
UseLckCaptureType when:
- Your app supports both recording and streaming
- You want different quality settings for each mode
- Users can toggle between “Record for upload” vs. “Stream live”
- You need to optimize for bandwidth (streaming) vs. quality (recording)
Quick Example
How It Works
When you define aQualityOption, you specify two track descriptors:
LckCaptureType.Recording→ usescameraTrackDescriptorLckCaptureType.Streaming→ usesstreamingCameraTrackDescriptor
Common Patterns
Toggle between modes with UI
Auto-select based on network
Initialize to default mode
Typical Settings by Mode
Recording Mode
Optimized for quality and upload:- Higher bitrate (8-12 Mbps) for better quality
- Higher framerate (60 fps) for smooth motion
- Larger file sizes acceptable
Streaming Mode
Optimized for bandwidth and latency:- Lower bitrate (3-5 Mbps) to reduce bandwidth
- Standard framerate (30 fps) for stability
- Smaller data packets for real-time delivery
Enum Values
API Reference
Set Capture Type
captureType—RecordingorStreaming
LckResult indicating success/failure
Get Capture Type
LckResult containing current capture type
When to Switch Modes
Before starting capture — Don’t change during active recording
Based on user preference — UI toggle for “Record” vs. “Stream”
Network availability — Auto-select streaming if online
Best Practices
Define both tracks — Always configure recording and streaming in QualityOption
Test both modes — Ensure settings work for both use cases
Stop before switching — Don’t change modes during active recording
Related
- QualityOption — Define recording and streaming tracks
- CameraTrackDescriptor — Configure bitrate/framerate