trinity
trinity is an open source shooting and short video processing tool, written in kotlin and c++, which implements most of the popular features of short video editing software.
QQ exchange group
125218305
Contact me
- email: wlanjie888@gmail.com
git commit specification
- Follow git cz
Code Specification
- Kotlin indent using 2 spaces indent
- C++ code follows google c ++ style guide
System version
Support Android 4.3 And above
Development environment
- Android Studio 3.5
- NDK r20
- kotlin 1.3.41
Open source library used
- fdk-aac
- ffmpeg 3.4
- libx264
- xlogger
- mnnkit
Features
Video shooting | |
Function Description | Whether to support |
Multi-session recording | √ |
Custom duration | √ |
Custom camera configuration | √ |
Camera switch | √ |
flash | √ |
Focus adjustment | √ |
Manual focus | √ |
Mute | √ |
Beauty | x |
Microdermabrasion | √ |
Custom resolution and bit rate | √ |
Record background sound | √ |
Recording speed | √ |
Hard and soft coding | √ |
Video editing | |
Multi-segment editing | √ |
Replace fragment | √ |
Set clip time | √ |
Background music | √ |
Hard decode | √ |
Special effects | |
Filter | √ |
Flash white | √ |
Two split screen | √ |
Three-point screen | √ |
Quarter screen | √ |
Six split screen | √ |
Nine points screen | √ |
Blur split screen | √ |
Gaussian blur | √ |
Soul out | √ |
shake | √ |
glitch | √ |
70s | √ |
Face recognition | |
Rose eye markup | √ |
Princess | √ |
Sticker makeup | √ |
Falling pig | √ |
Cat head | √ |
Face effect
Special effects debugging
Use xcode to debug special effects in the project, you need to install glfw before use
brew install glfw
Then use xcode to openlibrary/src/main/cpp/opengl.xcodeproj
Just
Switch effect call code
image_process.OnAction("param/blurScreen", 0);
Automated test
- Use uiautomator2 for automatic testing
Use as follows:
Then use
adb devices
Just enter the device name in the terminal
Performance
Use
Note: The permission judgment is not made in the SDK. The caller needs to apply for permission when using it. The time involved in the SDK is milliseconds.
Add jcenter dependency
Permission requirements
Recording
Configuration parameter
- Create a recording preview view
- Create a recording interface instance
- Destroy the recording interface instance
Callback settings
- Set video rendering callback
- Set recording progress callback
- Set camera callback
Open preview
- Start preview
- End preview
- Set preview type
Recording control / management
- Switch camera
- Get the current camera
- Switch flash
- Setting up zoom
- Set exposure
- Manual focus
- Set the angle of the recorded video
- Set up silent recording
- Double speed recording
Start recording
- Start recording a video
- End recording
Video editing
Initialization
- Create editor instance
- Set preview screen
Import video
- Add a snippet
- Add fragments based on subscripts
- Delete a clip
- Get the number of fragments
- Get a clip based on the subscript
- Replace a snippet based on a subscript
- Get all clips
- Total time to get all clips
- Get the progress of the currently playing clip
- Get start and end time of specified clip
- Find subscripts of clips based on time
Background music
- Add background music
- Updated background music
- Remove background music
Add special effects
- Add ordinary filters
- Update filters
- Delete filter
- Add vibrato effect
- Updated vibrato effect
- Remove vibrato effect
Start preview
- Play
- time out
- Resume playback
- Stop play
Release resources
Export video
- Create export instance
- Start export
- Cancel
- Freed