An Android application that performs video interpolation to create smooth slow-motion videos by generating intermediate frames between existing frames.
- 📹 Video Frame Extraction: Automatically extracts frames from selected videos
- 🤖 AI Frame Interpolation: Uses machine learning to generate smooth intermediate frames
- ⚡ Adjustable Frame Rate: Choose from 2x to 10x frame rate multiplier
- 📱 Modern UI: Clean Material Design interface
- 🎬 Video Encoding: Automatically encodes interpolated frames back into video
- Language: Kotlin
- ML Framework: TensorFlow Lite
- Media Processing: MediaCodec, MediaMuxer, MediaMetadataRetriever
- UI: Material Design Components, ViewBinding
- Async: Coroutines
app/
├── src/main/
│ ├── java/com/videointerpolation/app/
│ │ ├── MainActivity.kt # Main UI and orchestration
│ │ ├── ml/
│ │ │ └── FrameInterpolator.kt # ML-based frame interpolation
│ │ └── utils/
│ │ ├── VideoProcessor.kt # Frame extraction
│ │ └── VideoEncoder.kt # Video encoding
│ ├── res/
│ │ ├── layout/
│ │ │ └── activity_main.xml # Main UI layout
│ │ └── values/
│ │ ├── strings.xml
│ │ ├── colors.xml
│ │ └── themes.xml
│ └── AndroidManifest.xml
└── build.gradle
- Frame Extraction: The app extracts individual frames from the selected video
- Interpolation: For each pair of consecutive frames, the ML model generates intermediate frames
- Encoding: All frames (original + interpolated) are encoded into a new high-framerate video
- Output: The resulting video has a higher frame rate, creating smooth slow-motion effect
- Android Studio Arctic Fox or newer
- Android SDK 24 or higher
- Device or emulator running Android 7.0+
- Open the project in Android Studio
- Sync Gradle files
- Build the project:
Build > Make Project - Run on device or emulator
The current implementation uses linear interpolation. For better results, add a TensorFlow Lite model:
- Download a frame interpolation model (e.g., FILM, RIFE)
- Convert to TFLite format if needed
- Place the
.tflitefile inapp/src/main/assets/ - Update
FrameInterpolator.ktto load and use the model
Recommended models:
- FILM (Frame Interpolation for Large Motion)
- RIFE (Real-Time Intermediate Flow Estimation)
- DAIN (Depth-Aware Video Frame Interpolation)
- Launch the app
- Tap "Select Video" to choose a video from your device
- Adjust the frame rate multiplier (2x-10x) using the slider
- Tap "Process Video" to start interpolation
- Wait for processing to complete
- Find the output video in the app's files directory
The app requires the following permissions:
READ_EXTERNAL_STORAGE/READ_MEDIA_VIDEO: To access videosWRITE_EXTERNAL_STORAGE: To save processed videos (Android 9 and below)
- Processing Time: Varies based on video length, resolution, and device performance
- Memory Usage: Large videos may require significant memory
- Storage: Processed videos are saved to external storage
- Battery: Video processing is CPU/GPU intensive
- Add GPU acceleration for faster processing
- Implement background processing with notifications
- Add video trimming/cropping before interpolation
Issue: Video encoding fails
- Solution: Ensure sufficient storage space and valid video format
Issue: Out of memory errors
- Solution: Try processing shorter videos or reduce resolution
Issue: Slow processing
- Solution: Use lower frame rate multiplier or shorter videos
This project is provided as-is for educational purposes.
Built with Android Studio and TensorFlow Lite