Get width and height of prerecorded streams.
I'm playing back bag files, and I'm enabling depth and color streams by passing 0 for width, height, fps, etc in enable_stream().
After the pipeline has started I can use get_active_profile() and get_device/query_sensors/get_active_streams/etc to see what I'm actually getting.
This gives me the fps and format for the streams, but I can't see how I can get width and height. Is there another call or another structure that I am missing?
Alternatively I would wait for the first frame to come in, but that is quite a bit less convenient given the structure of my code...
-
Hi Jack Jansen The profile.get_stresm instruction may provide what you need. Below are links to references for C++ and Python.
C++
https://github.com/IntelRealSense/librealsense/issues/2693
auto color_stream = profile.get_stream(RS2_STREAM_COLOR).as<rs2::video_stream_profile>();
auto depth_stream = profile.get_stream(RS2_STREAM_DEPTH).as<rs2::video_stream_profile>();Python
https://snyk.io/advisor/python/pyrealsense2/functions/pyrealsense2.config
intr = profile.get_stream(rs.stream.color).as_video_stream_profile().get_intrinsics()
# print( 'camera_intrinsic', intr.width, intr.height, intr.fx, intr.fy, intr.ppx, intr.ppy)
Please sign in to leave a comment.
Comments
1 comment