Software Archive
Read-only legacy content
17061 Discussions

Javascript camera streams

diego_R_3
Beginner
865 Views

Hello,

I would like to access the raw color stream from the camera and display it on a canvas tag. Disregard any performance issues, unless you have suggestions. I am trying to find a way to do this from the realsense-3.0.js file but still lost

 

 

Thanks!

0 Kudos
4 Replies
diego_R_3
Beginner
865 Views

I feel like I need to add a method to:

function PXCMSenseManager(instance) {
    var instance = instance;
    var self = this;

.....}

 

something like this:

this.StreamFrames = function () {
        return RealSense.connection.call(instance, 'PXCMSenseManager_StreamFrames', { blocking: false });
    };

But the code "PXCMSenseManager_StreamFrames" must be changed to something else. How its done in C# might give out a clue:

PXCMSenseManager pp = PXCMSenseManager.CreateInstance();
            if (pp == null) 
            {
                form.UpdateStatus("Failed to create an SDK pipeline object");
                return;
            }
            if (!form.IsModeLive())
                pp.captureManager.SetFileName(form.GetFileName(), form.IsModeReocrd());

            /* Set Input Source */
            PXCMCapture.DeviceInfo dinfo2 = form.GetCheckedDevice();
            if (form.IsModeLive() || form.IsModeReocrd()) 
                pp.captureManager.FilterByDeviceInfo(dinfo2);

            /* Set Color & Depth Resolution */
            PXCMCapture.Device.StreamProfileSet filter = new PXCMCapture.Device.StreamProfileSet();
            PXCMCapture.Device.StreamProfile cinfo = form.GetColorConfiguration();
            if (cinfo.imageInfo.format!=0)
            {
                Single cfps = cinfo.frameRate.max;
                pp.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, cinfo.imageInfo.width, cinfo.imageInfo.height, cfps);
                filter.color = cinfo;
            }

 

Help!!!

0 Kudos
diego_R_3
Beginner
865 Views

Anyone? help please!

0 Kudos
samontab
Valued Contributor II
865 Views

Have you looked at the provided examples?

This one tracks your face using javascript:
c:/Program Files/Intel/RSSDK/framework/JavaScript/face_tracking.html

0 Kudos
diego_R_3
Beginner
865 Views

Yes, I have... OF COURSE. A server does the heavy lifting and JS just retrieves the data. I wonder if the server also can send raw stream info. That's why I checked the C sources, but those actually do not use a server. 

0 Kudos
Reply