All Projects → Reone → Mrthumb

Reone / Mrthumb

Licence: apache-2.0
【拇指先生】 a simple easy video thumbnail provider,顺滑的获取视频缩略图,支持本地和网络视频,有问题大胆提Issues

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mrthumb

Ptshowcaseviewcontroller
An initial implementation of a "showcase" view( controller) for iOS apps... Visualizes images, videos and PDF files beautifully! (by @pittleorg) [meta: image, photo, video, document, pdf, album, gallery, showcase, gallery, iOS, iPhone, iPad, component, library, viewer]
Stars: ✭ 395 (+558.33%)
Mutual labels:  image, photo
Vue Parallax
🌌 Vue.js component for parallax image scroll effects
Stars: ✭ 569 (+848.33%)
Mutual labels:  image, fast
Tui.image Editor
🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
Stars: ✭ 4,761 (+7835%)
Mutual labels:  image, photo
Assetspickerviewcontroller
Powerfully Customizable - Multiple Photo & Video Picker Controller
Stars: ✭ 321 (+435%)
Mutual labels:  image, photo
Eager Image Loader
The eager-loading for image files on the web page that loads the files according to your plan. This differs from the lazy-loading, for example, this can be used to avoid that the user waits for the loading.
Stars: ✭ 22 (-63.33%)
Mutual labels:  image, fast
Tkimageview
An easy way to crop an image.
Stars: ✭ 342 (+470%)
Mutual labels:  image, photo
Lgphotobrowser
照片浏览器,相册选择器,自定义照相机(支持单拍、连拍)
Stars: ✭ 527 (+778.33%)
Mutual labels:  image, photo
Rxgalleryfinal
图片选择库,单选/多选、拍照、裁剪、压缩,自定义。包括视频选择和录制。
Stars: ✭ 2,798 (+4563.33%)
Mutual labels:  image, photo
Fastify Esso
The easiest authentication plugin for Fastify, with built-in support for Single sign-on
Stars: ✭ 20 (-66.67%)
Mutual labels:  fast, easy
Flutter image cropper
A Flutter plugin for Android and iOS supports cropping images
Stars: ✭ 723 (+1105%)
Mutual labels:  image, photo
Fdtake
Easily take a photo or video or choose from library
Stars: ✭ 314 (+423.33%)
Mutual labels:  image, photo
Color.js
Extract colors from an image (0.75 KB) 🎨
Stars: ✭ 42 (-30%)
Mutual labels:  image, photo
Flutter photo manager
Provide flutter with the ability to manage photos.
Stars: ✭ 294 (+390%)
Mutual labels:  image, photo
React Image Magnify
A responsive image zoom component designed for shopping sites.
Stars: ✭ 391 (+551.67%)
Mutual labels:  image, photo
Flutter photo
Pick image/video from album by flutter. Support ios and android. UI by flutter, no native.
Stars: ✭ 285 (+375%)
Mutual labels:  image, photo
Resizer
An image resizing library for Android
Stars: ✭ 406 (+576.67%)
Mutual labels:  image, photo
duckphp
PHP框架,PHP Framework. keep PHP simple and fast. Laravel larva and Smarty is evil
Stars: ✭ 125 (+108.33%)
Mutual labels:  fast, easy
downscale
Better image downscale with canvas.
Stars: ✭ 80 (+33.33%)
Mutual labels:  fast, photo
Jspaint
🎨 Classic MS Paint, REVIVED + ✨Extras
Stars: ✭ 5,972 (+9853.33%)
Mutual labels:  online, image
Photobrowser
Elegant photo browser in Swift. 图片与视频浏览器。
Stars: ✭ 975 (+1525%)
Mutual labels:  image, photo

拇指先生 Mrthumb

预览图

库说明

  • a simple easy video thumbnail provider
  • 顺滑的获取视频缩略图
  • 支持网络视频缩略图
  • 使用方便

源码下载,分支说明

请下载对应版本号的分支下载源码浏览,master分支为代码最新状态,却不一定是生成库的源代码,而且有可能是有问题的代码。而生成库后的源码,我会新建一个对应版本号的分支,以保存库源码初始状态。一供查错,二供浏览。

原理说明

  • 使用MediaMetadataRetriever获取视频信息及缩略图
  • 使用MediaMetadataRetrieverCompat支持FFmpeg和自带两种解码方式
  • 使用线程异步加载缩略图并缓存
  • 支持两种不同的加载顺序选择:顺序、乱序
  • 获取不到缩略图时取最近的缩略图

引用说明

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.Reone:Mrthumb:v1.1.0'
}

使用说明

1.加载缩略图

if (playState == NiceVideoPlayer.STATE_PREPARED) {
    //视频准备好后开始加载缩略图
    Mrthumb.obtain().buffer(videoUrl, videoDuration, Mrthumb.Default.COUNT);
    //更详细的可以调用如下方法
    //Mrthumb.obtain().buffer(videoUrl, null, videoDuration, Mrthumb.Default.RETRIEVER_TYPE, Mrthumb.Default.COUNT, Mrthumb.Default.THUMBNAIL_WIDTH, Mrthumb.Default.THUMBNAIL_HEIGHT);
}

2.获取缩略图

float percentage = (float) seekBar.getProgress() / seekBar.getMax();
Bitmap bitmap = Mrthumb.obtain().getThumbnail(percentage);

3.添加缓存进度回调

Mrthumb.obtain().addProcessListener(new ProcessListener() {

    @Override
    public void onProcess(final int index, final int cacheCount, final int maxCount, final long time, final long duration) {
        if (delegate != null) {
            delegate.thumbProcessLog("cache " + time / 1000 + "s at " + index + " process:" + (cacheCount * 100 / maxCount) + "%");
        }
    }
});

4.回收资源

Mrthumb.obtain().release();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].