Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn enable_record_to_file() on/off #4801

Closed
bernland opened this issue Sep 4, 2019 · 6 comments
Closed

Turn enable_record_to_file() on/off #4801

bernland opened this issue Sep 4, 2019 · 6 comments

Comments

@bernland
Copy link

bernland commented Sep 4, 2019


Required Info
Camera Model D415
Firmware Version 05.11.10.00
Operating System & Version Win 10
Platform PC
SDK Version 2.27.0.1067
Language python
Segment VR/AR

Issue Description

Here's what I'm trying to achieve: I'd like to save a single (depth) frame in PLY format and a BAG stream a few seconds before and after that frame. I understand that enable_record_to_file() allows for capturing the BAG stream. However, the only way I got this to work is by restarting the pipeline with a different configuration, which is very cumbersome since I need to take a lot of subsequent snapshots.

Is there a way to turn on/off the recording feature? Just like pressing the record/stop buttons in the Intel RealSense Viewer.

@lramati
Copy link
Contributor

lramati commented Sep 4, 2019

Yes. Should look something like this:

profile = pipe.start(config) # Store the recording profile used by the pipeline
recorder = profile.get_device().as_recorder() # Obtain the streaming device and cast it to recorder type
recorder.pause() # Pause recording while continuing to stream
recorder.resume() # Resume recording of running stream

@bernland
Copy link
Author

bernland commented Sep 5, 2019

Thank you, @lramati!

In the meantime, I have found the save_single_frameset() method, which suits my needs perfectly as it allows for saving single frames with different file names. (Restarting the pipeline with a new config, on the contrary, takes quite some time.)

However, there are quite a few unanswered posts in regards to the depth frame not being recorded correctly: #4020, #2588 , #3671, and #3704.

Can you please provide an example showing how to correctly use the method?

@lramati
Copy link
Contributor

lramati commented Sep 5, 2019

The save_single_frameset processing block neglected to save the value of depth_units associated with the frame. When querying this value from the bag, it would see that it didn't have one and default to 0, which resulted in functions like depth_frame.get_distance reporting a distance of 0, even though the depth data was correctly recorded.
A pull request to fix this is incoming, but since a Pre-release version just came out, it might be a while before this change makes it into the official releases and PuPi packages. However, you can compile the branch from source if you want a fix sooner

@RealSenseCustomerSupport
Copy link
Collaborator


@bernland With the suggestion of lramati, did you get it through now? Looking forward to your update. Thanks!

@bernland
Copy link
Author

Yes, @RealSenseCustomerSupport, since compiling the branch from source, the method save_single_frameset() has been working as expected. Thank you!

@RealSenseCustomerSupport
Copy link
Collaborator


@bernland Glad to know this resolved. Close it accordingly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants