Android 如何使用管道从视频中提取帧,并每1秒读取一次?

Android 如何使用管道从视频中提取帧,并每1秒读取一次?,android,fileinputstream,mobile-ffmpeg,Android,Fileinputstream,Mobile Ffmpeg,我尝试使用管道从视频中提取帧,以获得更好的提取性能。从视频中提取1080x720帧花了我1秒的时间。所以,我的想法是使用管道协议,在使用ffmpeg命令提取时,我有另一个线程将管道读取为位图。可能吗 这就是我在Android中所做的: String pipe = Config.registerNewFFmpegPipe(context); FFmpeg.execute("ffmpeg -re -y -i rtsp://wowzaec2demo.streamlock.net/vod/mp

我尝试使用管道从视频中提取帧,以获得更好的提取性能。从视频中提取1080x720帧花了我1秒的时间。所以,我的想法是使用管道协议,在使用ffmpeg命令提取时,我有另一个线程将管道读取为位图。可能吗

这就是我在Android中所做的:

String pipe = Config.registerNewFFmpegPipe(context);
FFmpeg.execute("ffmpeg -re -y -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -f image2pipe -r 1 " + pipe);
然后,我在另一个线程中读取管道:

if (fileInputStream == null) {
      fileInputStream = new BufferedInputStream(new FileInputStream(pipe)); // open pipe once
}
String value = convertStreamToString(fileInputStream); // read from pipe
然而,这段新的FileInputStream(管道)代码花了很长时间才完成。我的代码有问题吗