facebookresearch / vrs

VRS is a file format optimized to record & playback streams of sensor data, such as images, audio samples, and any other discrete sensors (IMU, temperature, etc), stored in per-device streams of timestamped records.
https://facebookresearch.github.io/vrs/
Apache License 2.0
308 stars 53 forks source link

What's a good way to save multiple synchronized images? #150

Closed tlsunn closed 3 months ago

tlsunn commented 3 months ago

Hi there, I have read the sample record app and have the above quesiton. If I have multiple images arrive at once, what's a good way to save them? Should I split them into multiple image streams or should I add content blocks in addRecordFormat?

Thanks in advance for your time and help!

georges-berenger commented 3 months ago

The preferred way is to save each image in their own stream, in concurrent threads. That's what we do with all our devices that have multiple equivalent cameras pointing in different directions (eg, Quest's positional cameras). You then need to identify each stream/camera, using a stream tag or a stream flavor, and that works well with vrsplayer that will show multiple cameras side by side. Another way is to create a record with multiple image content types, but you then need to grab the multiple frames and create a record that combines them all in one API call. That's more error prone (more complex definitions/formats) and bug prone (race conditions), and vrsplayer won't display all the images.

tlsunn commented 3 months ago

Got it, thank you so much!