- 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;
- }
抓取视频缩略图
推荐阅读
- tf.name_scope tf.variable_scope学习
- win10+anaconda虚拟环境python3.6+cuda9.0+cudnn7+pytorch0.4.1
- windows下安装python过程
- Windows下基于python3使用word2vec训练中文维基百科语料(一)
- Attention-over-Attention Neural Networks for Reading Comprehension论文总结
- 阅读关于DuReader:百度大规模的中文机器阅读理解数据集
- (一 )安装爬虫库
- Tensorflow所遇坑
- 使用ubuntun16.04代码笔记
- 在ubuntu16.04+python3.5情况下安装nltk,以及gensim时pip3安装不成功的解决办法