Question

I could get YUV images from Camera for 20 frames per second, i want to play it as live streaming on JSP page.

I have done some research about JMF/FFMpeg, maybe they could work with J2SE(Swing),but seems hard to work on web application(Tomcat+JSP pages).

Any suggestion will be appreciated!

Was it helpful?

Solution

Based on our discussion in the comments, here's a solution that you might find feasible:

  • Client-side (browser): Code that accesses the server and streams 20 RGB frames each second and draws them on the page (like in a canvas element). The browser will be much happier drawing RGB images rather than YUV. For YUV, it would need to do conversion to RGB and that might be inefficient, especially in JavaScript.
  • Server-side: Read the raw YUV frames and convert them to RGB frames. You can leverage FFmpeg to do this or just handle the colorspace conversion yourself (the formulas are easy to find).

Be advised of the bandwidth implications, however. For example, a 320x240 video frame has 76800 pixels. 20 frames per second works out to 1536000 pixels per second. Assuming 32-bit RGB, that's 6144000 bytes, or about 6 MB of raw video data per second, per client.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top