获取视频的缩略图
2016-08-04 11:51
232 查看
public Bitmap getVideoThumbnail(String filePath) {
Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(filePath);
bitmap = retriever.getFrameAtTime();
}
catch(IllegalArgumentException e) {
e.printStackTrace();
}
catch (RuntimeException e) {
e.printStackTrace();
}
finally {
try {
retriever.release();
}
catch (RuntimeException e) {
e.printStackTrace();
}
}
return bitmap;
}
Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(filePath);
bitmap = retriever.getFrameAtTime();
}
catch(IllegalArgumentException e) {
e.printStackTrace();
}
catch (RuntimeException e) {
e.printStackTrace();
}
finally {
try {
retriever.release();
}
catch (RuntimeException e) {
e.printStackTrace();
}
}
return bitmap;
}
相关文章推荐
- Rails
- gsoap 天气预报
- Java截取url参数的方法
- 阿里大鱼发短信SDK遇到的一点问题
- Ubuntu系统之MySql+sqlyog安装配置教程
- 最短路
- jenkins
- 利用 Framework 进行动态更新
- Eclipse常用的快捷键
- (网络层)IP 协议首部格式与其配套使用的四个协议(ARP,RARP,ICMP,IGMP)
- 根据 url地址 下载图片
- Spring Boot——开发新一代Spring Java应用
- MySQL的Sleep进程
- 超大批量删除redis中无用key+配置
- 记一次给centOS磁盘扩容
- MySQL:mysql存储emoji表情以及默认字符集修改
- Scala学习笔记3 - 类和对象
- AppCan教你从零开始做开发
- 洛谷[luogu] P1641 [SCOI2010]生成字符串(Catalan数(折线原理)+乘法逆元)
- Percona Xtradb Cluster