Java 在android中从视频输入流获取位图

Java 在android中从视频输入流获取位图,java,android,bitmap,Java,Android,Bitmap,从视频InputStream检索位图时遇到问题。我没有视频文件,只有视频InputStream 我使用这行代码: Bitmap bitmap = BitmapFactory.decodeStream(inputStream); …但它返回一个空的位图。我做错了什么 这是我获取InputStream的代码 public static InputStream decryptInputStream(File encryptedFile) throws Exception { Cipher c

从视频
InputStream
检索
位图时遇到问题。我没有视频文件,只有视频
InputStream

我使用这行代码:

Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
…但它返回一个空的
位图
。我做错了什么

这是我获取InputStream的代码

public static InputStream decryptInputStream(File encryptedFile) throws Exception {
    Cipher cipher = Cipher.getInstance("AES");
    cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec("MyDifficultPassw".getBytes(), "AES"));
    return new CipherInputStream(new FileInputStream(encryptedFile), cipher);
}

发布您的代码…可能您尚未初始化properly@Akshay我已经发布了我的代码。我很确定bitmapfactory希望输入流来自位图,而不是视频。我认为您需要找到一种方法,首先从inputstream中提取单个帧。它是否在try/catch块中?@reden,我认为您是对的。但如何从输入流中获取帧呢?