pageauc / speed-camera

A Unix, Windows, Raspberry Pi Object Speed Camera using python, opencv, video streaming, motion tracking. Includes a Standalone Web Server Interface, Image Search using opencv template match and a whiptail Admin Menu Interface Includes picam and webcam Plugins for motion track security camera configuration including rclone sync script. watch-app allows remotely controller camera configuration from a remote storage service name. Uses sqlite3 and gnuplot for reporting. Recently added openalpr license plate reader support.
Apache License 2.0
967 stars 170 forks source link

How to use a USB camera instead of picamera #123

Closed johncblacker closed 10 months ago

johncblacker commented 1 year ago

I'd like to use a usb camera (logitech c270) instead of the picamera. How do I configure it? Do I need to specify a device number/index or anything?

pageauc commented 1 year ago

Edit config.py webcam_on = True If you do not have any other camera installed including camera module then set wecam_src = 0 This should be default. If you have a picamera it will take 0 so you must likely have to set to = 1

See comments in config.py. rtsp protocol network cameras are also xupported

On Sun, Dec 4, 2022, 4:43 PM John Blacker @.***> wrote:

I'd like to use a usb camera (logitech c270) instead of the picamera. How do I configure it? Do I need to specify a device number/index or anything?

— Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/123, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZGLZCO4XRWDDN4JQHLWLUNCBANCNFSM6AAAAAASTTZQTA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pageauc commented 1 year ago

Replied while not near my computer. Settings to change in config.py nano configl.py

WEBCAM = True

This should work if you only have a webcam plugged in and not other camera. Otherwise see previous email. You should not have to change the other WEBCAM settings to get started. Defaults should work OK. I have tried speed camera with logitech web cam and had no problems.

Let me know if you have any issues. Regards Claude ...

On Sun, Dec 4, 2022 at 7:43 PM Claude Pageau @.***> wrote:

Edit config.py webcam_on = True If you do not have any other camera installed including camera module then set wecam_src = 0 This should be default. If you have a picamera it will take 0 so you must likely have to set to = 1

See comments in config.py. rtsp protocol network cameras are also xupported

On Sun, Dec 4, 2022, 4:43 PM John Blacker @.***> wrote:

I'd like to use a usb camera (logitech c270) instead of the picamera. How do I configure it? Do I need to specify a device number/index or anything?

— Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/123, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZGLZCO4XRWDDN4JQHLWLUNCBANCNFSM6AAAAAASTTZQTA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc

johncblacker commented 1 year ago

OK, I'll give that a try. I did notice, though, that if I had the logitech camera plugged into a USB port and tried to boot my pi, it would not boot. But, also, since my sd card reader is toast, I am booting my pi via USB so perhaps that's the problem; although my keyboard and mouse don't seem to both the boot process...

johncblacker commented 1 year ago

Well, it looks like I can't get anything to work with bullseye. Enabled legacy camera support and couldn't access the camera. And, as I mentioned above, if you're booting from a USB drive you can't have a Logitech c270 plugged into a USB port at boot time because it won't boot. So, I'm going back to the "legacy buster system" that was "so kindly" made available by the Raspberry Pi folks. I'd be interested in knowing how you got the legacy cam to work with bullseye. when I do a vcgencmd get_camera with legacy support, I see: "supported=1 detected=1, libcamera interfaces=0" and when I try to start speed-cam.py it fails get find the camera and won't start. So, back to buster for me. They can stick buster wherever they want.

pageauc commented 1 year ago

You should not be seeing problems booting with USB camera plugged in. Sounds like you may have a defective SD card or boot image. You might want to try using Raspberry Pi Imager and create a new OS image. Maybe try another SD card. Whenever strange things happen it usually gets resolved by just creating a new image. Make sure your power supply is adequate. This can also cause issues if there is not enough power to support USB camera power demands.

On Mon, Dec 5, 2022 at 8:27 AM John Blacker @.***> wrote:

OK, I'll give that a try. I did notice, though, that if I had the logitech camera plugged into a USB port and tried to boot my pi, it would not boot. But, also, since my sd card reader is toast, I am booting my pi via USB so perhaps that's the problem; although my keyboard and mouse don't seem to both the boot process...

— Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/123#issuecomment-1337461714, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZCU4TRB5JXFDZGOUKDWLX3UJANCNFSM6AAAAAASTTZQTA . You are receiving this because you commented.Message ID: @.***>

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc

pageauc commented 1 year ago

Just enabled legacy pi camera using sudo raspi-config, Interfaces and enabled legacy. Did not have any problems booting or running pi-camera under Bulleyes. I currently have several RPI's running Bullseye in legacy. Make sure to reboot when raspi-config prompts you or manually reboot to enable legacy mode. Also see my comment about possible corrupt SD card or inadequate power supply to power USB camera and RPI

On Mon, Dec 5, 2022 at 2:45 PM John Blacker @.***> wrote:

Well, it looks like I can't get anything to work with bullseye. Enabled legacy camera support and couldn't access the camera. And, as I mentioned above, if you're booting from a USB drive you can't have a Logitech c270 plugged into a USB port at boot time because it won't boot. So, I'm going back to the "legacy buster system" that was "so kindly" made available by the Raspberry Pi folks. I'd be interested in knowing how you got the legacy cam to work with bullseye. when I do a vcgencmd get_camera with legacy support, I see: "supported=1 detected=1, libcamera interfaces=0" and when I try to start speed-cam.py it fails get find the camera and won't start. So, back to buster for me. They can stick buster wherever they want.

— Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/123#issuecomment-1338140378, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZCWACXJNJASCBHUTWDWLZH5TANCNFSM6AAAAAASTTZQTA . You are receiving this because you commented.Message ID: @.***>

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc