Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Difference between revisions of "Rpi Camera Module"

From eLinux.org
Jump to: navigation, search
(Adjusting Lens Focus)
(Introduction: Added image of camera board)
(19 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
==Introduction==
 
==Introduction==
 +
[[File:RPiCam.jpg|thumbnail|right|Raspberry Pi Camera Module]]
 +
The Raspberry Pi Camera board was released for sale on 14th May 2013.<ref>http://www.raspberrypi.org/archives/3890</ref>
 +
The initial production of 10k units<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=350#p358580</ref> sold out quickly.
  
The Raspberry Pi Camera board was released for sale on 14th May 2013.<ref>http://www.raspberrypi.org/archives/3890</ref> The initial production of 10k units<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=350#p358580</ref> sold out quickly. The camera contains a 5 MPixel sensor and connects via a ribbon cable to the CSI connector on the board. Subjective video and still image quality is good; it is better than a USB webcam of similar price.
+
The camera contains a 5 MPixel sensor and connects via a ribbon cable to the CSI connector on the board.  
 +
 
 +
Subjective video and still image quality is good; it is better than a USB webcam of similar price.
  
 
==Technical Parameters==
 
==Technical Parameters==
 +
* Sensor type: OmniVision OV5647 Color CMOS QSXGA (5-megapixel)
 
* Sensor size: 3.67 x 2.74 mm
 
* Sensor size: 3.67 x 2.74 mm
 
* Pixel Count: 2592 x 1944
 
* Pixel Count: 2592 x 1944
Line 16: Line 22:
 
* Full-frame SLR lens equivalent: 35 mm
 
* Full-frame SLR lens equivalent: 35 mm
 
* Fixed Focus: 1 m to infinity
 
* Fixed Focus: 1 m to infinity
 +
* Video: 1080p at 30 fps with codec H.264 (AVC)
  
 
Because the focal length of the lens is roughly the same as the width of the sensor, it is easy to remember the field of view: at ''x'' meters away, you can see about ''x'' meters horizontally, assuming 4x3 stills mode. Horizontal field of view in 1080p video mode is 75% of that (75% H x 55% V sensor crop for 1:1 pixels at 1920x1080).
 
Because the focal length of the lens is roughly the same as the width of the sensor, it is easy to remember the field of view: at ''x'' meters away, you can see about ''x'' meters horizontally, assuming 4x3 stills mode. Horizontal field of view in 1080p video mode is 75% of that (75% H x 55% V sensor crop for 1:1 pixels at 1920x1080).
Line 28: Line 35:
  
 
The command line parameters for the programs are as follows:
 
The command line parameters for the programs are as follows:
 +
===RaspiVid===
 
<pre>
 
<pre>
 
RaspiVid Camera App   
 
RaspiVid Camera App   
Line 89: Line 97:
 
average,spot,backlit,matrix  
 
average,spot,backlit,matrix  
 
</pre>
 
</pre>
 
+
===RaspiStill===
 
<pre> 
 
<pre> 
 
RaspiStill Camera App  
 
RaspiStill Camera App  
Line 105: Line 113:
 
‐q,  ‐‐ quality   :  Set jpeg  quality  <0 to  100> 
 
‐q,  ‐‐ quality   :  Set jpeg  quality  <0 to  100> 
 
‐r,  ‐‐ raw       :  Add  raw  bayer data  to  jpeg  metadata 
 
‐r,  ‐‐ raw       :  Add  raw  bayer data  to  jpeg  metadata 
‐o,  ‐‐ output    :  Output  filename  <filename>  (to write to  stdout,  use '‐o  ‐ ').  If  not specified,  no file is  saved 
+
‐o,  ‐‐ output    :  Output filename  <filename>  (to write to  stdout,  use '‐o  ‐ ').  If  not specified,  no file is  saved 
‐v,  ‐‐ verbose   :  Output   verbose information  during  run  
+
‐v,  ‐‐ verbose   :  Output verbose information during run  
‐t,  ‐‐ timeout   :  Time (in ms) before  takes picture  and  shuts down (if  not specified,  set to  5s
+
‐t,  ‐‐ timeout   :  Time (in ms) before taking picture and shutting down (if not specified, set to 5 seconds
 
‐th, ‐‐ thumb     :  Set thumbnail parameters  (x:y:quality)  
 
‐th, ‐‐ thumb     :  Set thumbnail parameters  (x:y:quality)  
‐d,  ‐‐ demo      :  Run  a  demo mode (cycle  through range of  camera options, no capture)  
+
‐d,  ‐‐ demo      :  Run a demo mode (cycle  through range of  camera options, no capture)  
‐e,  ‐‐ encoding  :  Encoding  to  use for output  file (jpg,  bmp, gif, png)  
+
‐e,  ‐‐ encoding  :  Encoding to use for output  file (jpg,  bmp, gif, png)  
‐x,  ‐‐ exif      :  EXIF  tag to   apply to  captures  (forma t as  'key=value')  
+
‐x,  ‐‐ exif      :  EXIF tag to apply to  captures  (forma t as  'key=value')  
 
‐tl,  ‐‐ timelapse:   Timelapse mode. Takes a  picture  every <t>ms  
 
‐tl,  ‐‐ timelapse:   Timelapse mode. Takes a  picture  every <t>ms  
 
 
 
 
Line 118: Line 126:
 
‐p,  ‐‐ preview   :  Preview window settings <'x,y,w,h'> 
 
‐p,  ‐‐ preview   :  Preview window settings <'x,y,w,h'> 
 
‐f,  ‐‐ fullscreen:  Fullscreen preview mode 
 
‐f,  ‐‐ fullscreen:  Fullscreen preview mode 
‐n,  ‐‐ nopreview :  Do not  display  a  preview window 
+
‐n,  ‐‐ nopreview :  Do not display a preview window 
 
 
 
 
 
Image  parameter commands  
 
Image  parameter commands  
 
 
 
 
‐sh, ‐‐ sharpness :  Set image  sharpness ( ‐100  to  100)  
+
‐sh, ‐‐ sharpness :  Set image sharpness ( ‐100  to  100)  
‐co, ‐‐ contrast  :  Set imag e  contrast ( ‐100  to  100)  
+
‐co, ‐‐ contrast  :  Set image contrast ( ‐100  to  100)  
‐br, ‐‐ brightness:  Set image  brightness (0  to   100)  
+
‐br, ‐‐ brightness:  Set image brightness (0  to   100)  
‐sa, ‐‐ saturation:  Set image  saturation ( ‐100  to  100)  
+
‐sa, ‐‐ saturation:  Set image saturation ( ‐100  to  100)  
 
‐ISO,  ‐‐ ISO     :  Set capture ISO  
 
‐ISO,  ‐‐ ISO     :  Set capture ISO  
‐vs, ‐‐ vstab     :  Turn  on  video stablisation  
+
‐vs, ‐‐ vstab     :  Turn on video stablisation  
 
‐ev, ‐‐ ev        :  Set EV compensation (-10 to 10) - range corresponds to  -3 stops to +3 stops
 
‐ev, ‐‐ ev        :  Set EV compensation (-10 to 10) - range corresponds to  -3 stops to +3 stops
 
‐ex, ‐‐ exposure  :  Set exposure  mode (see  Notes)  
 
‐ex, ‐‐ exposure  :  Set exposure  mode (see  Notes)  
 
‐awb,  ‐‐ awb     :  Set AWB mode (see  Notes)  
 
‐awb,  ‐‐ awb     :  Set AWB mode (see  Notes)  
‐ifx, ‐‐ imxfx    :  Set image  effect (see  Notes)  
+
‐ifx, ‐‐ imxfx    :  Set image effect (see  Notes)  
‐cfx, ‐‐ colfx    :  Set colour  effect (U:V) 
+
‐cfx, ‐‐ colfx    :  Set colour effect (U:V) 
 
‐mm,  ‐‐ metering :  Set metering mode (see  Notes)  
 
‐mm,  ‐‐ metering :  Set metering mode (see  Notes)  
‐rot,  ‐‐ rotation:  Set image  rotation (0 ‐359)  
+
‐rot,  ‐‐ rotation:  Set image rotation (0 ‐359)  
 
‐hf, ‐‐ hflip     :  Set horizontal flip 
 
‐hf, ‐‐ hflip     :  Set horizontal flip 
‐vf, ‐‐ vflip     :  Set vertical  flip 
+
‐vf, ‐‐ vflip     :  Set vertical flip 
 
 
 
 
 
 
 
 
Line 161: Line 169:
 
MP4Box -add filename.h264 filename.mp4
 
MP4Box -add filename.h264 filename.mp4
 
</pre>
 
</pre>
 +
 +
===RAW images===
 +
The '''raspistill --raw''' option will append RAW data to the JPEG. The RAW data contains the image direct from the sensor, before debayer and color processing. A simple tool called '''raspi_dng'''<ref>https://github.com/illes/raspiraw</ref> is being developed<ref>http://bealecorner.org/best/RPi/</ref> to convert the JPEG+RAW file into a standard Adobe DNG file.
 +
 +
===Configuration===
 +
 +
The cameras red LED lights up when recording video or taking a still picture, this can be turned off by adding the following line to config.txt ([[RPiconfig]])
 +
 +
  disable_camera_led=1
 +
 +
It's possible to turn it back on at runtime by using GPIO5 <ref>http://www.raspberrypi-spy.co.uk/2013/05/how-to-disable-the-red-led-on-the-pi-camera-module/</ref>
  
 
==Known Issues==
 
==Known Issues==
Line 174: Line 193:
 
==Troubleshooting==
 
==Troubleshooting==
 
===Camera not working at all===  
 
===Camera not working at all===  
 +
Example error message: "mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)"
 +
 
Make sure the flex cable is inserted the correct way on both ends, and each connector has the locking tab engaged. The RPi + camera draws about 260 mA more current when recording video, than without the camera. The Model B is about 550 mA by itself, so camera use pushes it over 800 mA. Some power supplies, cables, and polyfuses may not maintain 5V onboard at this current load well enough for reliable operation. You can check this with a voltmeter across TP1 and TP2.<ref>http://elinux.org/R-Pi_Troubleshooting#Troubleshooting_power_problems</ref><ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43998#p350528</ref>
 
Make sure the flex cable is inserted the correct way on both ends, and each connector has the locking tab engaged. The RPi + camera draws about 260 mA more current when recording video, than without the camera. The Model B is about 550 mA by itself, so camera use pushes it over 800 mA. Some power supplies, cables, and polyfuses may not maintain 5V onboard at this current load well enough for reliable operation. You can check this with a voltmeter across TP1 and TP2.<ref>http://elinux.org/R-Pi_Troubleshooting#Troubleshooting_power_problems</ref><ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43998#p350528</ref>
  
In some cases, the micro-connector from the camera module to the camera board PCB has been loose, causing mis-operation. This has been fixed by removing and re-seating the small (tiny!) yellow flex cable connector labelled "P5V04A SUNNY" on the camera board.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=39996&start=100#p355172</ref>
+
In some cases, the micro-connector from the camera module to the camera board PCB has been loose. This can be fixed by removing and re-seating the small (tiny!) yellow flex cable connector labelled "P5V04A SUNNY" on the camera board. It makes a click when it is fully seated.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=39996&start=150#p373336</ref>
  
 
===Colored Banding or Flickering on video===  
 
===Colored Banding or Flickering on video===  
Line 185: Line 206:
 
The ribbon cable that connects the camera board to the Pi is 15-core 1mm pitch ribbon cable.  In the UK they can be sourced from http://www.toby.co.uk/content/catalogue/products.aspx?series=FFCx-xx-A-xx-xx where the required type is FFC1-15-B150105160MM<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p352401</ref>.  Other suppliers have been noted on eBay.
 
The ribbon cable that connects the camera board to the Pi is 15-core 1mm pitch ribbon cable.  In the UK they can be sourced from http://www.toby.co.uk/content/catalogue/products.aspx?series=FFCx-xx-A-xx-xx where the required type is FFC1-15-B150105160MM<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p352401</ref>.  Other suppliers have been noted on eBay.
  
The Foundation has noted that the camera only passed EMI emissions testing with ribbon cable lengths of 15cm, although longer cables may also work.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p348917</ref>
+
The Foundation has noted that the camera only passed EMI emissions testing with ribbon cable lengths of 15cm, although longer cables may also work.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p348917</ref>  One user 'rew' reports a 4 m (13 foot) extension cable is working.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p362714</ref><ref>http://www.bitwizard.nl/catalog/product_info.php?products_id=146</ref>
  
 
===Adjusting Lens Focus===
 
===Adjusting Lens Focus===
 
The camera is fixed-focus (at infinity) as delivered. The thread-locking glue dots can be scraped off<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=225#p346170</ref> allowing manual lens focus, as close as 6 cm, or complete removal of the lens<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=325#p352613</ref> allowing other optical systems. The lens thread size may be M6 x 0.35<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=46637&p=367053#p367053</ref>.
 
The camera is fixed-focus (at infinity) as delivered. The thread-locking glue dots can be scraped off<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=225#p346170</ref> allowing manual lens focus, as close as 6 cm, or complete removal of the lens<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=325#p352613</ref> allowing other optical systems. The lens thread size may be M6 x 0.35<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=46637&p=367053#p367053</ref>.
  
===Macro, Wide, Tele lenses===
+
===Macro, Wide, Tele adaptor lenses===
 
The near focus point of the camera is about 1 meter as delivered. Without modification to the camera itself, it is possible to put a simple external lens in front such as reading glasses, SLR diopter ("close-up filter") or loupe to enable closer focus. For best results, put the additional lens very close to the camera lens.  
 
The near focus point of the camera is about 1 meter as delivered. Without modification to the camera itself, it is possible to put a simple external lens in front such as reading glasses, SLR diopter ("close-up filter") or loupe to enable closer focus. For best results, put the additional lens very close to the camera lens.  
  
 
Macro, Wide-Angle, and Telephoto adapter lenses designed for the iPhone 4/4s and similar devices will also work on the R-Pi camera. Depending on your configuration, properly mounting the accessory lens in front of the camera module may require some ingenuity.  Focus becomes critical with a telephoto adapter, so success there may also require the manual focus modification.
 
Macro, Wide-Angle, and Telephoto adapter lenses designed for the iPhone 4/4s and similar devices will also work on the R-Pi camera. Depending on your configuration, properly mounting the accessory lens in front of the camera module may require some ingenuity.  Focus becomes critical with a telephoto adapter, so success there may also require the manual focus modification.
 +
 +
===Replacing Stock Lens===
 +
Changing the lens is a more significant and risky modification than simply adding an accessory lens.
 +
Richard Kinch has made an adaptor to mount M12 thread lenses on the R-Pi camera board, after unscrewing and removing the stock lens.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?t=45887</ref><ref>http://www.truetex.com/raspberry_pi_m12_lens_adapter.pdf</ref> Martin Miller has posted a guide on raspberrytorte.com describing complete camera module disassembly and replacing lens holder with a stock M12 unit.<ref>http://wiki.raspberrytorte.com/index.php?title=Camera_Module_Lens_Modifcation</ref> Various M12 x 0.5 (S-mount) lenses intended for board-level cameras are available at focal lengths from fisheye to long telephoto.<ref>http://www.solino.com/cms/index.php?article_id=193&clang=0</ref><ref>http://www.m12lenses.com/M12-Mount-Mega-Pixel-Lenses-s/21.htm</ref><ref>http://www.net-gmbh.com/en/s-mount.html</ref>
  
 
===Removing IR Filter===
 
===Removing IR Filter===
Line 201: Line 226:
  
 
===Housings===
 
===Housings===
To help building your own enclosure, a hand-measured mechanical drawing<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44466</ref> of the camera module is available, thanks to Gert van Loo. There is another drawing<ref>http://www.raspberrypi-spy.co.uk/2013/05/pi-camera-module-mechanical-dimensions/</ref> from raspberrypi-spy.
+
To help building your own camera board case or enclosure, a hand-measured mechanical drawing<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44466</ref> of the camera module is available, thanks to Gert van Loo. There is another drawing<ref>http://www.raspberrypi-spy.co.uk/2013/05/pi-camera-module-mechanical-dimensions/</ref> from raspberrypi-spy.
 
There are some CAD files for housings and camera holders available on Thingiverse<ref>http://www.thingiverse.com/search?q=raspberry+pi+camera&sa=</ref>.
 
There are some CAD files for housings and camera holders available on Thingiverse<ref>http://www.thingiverse.com/search?q=raspberry+pi+camera&sa=</ref>.
  
 
==References==
 
==References==
 
<references/>
 
<references/>

Revision as of 10:35, 24 June 2013


Back to the Hub.


Hardware & Peripherals:

Hardware and Hardware History.

Low-level Peripherals and Expansion Boards.

Screens, Cases and Other Peripherals.


Introduction

Raspberry Pi Camera Module

The Raspberry Pi Camera board was released for sale on 14th May 2013.[1] The initial production of 10k units[2] sold out quickly.

The camera contains a 5 MPixel sensor and connects via a ribbon cable to the CSI connector on the board.

Subjective video and still image quality is good; it is better than a USB webcam of similar price.

Technical Parameters

  • Sensor type: OmniVision OV5647 Color CMOS QSXGA (5-megapixel)
  • Sensor size: 3.67 x 2.74 mm
  • Pixel Count: 2592 x 1944
  • Pixel Size: 1.4 x 1.4 um
  • Lens: f=3.6 mm, f/2.9
  • Angle of View: 54 x 41 degrees
  • Field of View: 2.0 x 1.33 m at 2 m
  • Full-frame SLR lens equivalent: 35 mm
  • Fixed Focus: 1 m to infinity
  • Video: 1080p at 30 fps with codec H.264 (AVC)

Because the focal length of the lens is roughly the same as the width of the sensor, it is easy to remember the field of view: at x meters away, you can see about x meters horizontally, assuming 4x3 stills mode. Horizontal field of view in 1080p video mode is 75% of that (75% H x 55% V sensor crop for 1:1 pixels at 1920x1080).

References: Focal length and f-stop measurements [1],[2] depth of field & angle of view calculators[3] sensor info[4] f-stop measurement[5]

Sample Programs

Sample programs using the camera for taking stills and video have been developed for the Foundation and the source for these is available on github.

Forum user M1M1 published instructions on compiling the sample programs here

The command line parameters for the programs are as follows:

RaspiVid

RaspiVid Camera App   
===================  
  
Display camera output to display, and optionally saves an H264 capture at requested bitrate   
  
  
usage:  RaspiVid [options]   
  
Image  parameter commands   
  
‐?,  ‐‐ help      :  This  help  information   
‐w,  ‐‐ width     :  Set image  width <size>.  Default  1920  
‐h,  ‐‐ height    :  Set image  height  <size>.  Default  1080  
‐b,  ‐‐ bitrate   :  Set bitrate. Use bits per second  (e.g.   10MBits/ s would be ‐ b 10000000)  
‐o,  ‐‐ output    :  Output  filename  <filename>  (to write to  stdout,  use '‐o  ‐ ')   
‐v,  ‐‐ verbose   :  Output   verbose information  during  run   
‐t,  ‐‐ timeout   :  Time (in ms) before  takes picture  and  shuts down.   If  not specified,  set to  5s   
‐d,  ‐‐ demo      :  Run  a  demo mode (cycl e  through range of  camera options, no capture)   
‐fps,  ‐‐ framerate        :  Specify  the  frames  per second  to  record   
‐e,  ‐‐ penc      :  Display  preview image  *after*  encoding  (shows  compression artifacts)   
  
Preview parameter commands   
  
‐p,  ‐‐ preview   :  Preview window settings <'x,y,w,h'>  
‐f,  ‐‐ fullscreen:  Fullscreen preview mode  
‐n,  ‐‐ nopreview :  Do not  display  a  preview window  
  
Image  parameter commands   
  
‐sh, ‐‐ sharpness :  Set image  sharpness ( ‐100  to  100)   
‐co, ‐‐ contrast  :  Set image  contrast ( ‐100  to  100)   
‐br, ‐‐ brightness:  Set image  brightness (0  to   100)   
‐sa, ‐‐ saturation:  Set image  saturation ( ‐100  to  100)   
‐ISO,  ‐‐ ISO     :  Set capture ISO   
‐vs, ‐‐ vstab     :  Turn  on  video stablisation   
‐ev, ‐‐ ev        :  Set EV compensation (-10 to 10) - range corresponds to  -3 stops to +3 stops  
‐ex, ‐‐ exposure  :  Set exposure  mode (see  Notes)   
‐awb,  ‐‐ awb     :  Set AWB mode (see  Notes)   
‐ifx, ‐‐ imxfx    :  Set image  effect (see  Notes)   
‐cfx, ‐‐ colfx    :  Set colour  effect (U:V)  
‐mm,  ‐‐ metering :  Set metering  mode (see  Notes)   
‐rot,  ‐‐ rotation:  Set image  rotation (0 ‐359)   
‐hf, ‐‐ hflip     :  Set horizontal flip  
‐vf, ‐‐ vflip     :  Set vertical  flip  
  
  
Notes  
  
Exposure  mode options  :   
off,auto,night,nightpreview,backlight,spotlight,sports,snow,beach,verylong,fixedfps,antishake,fireworks   
  
AWB mode options :   
off,auto,sun,cloud,shade,tungsten,fluorescent,incandescent,flash,horizon   
  
Image  Effect mode options :   
none,negative,solarise,sketch,denoise,emboss,oilpaint,h atch,gpen,pastel,watercolour,film,blur,saturation,colourswap,washedout,posterise,colourpoint,colourbalance,cartoon  
  
Metering Mode options  :   
average,spot,backlit,matrix 

RaspiStill

 
RaspiStill Camera App  
===================== 
 
Runs camera for specific time, and take JPG capture at end if requested 
 
usage:  RaspiStill  [options]  
 
Image  parameter commands  
 
‐?,  ‐‐ help      :  This  help  information  
‐w,  ‐‐ width     :  Set image  width <size>  
‐h,  ‐‐ height    :  Set image  height  <size>  
‐q,  ‐‐ quality   :  Set jpeg  quality  <0 to  100> 
‐r,  ‐‐ raw       :  Add  raw  bayer data  to  jpeg  metadata 
‐o,  ‐‐ output    :  Output filename  <filename>  (to write to  stdout,  use '‐o  ‐ ').  If  not specified,  no file is  saved 
‐v,  ‐‐ verbose   :  Output verbose information during run  
‐t,  ‐‐ timeout   :  Time (in ms) before taking picture and shutting down (if not specified, set to 5 seconds) 
‐th, ‐‐ thumb     :  Set thumbnail parameters  (x:y:quality)  
‐d,  ‐‐ demo      :  Run a demo mode (cycle  through range of  camera options, no capture)  
‐e,  ‐‐ encoding  :  Encoding to use for output  file (jpg,  bmp, gif, png)  
‐x,  ‐‐ exif      :  EXIF tag to apply to  captures  (forma t as  'key=value')  
‐tl,  ‐‐ timelapse:   Timelapse mode. Takes a  picture  every <t>ms  
 
Preview parameter commands  
 
‐p,  ‐‐ preview   :  Preview window settings <'x,y,w,h'> 
‐f,  ‐‐ fullscreen:  Fullscreen preview mode 
‐n,  ‐‐ nopreview :  Do not display a preview window 
 
Image  parameter commands  
 
‐sh, ‐‐ sharpness :  Set image sharpness ( ‐100  to  100)  
‐co, ‐‐ contrast  :  Set image contrast ( ‐100  to  100)  
‐br, ‐‐ brightness:  Set image brightness (0  to   100)  
‐sa, ‐‐ saturation:  Set image saturation ( ‐100  to  100)  
‐ISO,  ‐‐ ISO     :  Set capture ISO  
‐vs, ‐‐ vstab     :  Turn on video stablisation  
‐ev, ‐‐ ev        :  Set EV compensation (-10 to 10) - range corresponds to  -3 stops to +3 stops
‐ex, ‐‐ exposure  :  Set exposure  mode (see  Notes)  
‐awb,  ‐‐ awb     :  Set AWB mode (see  Notes)  
‐ifx, ‐‐ imxfx    :  Set image effect (see  Notes)  
‐cfx, ‐‐ colfx    :  Set colour effect (U:V) 
‐mm,  ‐‐ metering :  Set metering mode (see  Notes)  
‐rot,  ‐‐ rotation:  Set image rotation (0 ‐359)  
‐hf, ‐‐ hflip     :  Set horizontal flip 
‐vf, ‐‐ vflip     :  Set vertical flip 
 
 
Notes 
 
Exposure  mode options  :  
off,auto,night,nightpreview,backlight,spotlight,sports,snow,beach,verylong,fixedfps,antishake,fireworks  
 
AWB mode options :  
off,auto,sun,cloud,shade,tungsten,fluorescent,incandescent,flash,horizon  
 
Image  Effect mode options :  
none,negative,solarise,sketch,denoise,emboss,oilpaint,h atch,gpen,pastel,watercolour,film,blur,saturation,colourswap,washedout,posterise,colourpoint,colourbalance,cartoon 
 
Metering Mode options  :  
average,spot,backlit,matrix 

The raspivid utility saves .h264 format files. Some programs need this in a .mp4 wrapper to use, which you can do in several ways. One is to use "MP4Box" which is in the 'gpac' package.

sudo apt-get update
sudo apt-get install gpac

MP4Box -add filename.h264 filename.mp4

RAW images

The raspistill --raw option will append RAW data to the JPEG. The RAW data contains the image direct from the sensor, before debayer and color processing. A simple tool called raspi_dng[3] is being developed[4] to convert the JPEG+RAW file into a standard Adobe DNG file.

Configuration

The cameras red LED lights up when recording video or taking a still picture, this can be turned off by adding the following line to config.txt (RPiconfig)

 disable_camera_led=1

It's possible to turn it back on at runtime by using GPIO5 [5]

Known Issues

  • Still captures did not use the full sensor, until the firmware update on 24 May 2013.
  • Images were 'flipped' (mirror image) by default, until the firmware update on 24 May 2013. (-hf and -vf options provide horizontal and vertical flips)
  • The -? (--help) did not work, until update on 24 May 2013.
  • The -n (--nopreview) command-line options originally did not work until a recent firmware update.
  • Correct EXIF data (including user supplied tags) are not being written to the output files.

This forum post summarizes the issues as at 24th May 2013

Troubleshooting

Camera not working at all

Example error message: "mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)"

Make sure the flex cable is inserted the correct way on both ends, and each connector has the locking tab engaged. The RPi + camera draws about 260 mA more current when recording video, than without the camera. The Model B is about 550 mA by itself, so camera use pushes it over 800 mA. Some power supplies, cables, and polyfuses may not maintain 5V onboard at this current load well enough for reliable operation. You can check this with a voltmeter across TP1 and TP2.[6][7]

In some cases, the micro-connector from the camera module to the camera board PCB has been loose. This can be fixed by removing and re-seating the small (tiny!) yellow flex cable connector labelled "P5V04A SUNNY" on the camera board. It makes a click when it is fully seated.[8]

Colored Banding or Flickering on video

This can be caused by a poor power supply, or bad power cable. Several people have fixed this by replacing the power supply, or the microUSB power cable.[9][10]

Customizing

Changing the ribbon cable

The ribbon cable that connects the camera board to the Pi is 15-core 1mm pitch ribbon cable. In the UK they can be sourced from http://www.toby.co.uk/content/catalogue/products.aspx?series=FFCx-xx-A-xx-xx where the required type is FFC1-15-B150105160MM[11]. Other suppliers have been noted on eBay.

The Foundation has noted that the camera only passed EMI emissions testing with ribbon cable lengths of 15cm, although longer cables may also work.[12] One user 'rew' reports a 4 m (13 foot) extension cable is working.[13][14]

Adjusting Lens Focus

The camera is fixed-focus (at infinity) as delivered. The thread-locking glue dots can be scraped off[15] allowing manual lens focus, as close as 6 cm, or complete removal of the lens[16] allowing other optical systems. The lens thread size may be M6 x 0.35[17].

Macro, Wide, Tele adaptor lenses

The near focus point of the camera is about 1 meter as delivered. Without modification to the camera itself, it is possible to put a simple external lens in front such as reading glasses, SLR diopter ("close-up filter") or loupe to enable closer focus. For best results, put the additional lens very close to the camera lens.

Macro, Wide-Angle, and Telephoto adapter lenses designed for the iPhone 4/4s and similar devices will also work on the R-Pi camera. Depending on your configuration, properly mounting the accessory lens in front of the camera module may require some ingenuity. Focus becomes critical with a telephoto adapter, so success there may also require the manual focus modification.

Replacing Stock Lens

Changing the lens is a more significant and risky modification than simply adding an accessory lens. Richard Kinch has made an adaptor to mount M12 thread lenses on the R-Pi camera board, after unscrewing and removing the stock lens.[18][19] Martin Miller has posted a guide on raspberrytorte.com describing complete camera module disassembly and replacing lens holder with a stock M12 unit.[20] Various M12 x 0.5 (S-mount) lenses intended for board-level cameras are available at focal lengths from fisheye to long telephoto.[21][22][23]

Removing IR Filter

The IR filter is rigid and glued to the bottom inside of the black plastic lens housing, requiring complete disassembly to remove. Two early attempts by RPi forum users M33P[24] and scorp[25] were initially successful, but in both cases the camera died soon afterwards from blunt trauma to the fragile bond wires on the die.[26]

A RPi blog post (27 May 2013) has more description of this process with a video of the modification, and video from the resulting IR-enabled camera.[27]

Housings

To help building your own camera board case or enclosure, a hand-measured mechanical drawing[28] of the camera module is available, thanks to Gert van Loo. There is another drawing[29] from raspberrypi-spy. There are some CAD files for housings and camera holders available on Thingiverse[30].

References

  1. http://www.raspberrypi.org/archives/3890
  2. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=350#p358580
  3. https://github.com/illes/raspiraw
  4. http://bealecorner.org/best/RPi/
  5. http://www.raspberrypi-spy.co.uk/2013/05/how-to-disable-the-red-led-on-the-pi-camera-module/
  6. http://elinux.org/R-Pi_Troubleshooting#Troubleshooting_power_problems
  7. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43998#p350528
  8. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=39996&start=150#p373336
  9. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44863
  10. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43982
  11. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p352401
  12. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p348917
  13. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43737#p362714
  14. http://www.bitwizard.nl/catalog/product_info.php?products_id=146
  15. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=225#p346170
  16. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=32605&start=325#p352613
  17. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=46637&p=367053#p367053
  18. http://www.raspberrypi.org/phpBB3/viewtopic.php?t=45887
  19. http://www.truetex.com/raspberry_pi_m12_lens_adapter.pdf
  20. http://wiki.raspberrytorte.com/index.php?title=Camera_Module_Lens_Modifcation
  21. http://www.solino.com/cms/index.php?article_id=193&clang=0
  22. http://www.m12lenses.com/M12-Mount-Mega-Pixel-Lenses-s/21.htm
  23. http://www.net-gmbh.com/en/s-mount.html
  24. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44339#p352586
  25. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44339#p352902
  26. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44339
  27. http://www.raspberrypi.org/archives/4088
  28. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=44466
  29. http://www.raspberrypi-spy.co.uk/2013/05/pi-camera-module-mechanical-dimensions/
  30. http://www.thingiverse.com/search?q=raspberry+pi+camera&sa=