Is it possible to stream the .bag format?
I've used the .bag format for recording and playback, using enable_record_to_file() and enable_device_from_file(), but I am now contemplating a use case where I would like to stream the bag contents, so that I can use record in one application and simultaneous playback in another application.
I have two reasons for wanting to do this:
- Given a fast enough network connection between two machines this would give me much more freedom of what formats to use than rs-server and networked camera would give me,
- I'm hoping that something like this would allow me to use my Realsense camera on MacOS, by running the sending application as root with sudo. The receiving application could then be in Unity or whatever, which I definitely wouldn't want to run as root.
But I cannot find any API that will pass the bag records to my code (as opposed to writing them to file), or allow my code to supply the bag records (for playback). And I can think of hacking something up using named pipes, but before I start doing that I'd like to know whether the bag format is streamable in the first place.
-
Hi Jack Jansen When recording a bag file, the pipeline should be closed at the end of recording to complete the creation of the file. Not closing the recording could lead to an incomplete recording that cannot be played back. So this would make simultaneous recording and playback impractical, as the recording should be finished before playback is initiated.
-
Ah, I see. That's too bad, then this idea won't fly.
In the documentation there is an obscure mention about the ability to have different serializers (for enable_record_to_file()) but the only serialised currently implemented being for the bag format.
Any hints on where I should look to see if it is feasible to write my own serializer?
-
I am not familiar with that serializer reference. However, if you want to perform two different activities simultaneously without one activity interfering with the other then the Python language's multiprocessing may be worth investigating.
https://github.com/IntelRealSense/librealsense/issues/10126#issuecomment-1004740043
The Multi-Streaming Model rules of the RealSense SDK also explain the rules for accessing the same camera from different applications.
Please sign in to leave a comment.
Comments
3 comments