I installed OctoPrint on my Mac Mini (Catalina) using Setting up OctoPrint on MacOS and I am trying to get a C270 webcam working. I came across this and thought I would give it a go seeing as I have also had no luck with FFmpeg.
I ran the install but get the following when running 'python mjpegsw.py ', any idea/advice?
You have that error because you tried to launch the script with an older python version.
to have a newer python installed you need to install brew from here https://brew.sh/ ( already installed if you followed the guide for octoprint) .
then open a terminal and write:
pip install virtualenv
brew install python
After that you can go in the folder where you downloaded the script and create a virtualenv with:
Thanks, this world to ta point , however I get an "Abort trap: 6" with the camera plugged in.
Without the camera plugged in I get the following, indicating it is starting up ok, just can't find webcam, obviously. I am using the Logitech C270, which works when using the app from Logitech, so I know the Mac is recognising and drivers installed.
xxxxx-Mac-mini:mjpeg_stream_webcam-master xxxxx$ .env/bin/python mjpegsw.py
OpenCV: AVFoundation didn't find any attached Video Input Devices!
OpenCV: camera failed to properly initialize!
Mjpeg server started on http://localhost:5001
I neglected to mention I ssh'd onto the Mac Mini and running the command, this I guess has a problem (display) when trying to run the mjpegsw script. I run directly on the mini and it started successfully.
I managed to get this to work to the point where the webcam is now viewable in the browser (http://localhost:5001) . I just need to work out the correct stream URL entry for Octoprint.
installed everything as you've stated here. seems like the dependancies all compile and install as intended, however when attempting to run on MacMini with 10.10.5 I get an error that it can't import cv2. I tried to pip install cv2 and it says can't find, but the pip install -r requirements.txt says everything installed correctly there (guessing its an OpenCV issue?) suggestions? also. I am trying to use this with an old firewire iSight. OBS and everything works just fine with it. so hopefully this will too. I just can't figure out how to get a stream that octo likes. Hope you can help
will try and report back, I didnt see that in the initial process, so I might have missed it or was tutorial blind.
just tried: .env/bin/activate
result -bash: .env/bin/activate: Permission denied
tried sudo .env/bin/activate
result sudo: .env/bin/activate: command not found
I'm rebooting the computer as a whole right now. I'll let you know if anything changes.
this means that you don't have virtualenv configured for the project, like I wrote a couple of posts upper,
ps. the commands that I wrote earlier need to be executed in the folder you cloned from github.
downloaded the .zip version of the GitHub repo. expanded that, opened terminal and cd'd to that directory.
ran the following:
pip install virtualenv brew install python (though i have 2.7 for octoprint, you'd said this requires 3)
allowed that time to install/compile virtualenv -p python3.7 .env .env/bin/pip install -r requirements.txt
allowed that to process to completion, then from that same directory attempted to run: .env/bin/python mjpegsw.py
I only get the error listed, nothing else.
For the record i am on macOS Yosemite 10.10.5 on an Intel Mac Mini Late 2009. Octoprint runs perfectly and the iSight camera works with OBS and Facetime on the system (its an OG FireWire 400 Camera hooked up with a Firewire 800 to 400 adapter)
Running in terminal on the Mac itself. Octoprint is running at the same time. I've tried it both with OP running and not. I am not using SSH.
Edit: I did go and just for a laugh try launching Xcode. I have it installed but apparently never launched the program. it'd never been a problem before so I will let you know if that manages to change anything as Xcode is now installing extras.
I think you meant Yosemite, but yes, that seems to have done it! Octoprint can access the camera, and works with the OG iSight Firewire camera... I do notice it doesnt like to stay working 100% though, getting a segmentation fault : 11 if I quickly access the snap or cam over and over... might just be me fat-fingering though.
I have the problem listed previously by @liffg if I use virtualenv -p python .env. If I try virtualenv -p python3.7 .env, I get 'The path python3.7 does not exist'. I've tried different variations, including using the direct path (usr/local/bin/python3.7). None work.