I am looking for a library or open source project that provides UI for trimming videos as you see in the screenshot. Including
Just the UI not the trimming itself.
If there is no ready solution available, then I'd like to now how to combine existing UI elements in a smart manner to achieve this or something similiar.
Here is what I finally implemented: Range selector / range seekbar to trim video including thumbnails
I couldn't find a specific library, but you could use the MediaMetadataRetriever
to get the frames for the video specifying the exact time of the frame.
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(videoFile.getAbsolutePath());
Bitmap bitmap = retriever.getFrameAtTime(timeInMiliSeconds * 1000,
MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
I hope this helps you.
You can get the UI from TELEGRAM (messaging app) source code available at GitHub https://github.com/DrKLO/Telegram
Activity: VideoEditorActivity.java (https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java)
Layout: video_editor_layout.xml (https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/res/layout/video_editor_layout.xml)
They have implemented their custom UI components VideoSeekBarView and VideoTimelineView.
VideoSeekBarView (https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/Components/VideoSeekBarView.java)
VideoTimelineView (https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/Components/VideoTimelineView.java)
Attached is the Telegram VideoEditorActivity
I think this library will fit your needs.
VideoTrimmer
I searched a lot for something similar without success. At the end I decided to stop the development of this feature.
But today, I found this HERE. I don't know if it's ok.
range selector
Current play position travels on the rangeselector after user clicked "play". However, you can't move play position.
Another possibility is to read the source code of the official Android's application. I know that you are searching a library, but this can be another solution, and if you'll understand the google sourcecode you'll able to achieve the same quality of the Gallery application by Google.
Look here (Trim*.java classes): https://android.googlesource.com/platform/packages/apps/Gallery2/+/android-6.0.1_r31/src/com/android/gallery3d/app/
Sorry man, probably there isn't any opensource library to do that. I hope that this two links could be useful for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With