Record screen video while running script
45 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Lea Bächlin
il 27 Gen 2023
Commentato: Lea Bächlin
il 1 Lug 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 Commenti
Risposta accettata
Aishwarya Shukla
il 3 Mar 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image display and manipulation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!