0

I am using J4K library to extract raw live data from kinect in java. So far I have managed to get RAW BGRA image data from kinect and convert them to PNG. Now I need to stream them into the browser as a video. So my question is any suggestions how to turn live photo frames into live video that I can stream.

This is how I receive the frames. I have no open stream nothing just frame by frame.

@Override
public void onColorFrameEvent(byte[] color_frame) {
    ...image processing
}

The client where I want to receive the video is a nodejs application but I dont think it matters here.

Pavel Kašelják
  • 351
  • 3
  • 17
  • Do you mean something like offline streaming? – MIRMIX Jun 21 '17 at 11:15
  • Well its supposed to work on localhost so I dont need to stream it online...But its supposed to be over HTTP, TCP or similar. The main issue is that I am not surre if its event possible to convert continuous series of images into video and stream it on the fly. – Pavel Kašelják Jun 21 '17 at 11:25

1 Answers1

0

Based on your tag, i am assuming you are using Kinect-v2.

The easiest way that comes up to my mind for managing and creating the live streaming running in the browser is using OpenKinect-for-Processing library. It is use friendly and easy-to-use library which runs on your browser. For quick tutorial you can check this link and look through this small youtube tutorial.

MIRMIX
  • 1,052
  • 2
  • 14
  • 40
  • Hmmm this looks promising. But it still seems that it offers images per frame. I am still unsure how do I actually convert them in java and stream them over WebSockets or some other protocol. – Pavel Kašelják Jun 21 '17 at 11:48
  • You want to save them somehow as a video? – MIRMIX Jun 21 '17 at 11:50
  • No I want to stream it to browser. So you can view the kinect live stream in browser as a webcam. – Pavel Kašelják Jun 21 '17 at 11:51
  • Yes, and this library also provides live streaming which is a sequence of frames. – MIRMIX Jun 21 '17 at 11:54
  • Can you please demonstrate how do I stream it over some protocol ? – Pavel Kašelják Jun 21 '17 at 11:57
  • Do you really want to play with protocols? You can modify the source code. You can follow this path to see the information about protocols used for different purposes OpenKinect-for-Processing/build_openKinect2/C++/libs/protonect/include/libfreenect2/protocol/ . You can also glance to these examples for getting information how to grab frames OpenKinect-for-Processing/OpenKinect-Processing/examples/Kinect_v2/ – MIRMIX Jun 21 '17 at 12:07
  • The issue here is that I have a nodejs application in which i need to display the live stream. So I am not sure that this will be exactly what I need. – Pavel Kašelják Jun 21 '17 at 12:11