gif压缩 android,GIFCompressor - 使用快速的,硬件加速的编码器将GIF压缩为轻量级的MP4视频...

badge.svg?event=push68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e61746172696f312f474946436f6d70726573736f722e73766768747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f6e61746172696f312f474946436f6d70726573736f722e737667

4408f232a9627d94ac7ec3210d7de8ca.png

Looking for a complete and powerful video transcoder? Take a look at our Transcoder.

Need support, consulting, or have any other business-related question? Feel free to get in touch.

Like the project, make profit from it, or simply want to thank back? Please consider sponsoring me!

GIFCompressor

An Android tool to compress GIF files into the MP4 format, using hardware-accelerated Android codecs available on the device. Works on API 18+.

implementation 'com.otaliastudios.gif:compressor:1.0.0'

Fast compression to lightweight MP4 (AVC)

Hardware accelerated

Multithreaded

Convenient, fluent API

Concatenate multiple GIF files [docs]

Choose output size, with automatic cropping [docs]

Choose output rotation [docs]

Choose output speed [docs]

Choose output frame rate [docs]

Override frames timestamp, e.g. to slow down the middle part of the video [docs]

Error handling [docs]

Configurable strategies [docs]

screenshot-1.pngscreenshot-2.png

Support

If you like the project, make profit from it, or simply want to thank back, please consider sponsoring me through the GitHub Sponsors program! You can have your company logo here, get private support hours or simply help me push this forward.

Feel free to contact me for support, consulting or any other business-related question.

Setup

Please read the official website for setup instructions and documentation. You might also be interested in our changelog. Using GIFCompressor in the most basic form is pretty simple:

GIFCompressor.into(filePath)

.addDataSource(context, uri) // or...

.addDataSource(context, filePath) // or...

.addDataSource(context, fileDescriptor) // or...

.addDataSource(dataSource)

.setListener(new GIFListener() {

public void onGIFCompressionProgress(double progress) {}

public void onGIFCompressionCompleted() {}

public void onGIFCompressionCanceled() {}

public void onGIFCompressionFailed(@NonNull Throwable exception) {}

}).compress()

Take a look at the demo app for a complete example.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值