Record screen video while running script
45 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lea Bächlin
am 27 Jan. 2023
Kommentiert: Lea Bächlin
am 1 Jul. 2024
Hi!
I would like to record a video of my screen while running a psychtoolbox script (DriftDemo6). Is this possible? I tried with the Mac screen recorder, but it breaks the psychtoolbox script.
Thank you!
Lea
0 Kommentare
Akzeptierte Antwort
Aishwarya Shukla
am 3 Mär. 2023
Hi @Lea,
Yes, it is possible to record a video of your screen while running a psychtoolbox script.
One way is to use the built-in screen recording function of Psychtoolbox. You can do this by modifying your script to include the "PsychRecordScreen" function, which will start recording your screen while the script is running. However, keep in mind that this method may impact the performance of the script, especially if you're recording at a high resolution or frame rate.
Here's an example of how to use Psychtoolbox's screen recording function in your script:
% Initialize Psychtoolbox
PsychDefaultSetup(2);
Screen('Preference', 'SkipSyncTests', 1);
% Open a window
[win, winRect] = PsychImaging('OpenWindow', 0, [], [], [], [], 0);
% Start recording the screen
PsychRecordScreen('Start', 0, 'video.mp4');
% Run your script here
DriftDemo6;
% Stop recording
PsychRecordScreen('Stop');
% Close the window
sca;
In this example, the "PsychRecordScreen" function is used to start and stop recording the screen, with the resulting video saved to a file called "video.mp4". You can adjust the parameters of this function, such as the frame rate and compression level, to optimize the recording for your needs.
Another option is to record your screen without interfering with the script is to use a third-party screen recording software, such as OBS Studio or Camtasia. These tools allow you to customize your recording settings, such as the frame rate and resolution, which can help optimize the recording without impacting the script's performance.
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image display and manipulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!