- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm currently using Python 3.7 with pyrealsense2 on Windows 10.
My end goal is to be able to preview a rgb stream while recording both depth and rgb to disk.
However, when I stream only to disk with enable_record_to_file(), I realize that I drop frames. Is this normal? When I use the realsense viewer to record, everything looks fine, so I'm not sure what's wrong.
I set the configuration enable_stream to 30 fps, but it's clear that the videos of the exported bag files do not reflect that.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have dealt with several cases where frames are dropped during recording. Here's an example:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the response.
I tried using keep() and I do not drop frames anymore. However, when I try to take a 20 second video, I realize my video is only 9 seconds. I realized the rosbag video cuts off prematurely, before all 20 seconds of the streams are written to the bag.
My code is as follows:
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 30)
config.enable_record_to_file('test.bag')
pipeline.start(config)
try:
start = time.time()
while time.time()-start < 20:
pipeline.wait_for_frames().keep()
finally:
pipeline.stop()
I'm guessing that the pipeline stops when only 9 seconds of the stream has been written to the bag.
Is there a workaround for this?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With rosbags, you can set a maximum duration for a recording. I believe that in Librealsense, the TIME_MAX instruction is used for this.
https://github.com/IntelRealSense/librealsense/search?q=TIME_MAX&unscoped_q=TIME_MAX Search · TIME_MAX · GitHub
For a well-informed answer about how to write a TIME_MAX instruction, posting a help request on the RealSense 'Issues' GitHub would be a good move. On the Issues page, you can click the 'New issues' button to post a question.
https://github.com/IntelRealSense/librealsense/issues Issues · IntelRealSense/librealsense · GitHub
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page