-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Save into .bag file pyrealsense2 #4057
Comments
Hi @filipematosinov , If I understand your question correctly, then you can do that by setting up config objects and passing them to the start function of the pipeline object. There is some example code in issue #3044. I am collecting data from two D435 cameras in this fashion. There are a number of issues to be aware of (such as the one that I linked). |
Thank you @realsens01. I am now able to save them correctly. However, to read it how can I read it frame by frame (i.e not reading at the actual fps of the video) in order to preform some calculations to each frame which are slower than the actual fps. |
Some time ago, I tried doing this with the Realsense playback feature, but I had better luck with the rosbag python interface. Take a look at the rosbag wiki for examples. On Ubuntu, the relevant package for me was installed via
This pulls out the color image stream. Leave out However, I see posts on the forum that seem to indicate that there's been relevant developments in the Realsense API. Others on the forum might be able to give you a better idea about what is the most appropriate approach, at present. Hopefully, someone more knowledgeable will chime in. |
Thanks for the advice @realsens01 :). Let's see if someone comes up with a high level realsense API approach. In the meantime I will have a look at tje python ROSBAG package, I was trying to avoid using ROS but maybe is better not to be scared!! |
Moreover is it possible to save multiple cameras in the same bag? From your example it seems you can have several devices but using the pyrealsense API we have to call config (config.enable_record_to_file(...) ) which is created for each camera if I am correct |
My experience with the rosbag API has been far better than librealsense API. Admittedly, my experience is somewhat limited in both cases, but everything I tried worked as the documentation said it would. On the other hand, I've had problems with Realsense for months, and the documentation / support haven't been much help. I do not believe that it is possible to save multiple cameras in the same bag with the Realsense API, but I am not certain. You are correct: I initialize and configure each of my two cameras separately, and they record to a pair of bag files. |
@filipematosinov Did you get it through now? Any other questions? Looking forward to your update. Thanks! |
@filipematosinov Just as realsens01 mentioned, currently saving multiple cameras in the same bag not supported. Any other questions about this ticket? |
@filipematosinov If no other questions about it, will close it accordingly. Thanks! |
Issue Description
Hello,
I am wondering how is the best way to save a stream (color + depth) into a .bag using pyrealsense. I have seen several examples to read from a bag file but nothing to save. My particular application needs to save to streams (from two cameras) to two .bag files.
The text was updated successfully, but these errors were encountered: