This page documents the main Android video-processing interface centered on
processing/VideoProcessor.kt.
VideoProcessor(context, modelManager, segmentDetectionConfig = SegmentDetectionConfig.balanced())
Responsibilities:
- inspect source video metadata
- classify input resolution
- detect slide-change segments
- enhance representative frames
- reuse cached results or bypass already-readable frames
- re-encode a final output video
suspend fun processVideo(inputUri: Uri, outputFile: File, onProgress: (ProcessingProgressUpdate) -> Unit): ProcessingResult
| Parameter | Meaning |
|---|---|
inputUri |
source video selected by the user or downloaded by the app |
outputFile |
destination under app-private storage |
onProgress |
callback for UI and WorkManager progress updates |
| Type | Meaning |
|---|---|
ProcessingResult.Success |
output path plus ProcessingStats |
ProcessingResult.Error |
failure message |
The pipeline reports progress by ProcessingPhase:
PREPARINGDETECTINGENHANCINGRE_ENCODINGSAVING
ProcessingProgressUpdate carries:
- overall progress
- estimated seconds left
- current phase
| Type | Purpose |
|---|---|
VideoSegment |
start/end timestamps plus representative frame |
EnhancedSegment |
per-segment enhancement outcome and timing |
VideoMetadata |
width, height, duration, rotation, frame rate, bitrate, audio presence |
ProcessingStats |
total frames, enhanced frames, cached frames, bypassed frames, segment counts, battery impact |
| Class | Role |
|---|---|
ModelManager |
loads the correct TFLite model and runs inference |
SlideDetector |
detects scene or slide boundaries |
SequentialFrameDecoder |
efficient frame sampling for detection |
QualityMetrics |
OCR-based bypass and quality-related calculations |
BatteryMonitor |
collects battery usage estimates |
The class exposes OCR_BYPASS_THRESHOLD to skip SR inference when a frame is
already readable enough to avoid unnecessary work.
VideoEnhancementWorker is the main caller. It:
- creates the output path
- subscribes to progress
- maps
ProcessingResultinto WorkManager output data
See also: