Range selector / range seekbar to trim video including thumbnails

匿名 (未验证) 提交于 2019-12-03 02:45:02

问题:

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

回答1:

I think this library will fit your needs.

VideoTrimmer



回答2:

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.



回答3:

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



回答4:

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.



回答5:

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



回答6:

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.



回答7:

Try the following example on Git to trime video like whatsapp .

this solution I have tried it's working perfectly this example includes the custom RangeSeekBarView , custom ProgressBarViewwith seekbar where you can select the video range of video you want trime and save to the destination

VideoTrimming Like Whatsapp



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!