سؤال

I am developing application to monitor 20 video streams at a time. I will have JFrame, and 20 boxes (e.g JPanel) inside JFrame to display 20 streams. I am able to load stream and decode using xuggler, but now how can I display this over Swing JPanel?

I am able to play sound on SourceDataLine, my problem is only, how to display 20 * 30 = 600 video frames in second on Swing component?

Also xuggler outputs YUV420P pixel format decoded frames, is there overhead in converting this to RGB, create BufferedImage and display on Swing Component?

Please guide me on this. I want to display 20 video streams at a time in swing components.

هل كانت مفيدة؟

المحلول

Here's some code I Googled that will convert a YUV420 file to BufferedImage frames. You can use this as a base for what you want.

You probably won't be able to process 600 video frames a second on a PC either. You'll have to see how many video frames you can convert per second, and drop the rest of the frames.

Probably, the best way to process 20 video feeds is to have 20 threads grabbing a video frame, converting the video frame to a BufferedImage and passing the BufferedImage to the Event Dispatch Thread (EDT) for Swing to draw on the corresponding JPanel. When the thread comes back to grab the next video frame, you'll have automatically dropped the frames that the PC didn't have time to process.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top