An Android video editing application powered by OpenGL ES for real-time GPU rendering, ExoPlayer for media playback, and FFmpeg for video processing.
- Features
- Architecture
- Project Structure
- Rendering Pipeline
- Transitions
- Tech Stack
- Requirements
- Getting Started
- Permissions
| Feature | Status |
|---|---|
| Play video | β |
| Play image | β |
| Play background music | β |
| Apply transitions (25+) | β |
| Timeline editor | β |
| Media picker (video & image) | β |
| Audio volume mixing | β |
| Merge video and image | π§ In progress |
| Apply filters (Brightness, Contrast, Gamma) | π§ In progress |
| Apply effects | π§ In progress |
| Multi-screen graph layouts | π§ In progress |
| Trim video | π² Planned |
| Trim music | π² Planned |
| Export edited video | π² Planned |
The project follows a multi-module architecture with a clear separation between the UI layer and the core editing engine.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β app module β
β βββββββββββββββ ββββββββββββββ ββββββββββββββββββββββββββββ
β β Activities β β Fragments β β Adapters / Dialogs ββ
β β ββββββββββ β β Transition β β AdapterMedia ββ
β β β Main β β β Filter β β AdapterSpecial ββ
β β βActivityβ β β Effect β β AdapterMusic ββ
β β ββββββββββ β β Graph β β DialogTool ββ
β β ββββββββββ β β Special β β DialogMixVolume ββ
β β β Media β β β PickMusic β β ββ
β β β Pick β β ββββββββββββββ ββββββββββββββββββββββββββββ
β β ββββββββββ β β
β βββββββββββββββ Singleton / LiveData / Retrofit β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β depends on
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β masteredit module β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β ManagerPlayerMedia (Orchestrator) β β
β β ββββββββββββββββ ββββββββββββββ βββββββββββββββββ β β
β β β VideoPlayer β β Music β β PreViewLayoutβ β β
β β β Control β β Player β β Control β β β
β β β βExoManager β β Control β β βGLPlayerViewβ β β
β β ββββββββββββββββ ββββββββββββββ βββββββββββββββββ β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β SpecialPlayControl ββ β
β β β Transitions β Filters β Effects β Graphs ββ β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββ β
β β GL Renderer β β GLSL Shaders β β Models & Enums β β
β ββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Role |
|---|---|
| ManagerPlayerMedia | Central orchestrator that coordinates video playback, music, transitions, and effects |
| VideoPlayerControl | Wraps ExoPlayer for video/image playback and media queue management |
| MusicPlayerControl | Manages background music playback and volume |
| PreViewLayoutControl | Manages the OpenGL preview surface and filter chains |
| SpecialPlayControl | Handles transitions, effects, and graph layout rendering |
| GLPlayerRenderer | Core OpenGL ES renderer with shader-based processing |
| TimeLineControl | Visual timeline editor with track management |
MasterEditVideo/
βββ app/ # UI & Application module
β βββ src/main/java/com/dongnh/mastereditvideo/
β βββ app/ # Application class
β βββ base/ # Base API response models
β βββ const/ # Event & media constants
β βββ model/ # Data models (Music, Tab, MixSound)
β βββ singleton/ # Shared LiveData state
β βββ utils/
β β βββ adapter/ # RecyclerView adapters
β β βββ control/ # Timeline & duration controls
β β βββ dialog/ # Tool & volume dialogs
β β βββ exts/ # Kotlin extensions
β β βββ interfaces/ # Callback interfaces
β β βββ retrofit/ # Network layer (Retrofit + OkHttp)
β β βββ view/ # Custom views
β βββ view/
β βββ main/ # MainActivity (main editor)
β βββ pickmedia/ # MediaPickActivity
β βββ transition/ # TransitionFragment
β βββ filter/ # FilterFragment
β βββ effect/ # EffectFragment
β βββ graph/ # GraphFragment
β βββ special/ # SpecialFragment
β βββ pickmusic/ # PickMusicFragment
β
βββ masteredit/ # Core editing engine library
β βββ src/main/
β βββ java/com/dongnh/masteredit/
β β βββ base/ # Abstract transition classes
β β βββ const/ # Filter, media, transition constants
β β βββ control/ # Player & preview controls
β β βββ eglcore/ # EGL configuration
β β βββ enums/ # Format, resource, scale enums
β β βββ filter/ # GL filters (Brightness, Contrast, Gamma)
β β βββ gl/ # OpenGL utilities & FBO management
β β βββ graph/ # Multi-screen layout effects
β β βββ manager/ # ManagerPlayerMedia
β β βββ model/ # MediaModel, MusicModel, SpecialModel
β β βββ render/ # GLPlayerRenderer
β β βββ transition/ # 25+ transition effects
β β βββ utils/ # ExoManager, extensions, custom views
β βββ assets/
β βββ transition/ # Transition JSON + thumbnails + GLSL shaders
β βββ graph/ # Graph layout JSON + thumbnails + shaders
β βββ filter/ # Filter definitions
β βββ effect/ # Effect definitions + FFmpeg shaders
β
βββ build.gradle # Root build config
βββ settings.gradle # Module settings
βββ gradle.properties # Gradle JVM & AndroidX config
The app uses a custom OpenGL ES rendering pipeline to process and display video frames in real-time:
ββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββββ
β Media Files βββββ>β ExoPlayer βββββ>β SurfaceTexture β
β (Video/Image) β β (decode frames) β β (frame buffer) β
ββββββββββββββββ ββββββββββββββββββββ ββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β GLPlayerRenderer β
β (OpenGL ES 2.0) β
ββββββββββ¬βββββββββββββ
β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββ
β Filter Chain β β Transitions β β Graph β
β Brightness β β (GLSL shaders) β β Layouts β
β Contrast β β Progress-based β β 2/3/4/6 β
β Gamma β β animation β β screen β
β LUT β β (0.0 β 1.0) β β splits β
ββββββββββ¬ββββββββββ ββββββββββ¬βββββββββ ββββββββ¬ββββββββ
β β β
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββ
β GLPlayerView β
β (Preview Output) β
ββββββββββββββββββββ
Each transition effect follows a three-layer pattern:
βββββββββββββββββββββββ
β *Transition class β Logic & lifecycle (extends AbstractTransition)
β e.g. FadeTransitionβ
βββββββββββ¬ββββββββββββ
β uses
βββββββββββΌββββββββββββ
β *TransDrawer class β OpenGL draw calls & texture binding
β e.g. FadeTransDrawer
βββββββββββ¬ββββββββββββ
β uses
βββββββββββΌββββββββββββ
β *TransShader class β GLSL vertex + fragment shaders
β e.g. FadeTransShader
βββββββββββββββββββββββ
25+ built-in transition effects, all rendered via GLSL shaders:
| Window Slice | Simple Zoom | Cross Zoom | Luminance Melt | Cross Hatch |
| Wipe Right | Wipe Left | Wipe Down | Wipe Up | Dreamy Zoom |
| Fade | Directional Wipe | Wind | Inverted Page Curl | Swap |
| Cube | Circle Open | PinWheel | Angular | Hexagonalize |
| Pixelize | Perlin | Bounce |
| Technology | Version | Purpose |
|---|---|---|
| Kotlin | 1.7.20 | Primary language |
| Android Gradle Plugin | 7.3.1 | Build system |
| OpenGL ES 2.0 | - | Real-time GPU rendering |
| ExoPlayer | 2.18.2 | Media playback (video, audio) |
| FFmpeg Kit | 5.1 (min) | Video processing & encoding |
| GPUImage | 2.1.0 | GPU-based image filtering |
| Library | Version | Purpose |
|---|---|---|
| Core KTX | 1.9.0 | Kotlin extensions for Android |
| AppCompat | 1.6.0 | Backward-compatible UI |
| Material Components | 1.7.0 | Material Design UI |
| ConstraintLayout | 2.1.4 | Flexible layouts |
| RecyclerView | 1.2.1 | Scrollable lists |
| Lifecycle (LiveData + ViewModel) | 2.5.1 | Reactive state management |
| Data Binding | - | View binding |
| Flexbox | 3.0.0 | Flexible box layouts |
| Library | Version | Purpose |
|---|---|---|
| Retrofit | 2.9.0 | REST API client |
| OkHttp | 5.0.0-alpha.11 | HTTP client + logging |
| Gson | 2.10.1 | JSON serialization |
| Glide | 4.14.2 | Image loading & caching |
| Library | Version | Purpose |
|---|---|---|
| Timber | 5.0.1 | Logging |
| CircleImageView | 3.1.0 | Circular image views |
- Android Studio: Arctic Fox or later
- Min SDK: 24 (Android 7.0 Nougat)
- Target SDK: 33 (Android 13)
- Java: 1.8+
- Kotlin: 1.7.20+
-
Clone the repository
git clone https://github.com/user/MasterEditVideo.git
-
Open in Android Studio
Open the project root directory in Android Studio.
-
Sync Gradle
Let Android Studio download all dependencies and sync the project.
-
Build & Run
Select a device or emulator (API 24+) and click Run.
Note: The app runs in landscape mode by default.
| Permission | Purpose | API Level |
|---|---|---|
READ_EXTERNAL_STORAGE |
Access media files on device | < 33 |
WRITE_EXTERNAL_STORAGE |
Save exported videos | < 33 |
READ_MEDIA_IMAGES |
Access images | 33+ |
READ_MEDIA_VIDEO |
Access videos | 33+ |
READ_MEDIA_AUDIO |
Access audio files | 33+ |
INTERNET |
Download music & assets | All |
ACCESS_NETWORK_STATE |
Check network connectivity | All |
This project is for demo and educational purposes.
