Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Webcam camera component does not work #6857

Open
j-ales opened this issue Sep 16, 2024 · 1 comment
Open

[Bug]: Webcam camera component does not work #6857

j-ales opened this issue Sep 16, 2024 · 1 comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Comments

@j-ales
Copy link
Contributor

j-ales commented Sep 16, 2024

PsychoPy Version

2024.2.1

What OS are your PsychoPy running on?

macOS Silicon

Bug Description

The webcam component does not work to save files on OSX when using the OpenCV or ffpyplayer backend.

Appears to be related to missing moviepy dependancy, there is also appears to be logger format string bug that comes after the missing dependancy error. See error message below.

The intermediate audio and video files are saved and left in the main directory.

Expected Behaviour

Saving movie files and putting them into the appropriate data location.

Steps to Reproduce

  1. Add camera component to trial
  2. run script
  3. view runner output

Additional context

Error message:

run(
File "/Users/ales/tmp/tesst_cam/test_cam_lastrun.py", line 641, in run
cam.save(camFilename, encoderLib='ffpyplayer')
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/hardware/camera/init.py", line 2337, in save
movietools.addAudioToMovie(
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/tools/movietools.py", line 1016, in addAudioToMovie
from moviepy.video.io.VideoFileClip import VideoFileClip
ModuleNotFoundError: No module named 'moviepy'
Exception ignored in atexit callback: <function flush at 0x1133201f0>
Traceback (most recent call last):
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/logging.py", line 321, in flush
logger.flush()
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/logging.py", line 306, in flush
formatted[thisEntry] = self.format.format(**thisEntry.dict)
ValueError: Unknown format code 'f' for object of type 'str'
Exception ignored in: <function _Logger.del at 0x113320550>
Traceback (most recent call last):
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/logging.py", line 254, in del
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/logging.py", line 306, in flush
ValueError: Unknown format code 'f' for object of type 'str'

@j-ales j-ales added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Sep 16, 2024
@mdcutone
Copy link
Member

Yes this seems to be due to the missing moviepy dependency mostly. We're looking into the other issues that come up after the first error.

For context, we use moviepy to composite the video and audio recordings to create the final output movie file. That is done when the recording complete, so that's why we're seeing the error after the recording is done here. I'm assuming the video and audio tracks are being properly obtained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.
Projects
None yet
Development

No branches or pull requests

2 participants