Shooting video and taking photos
Unfortunately at the time of this writing, a GUI app has not been written, so to take actual photos and videos with the Raspberry Pi Camera Module, we must once again enter the terminal to get things working. We are going to start by making sure everything is working correctly. With your camera module connected, type the following command into the terminal.
That should load a demo which you will be able to watch in the terminal window. If nothing happens and you get an error, enter raspi-config as instructed earlier and make sure the camera is enabled. Also check all of the connections. If it does work congratulations and we can move on.
Let's write a short script that will allow us to shoot a 1080p video at 30 frames per second. I have written him following string to help you get started. It should be pretty self explanatory, but I will break it down for you anyway.
raspivid -w 1920 -h 1080 -fps 30 -t 30000 -o video.h264
raspivid - this is what initialized the camera and sets it to video mode.
-w 1920 - h 1080 - this sets the video recording resolution.
-fps 30 - this sets the frames per second to 30.
-t 30000 - this sets the length of the recording time.
-o video.h264 - this is the file output name. For demo purposes we chose to save it to our home directory of /home/pi to save to a different location, you will need to specify the location yourself.
Now if all went well, and you installed everything correctly, you should now be able to run the above command and the end result will be a 30 second full HD video. Below is a longer video I shot of my 3D printer making a TweakTown keychain. I used the same code above and just modified the time code above to last for eight minutes.
That's it, it really is that easy. There are many more attributes and settings you can change or enable by using the commands found on the previous page. Now let's capture a still image using the code below.
raspistill -o picture,jpg
Again this is pretty self-explanatory, but let's break it down component by component.
raspistill - this initializes the camera into still image mode.
-o picture.jpg - this stores the file in the home directory with a title of picture.jpg.
Using the code above, I took a quick snapshot of my favorite development boards. As with the raspivid command, raspistill has a plethora of modifiers, and options to further enhance your imaging experience.
Taking some time lapsed images (in this case the images are 1 second apart)
raspicam -tl 1000 -o file%d.jpg
Note the filename - the %d will be replaced with an integer (creating file1.jpg, file2.jpg etc). This software will continue taking images until you press 'CTRL-C' to terminate the program.
Using the image effects when taking photographs or capturing video. This command will take a picture in 'negative'.
raspicam -ifx negative -o negative_image.jpg
Just to recap - for a full list of image effects when taking photographs type:
For a full list of image effects when recording video type:
PRICING: You can find products similar to this one for sale below.
United States: Find other tech and computer products like this over at Amazon's website.
United Kingdom: Find other tech and computer products like this over at Amazon UK's website.
Canada: Find other tech and computer products like this over at Amazon Canada's website.
- Page 1 [Introduction and Features and Specifications]
- Page 2 [Getting things up and running]
- Page 3 [Working with the camera]
- We at TweakTown openly invite the companies who provide us with review samples / who are mentioned or discussed to express their opinion of our content. If any company representative wishes to respond, we will publish the response here.
Latest News Posts
- Microsoft HoloLens dev kits will be $3,000, ships in Q1 2016
- 'Tobiwan', Soe and 'Maelk' to headline MLG $500,000 2015 World Finals
- Thecus adds 8TB Seagate HDD support to their NAS range
- Sony expected to drop the PS4 price down to $350 for the holidays
- New Star Wars Battlefront footage arrives with Luke vs Darth Vader
- SSI EEB support for Lian Li high end chassis
- Need help with a build
- Force M7 Thor Mouse does not wake system?
- Topic: X99E-ITX/ac with 32GB ram
- Buffalo TeraStation 5200 Windows Storage Server Review
- The Crew WILD RUN PC CLOSED BETA WILL BE PLAYABLE FROM OCTOBER 15TH TO OCTOBER 19TH 2015
- MLG Announces Broadcast Talent for World Finals in New Orleans
- Patriot Announces New Viper 4 3600MHz Dual-Channel Memory Kit
- Supermicro Launches New 1U TwinPro Fully Redundant, Dual DP Node, SuperServer
- AMD Partners with Oculus and Dell to Power Oculus Ready PCs