librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

IR fps decrease

Open nizihabi opened this issue 9 years ago • 1 comments

Required Info
Camera Model SR300
Firmware Version
Operating System & Version Window 10
Kernel Version (Linux Only)
Build System VS2013

I need to change mode between IR and Depth while using the camera in my project, but once I try to close the depth and restart the camera with only enabling the ir stream, it failed to start the camera, if I add Sleep(50) after calling the function stop(), it works.I wonder if there is anyway to restart the camera in different steam faster without using Sleep()?

Another question is that . if I change the camera from IR/Depth steam to only IR steam , it can't raise to 200fps, it only works at most 160fps and I don't know why the fps would decrease.

Here is my code:

void CloseDepth()
{
	if (camera->is_streaming())
		camera->stop();
	for (int j = 0; j<4; ++j)
	{
		auto s = (rs::stream)j;
		if (camera->is_stream_enabled(s))
			camera->disable_stream(s);
	}
	Sleep(50);
	camera->set_option(rs::option::f200_laser_power, 0);
	camera->enable_stream(rs::stream::infrared, 640, 480, rs::format::y8, 200);
	camera->start();
}
void OpenDepth()
{
	if (camera->is_streaming())
		camera->stop();
	for (int j = 0; j<4; ++j)
	{
		auto s = (rs::stream)j;
		if (camera->is_stream_enabled(s))
			camera->disable_stream(s);
	}
	Sleep(50);
	camera->enable_stream(rs::stream::infrared, 640, 480, rs::format::y8, 60);
	camera->enable_stream(rs::stream::depth, 640, 480, rs::format::z16, 60);
        apply_ivcam_preset(camera, 2);
	depth_intrin = camera->get_stream_intrinsics(rs::stream::depth);
	camera->start();
}

nizihabi avatar Mar 16 '17 03:03 nizihabi

@nizihabi What exact version of Windows 10 are you using? (You can check using System Information utility, under Version, something like 10.0.xyz Build xyz) Regarding your second question, if you set librealsense log level to DEBUG, you can get a lot of useful information. Add something like rs::log_to_file(rs::log_severity::debug, "1.log") to main. It will log arrival of every frame, as well as the time it took for the application to process it. This can help us troubleshoot on what level frames are being dropped.

dorodnic avatar Apr 03 '17 14:04 dorodnic