Kirk Fraser
Posts: 50
Joined: Thu Feb 13, 2014 6:52 am

Software for Camera & Tutorial?

Tue Mar 29, 2016 1:27 am

I have several kinds of camera, a Pi Cam (IR version), USB webcam, HD cam on network plug, and an NTSC camera with no connector for the Pi. I would like to start programming in Squeak 5 which underlies Scratch but I haven't found software, either the driver or the Smalltalk source to access any camera yet. Suggestions?

If I can't get access via Squeak, what is the fastest, easiest language to get access to the most camera types with a tutorial? Thank you.

User avatar
jbeale
Posts: 3675
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Software for Camera & Tutorial?

Tue Mar 29, 2016 11:56 pm

I don't know anything about Squeak. I am not sure if there's any video support, at least for the RPi.
Python may be the easiest language *that is well supported for video* on the Pi, using the picamera library:
https://picamera.readthedocs.org/en/release-1.10/
Note this library is specific to the dedicated Raspberry Pi camera, not a generic USB camera.

Many people use OpenCV for video on the Pi, I think it works with USB cameras and the Pi Camera with the v4l2 driver. You can use OpenCV through Python and other languages as well. For examples: https://www.raspberrypi.org/blog/tag/opencv/

I have not heard of anyone getting baseband analog video input (eg. NTSC) working on the Pi with any language.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Software for Camera & Tutorial?

Wed Mar 30, 2016 9:28 am

I would look into V4L2 , which is the main C API for
webcam and video input on Linux.
There are some Python libraries wrapping it in varying state of
disrepair (and some for Squeak , as my cursory googling shows).

Note that for analog video you will neccessarily need a
digitizer/capture card (which usually works with V4L2 , if it
does at all).

IP camera streams are different kettle of fish altogether.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8924
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Software for Camera & Tutorial?

Wed Mar 30, 2016 9:50 am

V4L2 is the standard, but also not the easiest to handle.

Scratch has support for V4L2 cameras (written in C), but I'm not so I'm not sure whether that works under Squeak too.
https://github.com/LLK/Scratch_1.4/tree ... ins/camera appears to be the official Scratch source repo for the camera side. It looks like it hasn't been updated for a while as I know that there's a bug in there that has been fixed relating to V4L2. Then again, based on http://bugs.squeak.org/view.php?id=7818 reported in April 2014, they don't seem to be that responsive over fixes anyway.

You've already been pointed at PiCamera for Python which is fairly easy to use.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
jbeale
Posts: 3675
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Software for Camera & Tutorial?

Wed Mar 30, 2016 7:52 pm

ghans wrote:Note that for analog video you will neccessarily need a digitizer/capture card (which usually works with V4L2 , if it does at all).
It seems there are reports of analog video input success:
http://elinux.org/RPi_VerifiedPeriphera ... e_grabbers
http://raspberry-at-home.com/video-grab ... pberry-pi/

Return to “Camera board”