Range selector / range seekbar to trim video including thumbnails

OneWorld picture OneWorld · Apr 13, 2016 · Viewed 15.1k times · Source

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

Answer

Natan picture Natan · Apr 21, 2016

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.