Webcam Recording Trigger Issue in PsychoPy 2024.2.4

Hello everyone,

I’m setting up an experiment in PsychoPy where participants need to video-record themselves pronouncing words displayed on the screen. The idea is that participants press a button on the screen to start video recording and release it to stop recording.

Currently, I’ve added a Button Component along with a Mouse Click response to the routine. For the Webcam Component, I set the Start condition to $condition – mouse click. However, instead of starting the recording upon the button press, the webcam starts recording immediately when the instruction text is presented — not when the button is clicked.

Does anyone know how to configure the webcam to start recording only when the button (or any other response method) is pressed? It doesn’t necessarily have to be the button component — any solution that requires participants to trigger the recording manually would work.

Thanks in advance for your help!

Please could you explain what you mean by this?

I set the Start condition to $condition – mouse click .

1 Like

@wakecarter, thanks so much for getting back to me on this! What I meant is that in the camera properties, I set the start time to a condition mouse. I’ve attached a screenshot for reference.

As you can see, I also have key_resp in the routine, but even if I set the camera’s start condition to key_resp, camera recording still starts immediately when the routine begins—right when the text_5 component is presented.

I’d really appreciate any suggestions on how to ensure the camera only initiates upon a response, whether it’s a key press or a mouse click.

Thanks in advance for your help!

Sorry the screenshot was not very clear – please see this one attached

By itself, mouse isn’t a suitable condition. It’s a component that exists.

You might be able to use mouse_3.getPressed() or with a keyboard key_resp.keys.

N.B. Due to a bug, you may need to give the camera component a duration, rather than leaving it blank.

1 Like

@wakecarter @wakecarter – ah, I see! Thanks so much for the help—I’m going to give it a try.

Just to add, I also attempted to solve this using a piece of code (screenshot attached), but unfortunately, it doesn’t get me past the welcome text in the first routine. I can see that the camera gets activated as soon as the experiment starts because it lights up, but it doesn’t seem to wait for the intended trigger. So it does look like it’s a bug…

I would try with my suggestion, not that code.