{"id":366,"date":"2014-06-25T01:07:50","date_gmt":"2014-06-25T01:07:50","guid":{"rendered":"https:\/\/digitalchild.info\/?p=366"},"modified":"2014-06-25T01:07:50","modified_gmt":"2014-06-25T01:07:50","slug":"raspberry-pi-camera-module-samples","status":"publish","type":"post","link":"https:\/\/randomadult.local\/raspberry-pi-camera-module-samples\/","title":{"rendered":"Raspberry Pi Camera Module Samples"},"content":{"rendered":"
\"Raspberry<\/a>
Raspberry Pi Camera Mount<\/figcaption><\/figure>\n

After getting the wireless network card working<\/a> on my raspberry pi I got straight to work on testing out the camera module on the pi. I found a lot of websites talking about how the module works and how to hook it up. The commands you need to take photos and stills but a severe lack of real samples of what happens when you run those commands. So I thought I would write this post to show you what happens when you run the commands to get raspberry pi camera module samples.<\/p>\n

2I hooked the camera up and stuck it to the front of my television. The connection for this camera couldn’t be any easier. Once you have \u00a0the camera module installed you’ll need to enable it in with the raspberry pi config software.<\/p>\n

Run the following command to set up the camera module.<\/p>\n

\n\nsudo raspi-config\n\n<\/pre>\n

This will bring up the raspi-config curses system key down to camera to enable the camera, then reboot your pi.<\/p>\n

Once you’ve rebooted and are back into the user interface, Raspbian supplies a couple of commands to take still or video.\u00a0The command to take a still photo is raspistill and the video command is you guessed it, raspivid.<\/p>\n

The first thing I wanted to do was take a photo so I jumped into a terminal and ran the following command.<\/p>\n

\n\nraspivid -o\u00a0my_first_pi_image.jpeg\n\n<\/pre>\n

This popped up an output preview window in X that looked like the following. You can also see that my iPhone camera picked up the red from the CCD as it was taking the photo.<\/p>\n

\"Camera<\/a>
Camera Output<\/figcaption><\/figure>\n

This displayed on the screen for a couple of seconds then dropped back to the prompt and sure enough I had my first ever raspberry pi photo. This is the image below. I’ve uploaded the full image size that you can view here<\/a>\u00a0(2.7MB).<\/p>\n

 <\/p>\n

\"My<\/a>
My First Raspberry Pi Photo<\/figcaption><\/figure>\n

I’m\u00a0surprised at how clear the image was for such a cheap piece of kit. I’m very happy with the result\u00a0and it\u00a0has motivated me to focus on getting my own Time Lapse camera working ASAP!\u00a0\u00a0 Now that I had the still it was time to test the video capabilities of this little guy. I don’t think I will really be using the video capabilities as time-lapse uses stills but I wanted to see what I could get out of the unit anyway.<\/p>\n

To capture a video you can use the following command. This will capture a 10 second video and save it to a file.\u00a0This outputs a raw h264 stream without being in a video container which is\u00a0difficult to view unless you have something like VLC<\/a> installed.<\/p>\n

\n\nraspivid -o\u00a0my_first_pi_video.h264 -t 10000\n\n<\/pre>\n