问题描述
我正在尝试使用管道从视频中提取帧以获得更好的提取性能。从视频中提取 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
然而,这段代码 new FileInputStream(pipe) 花了很长时间才完成。我的代码有问题吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)