可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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:
回答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 ProgressBarView
with seekbar
where you can select the video range of video you want trime and save to the destination
VideoTrimming Like Whatsapp