【发布时间】:2016-08-09 09:09:25
【问题描述】:
我需要从此视频流中获取帧:http://tcp://62.109.15.84:1300
我使用了这种方法,但它不适合视频流。
public static Bitmap getVideoFrame(Context context, Uri uri) {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(uri.toString(),new HashMap<String, String>());
return retriever.getFrameAtTime(50000000,MediaMetadataRetriever.OPTION_NEXT_SYNC);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
} catch (RuntimeException ex) {
ex.printStackTrace();
} finally {
try {
retriever.release();
} catch (RuntimeException ex) {
}
}
return null;
}
【问题讨论】:
标签: java android stream video-streaming