Customizable Android video recorder library that can combine multiple videos
Customizable Android video recorder library that can combine multiple videos
The library provides a way to record multiple videos using MediaRecorder and merge them together using FFmpeg Recorder from JavaCV. It is designed to allow maximum customization of the video encoding and recording.
It has built in activities for easy recording and previewing. But it also exposes basic components that can be used to customize your own UI and logic.
All components are designed to be extensible and usable without all the other components. Some of the main components:
Wrapper for camera library that abstracts away some of the complications about checking support for various features.
SurfaceView that scales and crops the view so that it matches the desired resolution.
Recorder that simplifies logic for recording multiple video clips.
Task that combines multiple video files and transforms the video frames into the desired resolution.
Activity that allows the user to record videos in a way similar to instagram and snapchat
Activity to preview the recorded video before selecting the video
There is a demo activity that allows you to try different settings for recording videos.
compile 'com.amosyuen.ffmpegvideorecorder:ffmpeg-video-recorder:2.0.3'
com.amosyuen.ffmpegvideorecorder
ffmpeg-video-recorder
2.0.3
pom
git clone git://github.com/amosyuen/FFmpegVideoRecorder.gitFor a working implementation, please have a look at the demo project
For Android M and above, make sure you request the following permissions before starting the activity:
Send an intent to start the activity with the desired parameters. The parameters are required:
…onActivityResult method and handle request code sent in step 3.…This error means that the native libraries were not installed properly. One common problem is that Android doesn't support loading both 64-bit and 32-bit native libraries at the same time. Unfortunately the FFmpeg library used in this library only has 32-bit binaries. So if your app includes another dependency that has 64-bit libraries, this will make the app unable to load the video recorder. The only workaround is to exclude 64-bit native libraries. This can be done by adding these lines in your app gradle build file:
android {
//...
packagingOptions {
exclude "lib/arm64-v8a/**"
exclude "lib/x86_64/**"
}
//...
}This library is based off of these sources:
It uses https://github.com/bytedeco/javacv for combining and encoding videos.
No open issues yet, or sync has not completed.