2

I am trying to use pipe to extract frames from a video to get better-extracting performance. It took me 1s to extract a 1080x720 frame from the video. So, my idea is to use pipe protocol and while extracting with ffmpeg command, I have another thread to read the pipe as bitmap. Is it possible?

This is what I did in 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);

And then, I read the pipe in another thread:

if (fileInputStream == null) {
      fileInputStream = new BufferedInputStream(new FileInputStream(pipe)); // open pipe once
}
String value = convertStreamToString(fileInputStream); // read from pipe

However, this code new FileInputStream(pipe) took forever to finish. Is there something wrong with my code?

Kingfisher Phuoc
  • 8,052
  • 9
  • 46
  • 86

0 Answers0