Best way to record a video of live use of Slicer

Hi devs.

For what I have read I should use C++ CLI modules so Slicer GUI doesn’t turn unresponsive to achieve my goal. That would be a CLI module call to takeScreenShot every 33mseg after a button is pressed, till that button is pressed again, then a CLI module convertFolderWithTempPicturesToVideo should be called. And the result would be the desired functionality (i.e. record live use videos of Slicer) without disturbing the user. Is this way okey? Is there any other way to do this (e.g. using other threads for these operations)?

Does it have to be done from Slicer? Could you use an external program to record?

I would not suggest a CLI here. You can get a screenshot quickly by grabbing a widget in a QTimer callback. Look how it is done in the ScreenCapture and Sequences modules.

1 Like

Yes. I have a working TakeScrenshot function that came from editing this.

I’ve got to take the screenshots with a timer callback and then I could create the video.
The intended FPS is 30 for recording (e.g. timer.setInterval(1000//30)) but it really is like 5 or 8 (and Slicer GUI gets jumpy). So when the video gets compiled at 30FPS it looks like it is fast-speed. Do you know how to really get 30FPS while recording and a fluid Slicer GUI interaction?

I have found it easy to use the “Xbox Game Bar” app that comes with Windows. I just do Windows Key + G which brings up the app identifying the current application in use, press the record button then press the hovering stop button when I’m finished. Recording starting/stopping is a manual action by the user, but doesn’t require reinventing a screen recorder.

3 Likes

+1 to using the built in OS tools - for reference I use QuickTime Player on mac, which also has a screen recording utility and basic editing tools. VLC is handy for exporting to other file formats.

1 Like

It is for a Slicelet that will be launched on the cloud.
I think if we use a Windows docker container, we could use shell calls to start and stop recording with a built in Windows tool. Do you think that would be possible?

Im sure there’s a way to make it work, but I haven’t looked into the details.

1 Like

You could look into Open Broadcaster Studio (https://obsproject.com/), which is an excellent open-source screen recorder for all platfoms. If you are thinking of using a container OBS might work for you.

The GitHub repo: GitHub - obsproject/obs-studio: OBS Studio - Free and open source software for live streaming and screen recording

Greydon