博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
视频取首帧,并保存到SDCard
阅读量:7035 次
发布时间:2019-06-28

本文共 530 字,大约阅读时间需要 1 分钟。

hot3.png

/**

* 视频取首帧,并保存到SDCard

* @param videoPath

* @param saveThumPath

*

*/

public static Bitmap saveVideoThumbnail(String videoPath, String saveThumPath) {

Bitmap bitmap = null;

MediaMetadataRetriever retriever= new MediaMetadataRetriever();

try {

retriever.setDataSource(videoPath);

bitmap = retriever.getFrameAtTime(100);

ImageUtil.cropAndRotate(bitmap, 0, saveThumPath);

} catch (Exception ex){

} finally {

try {

retriever.release();

} catch (RuntimeException ex){}

}

return bitmap;

}

转载于:https://my.oschina.net/u/1244156/blog/203548

你可能感兴趣的文章
2012年度IT博客大赛 各奖项获奖名单
查看>>
Fragment与FragmentActivity的关系
查看>>
RIS镜像中添加网卡和RAID卡驱动方法及实践经验总结
查看>>
Window 2003证书服务器迁移到Windows 2008 R2(2)
查看>>
php的安装配置
查看>>
SecureCRT中文显示乱码问题
查看>>
Linux 设备管理
查看>>
rhel7开机启动自己shell脚本
查看>>
Git下的冲突解决
查看>>
给一个根快满了的系统扩容
查看>>
perl小程序
查看>>
linux下xargs命令用法详解
查看>>
修改eclips多余的workspace空间
查看>>
面试常问的内容——路由技术
查看>>
相对和绝对路径、cd命令、创建删除目录、rm命令
查看>>
OC伪拷贝,浅拷贝,深拷贝快速理解
查看>>
shell编程之批量修改文件名笔记小结<二>
查看>>
AccountManagerCallback<V>
查看>>
为什么入门首选C言语
查看>>
我的友情链接
查看>>