Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Range selector / range seekbar to trim video including thumbnails [closed]

enter image description here

I am looking for a library or open source project that provides UI for trimming videos as you see in the screenshot. Including

  • Range selector with ability to increase, decrease and move the selection
  • Thumbnails
  • Current position of playback

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

like image 500
OneWorld Avatar asked Apr 13 '16 12:04

OneWorld


4 Answers

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.

like image 124
Natan Avatar answered Nov 07 '22 01:11

Natan


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 enter image description here

like image 26
shanraisshan Avatar answered Nov 07 '22 01:11

shanraisshan


I think this library will fit your needs.

VideoTrimmer

like image 32
Nikita Axyonov Avatar answered Nov 07 '22 01:11

Nikita Axyonov


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.

desc

range selector

enter image description here

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.

like image 27
Stefano Cappa Avatar answered Nov 07 '22 01:11

Stefano Cappa