Friday, April 22, 2016

Range selector / range seekbar to trim / crop video including thumbnails

Leave a Comment

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.

5 Answers

Answers 1

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.

Answers 2

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

Answers 3

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.

Answers 4

FFMPEG is best option if you are facing problem to compile ffmpeg use this link https://github.com/WritingMinds/ffmpeg-android and follow commands from https://github.com/antpersan/CutVideoAndroid and for range Seekbar https://github.com/anothem/android-range-seek-bar or use shanrais suggested VideoSeekBarView

Answers 5

Media-for-mobile

Video processing Library

Functions

  • Transcode video
  • Join Video
  • Cut Video
  • Video Effect
  • Audio Effect
  • Get Media File Info
  • Time Scaling
  • List item

You can use its function by customizing your interface.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment