$ show JoshAtticus/Compressor
Compressor is a native Android video compression application built entirely in Kotlin using Jetpack Compose and Material3 for the UI, and Android's Media3 Transformer for the actual encoding. It does not rely on FFmpeg; instead, it leverages hardware-accelerated codec APIs (H.264, H.265, AV1) to achieve fast, lightweight compression. The app follows a single-activity architecture with a ViewModel managing the full lifecycle: video selection via SAF (Storage Access Framework) or share intents, track probing to determine source properties, building a compression plan based on user-defined presets or target file size, executing the transformation, and saving the output to the gallery or a custom folder. The codebase is well-structured with clear separation between UI screens, reusable composable components (InfoRow, CheckboxRow, SelectionChip, etc.), utility classes for hardware detection and file operations, and a theme system that supports dynamic colors and Android 16 tokens. It includes comprehensive unit tests for the ViewModel, utilities, and audio processor, as well as CI/CD workflows and fastlane metadata for Play Store deployment. The project demonstrates strong Android engineering practices, with attention to edge cases (device-specific workarounds for MediaTek, Huawei, Pixel), fallback logic in audio encoding, and a customizable filename token system. While the core compression logic is tightly coupled to the app's domain, several utility modules and UI components are designed with reusability in mind and could be extracted for other Android media projects.
The LLM identified 3 files worth highlighting for reuse:
Custom implementation of Media3's AudioProcessor that handles volume adjustment and audio encoding format fallback. When direct processing of the original audio format is unsupported, it gracefully falls back to PCM 16-bit, ensuring compatibility across devices. This component is self-contained, implements a well-defined interface, and can be reused in any Android app using Media3's Transformer for custom audio processing.
A utility class that provides runtime detection of codec capabilities (encoder/decoder support, resolution and framerate limits) and device-specific workarounds (e.g., MediaTek VBR quirk, Huawei muxer fallback, Pixel HDR tonemap). It uses Android's MediaCodecInfo APIs and build properties to adapt compression parameters. This module is reusable in any Android media application that needs to query hardware encoder/decoder support and apply device-specific fixes.
Contains the `expressiveScale` animation function, a custom Compose animation curve that provides a more pronounced scaling effect than standard easing. It uses a cubic bezier or spring-based approach to create a lively UI response. This is a small, isolated utility that can be extracted and used in any Jetpack Compose project to enhance animation expressiveness.