-
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
How to stop enable_to_record_file()? #9423
Comments
Hi @hyebin-rdv As you have already created code to listen for a key input of '0' or '1', what you are seeking to achieve should be straightforward to implement using the stop and start recording code in the SDK's C++ rs-record-playback example program. |
I have already seen that document. But it did not help me.
how to stop record..? |
I believe that the recording stop instruction should look like this in your script:
You should not need to use m_cfg.disable_all_streams(); as stopping the pipeline should stop all active streams anyway. |
Then is there a way to keep streaming and create bag recordings only? |
If you have the option of using ROS to record a bag file then you could use the -split command of the rosbag record tool of ROS. This allows you to define a condition for when the current bag file will stop recording and a new file will automatically be created to continue the recording without stopping. A recording can be set to close and continue the recording in a new file after a certain amount of time has passed or when the bag file recording reaches a certain file size. |
Then do you know how to record video to use option of using Ros?
how to add video topic? |
If you needed to convert a bag file created with rosbag record to video then the rosbag2video tool may be helpful, though it is written in Python language rather than C++. https://github.com/mlaiacker/rosbag2video If you are currently publishing a ROS topic that uses RGB then the instruction rosbag record --all should capture all currently active topics into a rosbag. Alternatively, you can specify a precise list of topics to record to a bag, as described in the link below. |
I got it. I know how to record it!! Thanks.
|
To create an instruction to record a list of topics with rosbag record, you just put rosbag record at the start and then the list of topics that you want to record after it. So in your case, it might look like this: rosbag record /rdvcam0/camera/rgb/image_mask /rdvcam0/camera/rgb/image_raw /rdvcam0/rdv_rcnn_topic/pc_all |
nono, I know how to record but my If I use 'roslaunch realsense2_camerars_camera.launch' here, and 'rostopic list', I can get the list I want. I want the same list to come out of the code I've written now. How can I use that roslaunch code with my code? |
Okay, I think I understand now. You want to record the list of topics below but you do not have those topics available when using the rs_camera.launch roslauch instruction. /rdvcam0/camera/rgb/image_mask Could you launch rs_camera in one terminal and the perform the launch that produces the above non-RealSense topic list in a separate ROS terminal? And then use rosbag record in a third ROS terminal to record the above list to a bag with: rosbag record /rdvcam0/camera/rgb/image_mask /rdvcam0/camera/rgb/image_raw /rdvcam0/rdv_rcnn_topic/pc_all |
Thanks. Then can I get a video, not an image, using the 'rosbag record'? The image is obtained by recording like that, but the video is not obtained. Is there a way to add topic as a video? |
Or do you know how to do two functions with one camera? |
At this point, let's pause and confirm what you are trying to achieve so that there is not confusion. Are you hoping to publish topics in ROS and then read those topics with a C++ ROS node script? Or are you only using rosbag record now. |
Anything. My ultimate goal is to record videos whenever I want. My program is already using the realsense camera to capture images. I want to record a video whenever I want regardless of the capture motion. I want to record a video whenever I want regardless of the capture motion. The enable_record_to_file function requires pipe.stop() to stop and restart recording. This is what I want to ultimately get "video" from using topics. If I want to get a video using topics, do I have to keep calling it into an infinite loop? |
If you are open to using any method, the link below has a Python script for recording depth and color in real-time as .avi format videos. Further Python options for video recording are discussed in the link below. The link below about making video recordings using the ROS image_view tool also looks interesting. http://wiki.ros.org/image_view#image_view.2Fdiamondback.video_recorder |
Ok, Thank you! It is so helpful! |
You are very welcome @hyebin-rdv - thanks for the update! |
Issue Description
I'm saving files using the enable_to_record_file function. I want to stop recording when a certain command comes from here.
If number_test is 0, I want to stop recording&save and restart new recording when number_test is 1.
The text was updated successfully, but these errors were encountered: