I would like to use the web cam to generate multiple video files. It does fine as long as you access “cam” once each trial. Trouble is that my trials include several parts and I’d like a separate video cam file for each. For example:
Start…training trials loop with separate video files… test trials loop with separate video…end
I’ve tried dummy coding separate n=1 loops thinking that might close the file before the next but that did not do the trick.
did you have a look into the code exported by the builder (i.e., the .py-file) when using a camera component? Maybe you can identify which code snippets start and stop a camera and reuse them for your own purposes.
Hi Tyler,
We are trying to do the same thing and are using the Camera component that was suggested to you. What we notice is that each of the short videos is saved at the end of the Routine but we would rather they are saved before the loop repeats. Did you ever find a solution to this issue that might help us too?
Best wishes,
Donna
Hello Donna,
When we started, the version of Psychopy we were using allowed only one massive video file per loop! Fortunately, that changed with a new update. With the short trial-based videos, we were able to force file names that included our variable IDs from the loop structure. That solved our problem. Unfortunately, I don’t have my code or a PC nearby (it’s 6 hours away) to share that answer. Somebody on the listserv responded to my request for help with a code fragment that did the trick. If that would work for you, I suggest asking that question to the group.
Thanks for your quick reply, Tyler, and sorry for my delayed thank you Probably a silly question, but what listserv are you referring to? I’d like to give that a go.