microsoft / psi

Platform for Situated Intelligence
https://github.com/microsoft/psi/wiki
Other
529 stars 92 forks source link

Exporting audio and video from PSI store #313

Open kontogiorgos opened 2 months ago

kontogiorgos commented 2 months ago

Hi,

Is there a way to get video and audio serialised in psi store into other formats (.wav, .mpeg, etc.)? I saw the cli tool to get data into csv or json, but I have not seen anything for audio/video data.

Thanks, Dimos

danbohus commented 2 months ago

Yes, you should be able to write a psi audio stream to a wav file using the WaveFileWriter component, and also to write and audio and an image stream to an mpeg using the Mpeg4Writer component. You'd have to write your own little utility tool that does this (i.e. reads the psi audio/image streams from the psi store and writes them to wav/mpeg using these components). Let us know if you run into trouble using these. I think you can find an actual example of exporting to wav and mpeg in the HoloLensCaptureExporter app.

As an aside, it would be great to add this functionality (i.e. of exporting an audio stream to wav or audio+images to mpeg) as an option in PsiStoreTool. If you decide to go that route, we'd welcome a PR on that front :).

kontogiorgos commented 2 months ago

Got it, thank you Dan!

And yes, I think that PsiStoreTool functionality would be great.

HannahBruch commented 2 weeks ago

You'd have to write your own little utility tool that does this (i.e. reads the psi audio/image streams from the psi store and writes them to wav/mpeg using these components).

Hi, I'm running into some issues writing such a tool. What's the best way to read the streams and write them to a file? Am struggling to find any examples

sandrist commented 1 week ago

Take a look for example at the example code snippet under Data Replay. This shows you how to read streams from a store. You could add some lines to this code that instantiate an Mpeg4Writer component, and pipe your streams into it.