Raspberry Pi NoIR camera pictures by daylight

The Raspberry Pi is considered a great IoT device but it is was designed to let children find out how computers work.

And what is a better way to let them learn to develop programs if they can interact with electrical component for a fart detector, a grandpa scarer or a parent detector?

That last example uses the dedicated Raspberry Pi Camera (sold separately) but I like the Raspberry Pi concept so I bought one.

There are actually two camera’s. There is a regular one and a No Infra Red Filter one.

I bought the NoIR one so it could be used as a surveillance camera or just for fun, filming at night (My oldest son want to put the camera on a Nerf gun so he has a kill cam 😉 )

To get the camera running is not that difficult just follow this and that.

The pictures and movies are pretty good but the colours are terrible of course:

image image_without filter

Yes, I know, it’s for nigh vision.

And the camera can also record video for several seconds/minutes in H264 format. Although this an excellent quality for the price of this device, the format is not that handy. H264 has to be converted to another format before you can show it to your friends.

And this is possible on the Raspberry Pi itself.

So I changed the emaple code slightly to get MP4 instead of H264:

import picamera
from time import sleep
from subprocess import call

camera = picamera.PiCamera()

camera.start_recording('video2.h264')

sleep(10)

camera.stop_recording()

call(['MP4Box -add video2.h264 video2.mp4'], shell=True)

call(['rm video2.h264'], shell=True)

After the recording I convert the H264 into MP4 and delete the old video.

And now we have nice video from the Raspberry Pi in MP4 (which can be played within the browser of the Pi) with that very seventies polaroid effect.

An example is shown at :

 

 

 

 

 

 

Advertenties