Items with no label
3341 讨论

How to record video from D435 cameras

JMage
初学者
14,620 次查看

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 项奖励
1 解答
MartyG
名誉分销商 III
12,172 次查看

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 项奖励
5 回复数
MartyG
名誉分销商 III
12,173 次查看

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 项奖励
JMage
初学者
12,172 次查看

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 项奖励
MartyG
名誉分销商 III
12,172 次查看

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 项奖励
MPint4
初学者
12,172 次查看

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 项奖励
idata
员工
12,172 次查看

Hello mariopintopleroma,

 

 

Have you tried changing the lines MartyG suggested?

 

 

Best regards,

 

 

Josh B.

 

Intel Customer Support
0 项奖励
回复