Items with no label
3335 Discussions

How to record video from D435 cameras

JMage
Beginner
9,948 Views

Hi everyone,

I'm new to both the D435 and RealSense SDK 2.0. I want to modify the rs-multicam c++ sample to synchronously record videos from each connected RGB camera, and to save the videos to a path.

I'm not sure where to begin, and I would really appreciate your help.

Thank you,

jmagen

0 Kudos
1 Solution
MartyG
Honored Contributor III
7,500 Views

Welcome to the RealSense community!

The options for recording with a D435 currently include:

1. Recording data into a file called a 'rosbag.

https://github.com/IntelRealSense/librealsense/blob/master/src/media/readme.md librealsense/readme.md at master · IntelRealSense/librealsense · GitHub

If you are new to recording, you may like to first experiment with recording and playing back data in the pre-made RealSense Viewer tool that comes with the SDK 2.0, as described in the above link.

A short YouTube video explaining the rosbag process is also available.

https://www.youtube.com/watch?time_continue=2&v=pwlbArh_neU rosbag - YouTube

2. The other option is to record the RealSense data into a PNG image with the SDK's 'Save-To-Disk' sampl eprogram. You could then convert the PNG into a conventional video. Google 'convert png to video' for more details.

https://github.com/IntelRealSense/librealsense/tree/master/examples/save-to-disk librealsense/examples/save-to-disk at master · IntelRealSense/librealsense · GitHub

View solution in original post

0 Kudos
5 Replies
MartyG
Honored Contributor III
7,501 Views

Welcome to the RealSense community!

The options for recording with a D435 currently include:

1. Recording data into a file called a 'rosbag.

https://github.com/IntelRealSense/librealsense/blob/master/src/media/readme.md librealsense/readme.md at master · IntelRealSense/librealsense · GitHub

If you are new to recording, you may like to first experiment with recording and playing back data in the pre-made RealSense Viewer tool that comes with the SDK 2.0, as described in the above link.

A short YouTube video explaining the rosbag process is also available.

https://www.youtube.com/watch?time_continue=2&v=pwlbArh_neU rosbag - YouTube

2. The other option is to record the RealSense data into a PNG image with the SDK's 'Save-To-Disk' sampl eprogram. You could then convert the PNG into a conventional video. Google 'convert png to video' for more details.

https://github.com/IntelRealSense/librealsense/tree/master/examples/save-to-disk librealsense/examples/save-to-disk at master · IntelRealSense/librealsense · GitHub

0 Kudos
JMage
Beginner
7,500 Views

Thanks for the quick reply, MartyG.

I very much like the playback of rosbag files within the RealSense viewer, so I would like to replicate that. I'm trying to add some recorders into the multicam sample, but I'm having a hard time creating a recorder for a stream.

Immediately after multicam's query for the list of connected RealSense devices, I inserted a query for all sensors in the context--with the hope that I could find the color streams and create a recorder for each of them.

Here is my code snippet:

for (auto&& sen : ctx.query_all_sensors()) { // Query the list of sensors

for (auto&& prof : sen.get_stream_profiles()) { // Query the list of stream profiles from sen

if (prof.stream_type() == RS2_STREAM_COLOR) {

rs2::recorder rec("stream_name.bag", sen); //This does not work

connected_devices.enable_device(rec);

}

}

}

How should I go about creating a recorder for streams?

Thanks again,

jmagen

0 Kudos
MartyG
Honored Contributor III
7,500 Views

The first thing I would try is to change rs2::recorder rec to rs2::recorder device

The rationale behind this is that rs2::recorder device, followed by an instruction such as 'pause or 'filename'', seems to be the commonly occurring structure for rs2::recorder commands.

0 Kudos
MPint4
Beginner
7,500 Views

Hi jmagen,

Did you solve this problem?

 

I'm having the same issue and haven't figured it out how to record synchronously from two devices.

Thanks,

MP

0 Kudos
idata
Employee
7,500 Views

Hello mariopintopleroma,

 

 

Have you tried changing the lines MartyG suggested?

 

 

Best regards,

 

 

Josh B.

 

Intel Customer Support
0 Kudos
Reply