streaming RGBD data to a remote location
i am using D435 camera, and unity. i need to stream the data from the camera to a remote location. i am using the realsense sample SDK. every time i try to copy the ColorFrame and the DepthFrame in order to send copies of frames the camera freezes and i get an error of wait for frames for more than 500ms. the copy time isnt 500ms i have tried it in the RSDEvice sample class , and in a different class. i could not find an example of frames copy in C#, or frames streaming online. can anyone help?
-
Hi Irit Taragan The only C# possibility that I can think of is to embed a web browser window into a C# application and stream the camera data to that embedded browser panel.
https://github.com/IntelRealSense/librealsense/issues/7362#issuecomment-693462166
-
If the remote location is within 100 meters / 300 foot of the camera then you could also consider using a long fiber optic cable to transmit the data, like in the RealSense demonstration by the high-quality USB equipment supplier Newnex at the link below.
-
Thank you so much for the quick responseI am trying to transfer the RGBD image via WebRTC.in order to do so i need to enter the images of the RGB and depth as byte array.
each time i copy or moving a frame, the camera is stuck.is there an example of working maybe with webRTC or of coping the FrameSet in C# without it effect the camera streaming?
i am using Unity SDK 2.0 and tried to use the RSDevice.cs WaitForFrames'
private void WaitForFrames()
{
while (!stopEvent.WaitOne(0))
{
//using (var frames = m_pipeline.WaitForFrames())
var frames = m_pipeline.WaitForFrames();
RaiseSampleEvent(frames);
if (frameQueue.Count < 10)
{
frameQueue.Enqueue(frames.Clone());
}
frames.Dispose();
}
}the frame queue is my addition. should i use the RsProccessingPipe insted? (i tried it 2 but i am sure i am missing something)again,thanks for your help -
My research of your question did not find relevant resources about WebRTC and C#, unfortunately. The alternative approach of copying frames showed some promise, though. The answers from Intel RealSense team members that I saw suggested storing frames in the computer's memory with a RealSense SDK instruction called keep().
https://github.com/IntelRealSense/librealsense/issues/5565
-
Thank you very much! it works
using a concurrent FrameSet queue , my RSDEvice looks like this:private void WaitForFrames()
{
while (!stopEvent.WaitOne(0))
{var frames = m_pipeline.WaitForFrames();
RaiseSampleEvent(frames);
frames.Keep();if (frameQueue.Count >= 5)
{
// Remove and dispose of the oldest frame in the queue
if (frameQueue.TryDequeue(out var oldFrame))
{
oldFrame.Dispose();
}
}
frameQueue.Enqueue(frames);
}
}
Please sign in to leave a comment.
Comments
6 comments