Raspberry Piのカメラで静止画を撮る時のオプションメモ:fswebcam/USBカメラ時とraspistill/公式カメラ
カテゴリー:#電子工作 Raspberry Pi、Arduinoなど(記事数:238)

2024.12.04

Raspberry Piのカメラで静止画を撮る時のオプションメモ:fswebcam/USBカメラ時とraspistill/公式カメラ


★fswebcamの基本
fswebcam -D 3 -S 10 -r 1280x720 capture.jpg

 -?, --help                   Display this help page and exit.
-c, --config Load configuration from file.
-q, --quiet Hides all messages except for errors.
-v, --verbose Displays extra messages while capturing
--version Displays the version and exits.
-l, --loop Run in loop mode.
-b, --background Run in the background.
-o, --output Output the log to a file.
-d, --device Sets the source to use.
-i, --input Selects the input to use.
-t, --tuner Selects the tuner to use.
-f, --frequency Selects the frequency use.
-p, --palette Selects the palette format to use.
-D, --delay ★Sets the pre-capture delay time. (seconds)
-r, --resolution ★Sets the capture resolution.
--fps Sets the capture frame rate.
-F, --frames Sets the number of frames to capture.
-S, --skip ★Sets the number of frames to skip.
--dumpframe Dump a raw frame to file.
-s, --set = Sets a control value.
--revert Restores original captured image.
--flip ★Flips the image. (h, v)
--crop [,] Crop a part of the image.
--scale Scales the image.
--rotate ★Rotates the image in right angles.
--deinterlace Reduces interlace artifacts.
--invert Inverts the images colours.
--greyscale ★Removes colour from the image.
--swapchannels Swap channels c1 and c2.
--no-banner ★Hides the banner.
--top-banner Puts the banner at the top.
--bottom-banner Puts the banner at the bottom. (Default)
--banner-colour Sets the banner colour. (#AARRGGBB)
--line-colour Sets the banner line colour.
--text-colour Sets the text colour.
--font <[name][:size]> Sets the font and/or size.
--no-shadow Disables the text shadow.
--shadow Enables the text shadow.
--title ★Sets the main title. (top left)
--no-title ★Clears the main title.
--subtitle ★Sets the sub-title. (bottom left)
--no-subtitle ★Clears the sub-title.
--timestamp ★Sets the timestamp format. (top right)
--no-timestamp ★Clears the timestamp.
--gmt Use GMT instead of local timezone.
--info Sets the info text. (bottom right)
--no-info Clears the info text.
--underlay Sets the underlay image.
--no-underlay Clears the underlay.
--overlay Sets the overlay image.
--no-overlay Clears the overlay.
--jpeg ★Outputs a JPEG image. (-1, 0 - 95)
--png ★Outputs a PNG image. (-1, 0 - 10)
--save Save image to file.
--exec Execute a command and wait for it to complete.


★raspistill基本
raspistill -o capture.jpg

-q, --quality   : ★Set jpeg quality <0 to 100>
-r, --raw : Add raw bayer data to jpeg metadata
-l, --latest : Link latest complete image to filename
-t, --timeout : Time (in ms) before takes picture and shuts down (if not specified, set to 5s)
-th, --thumb : Set thumbnail parameters (x:y:quality) or none
-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 (format as 'key=value') or none
-tl, --timelapse : Timelapse mode. Takes a picture every ms. %d == frame number (Try: -o img_%04d.jpg)
-fp, --fullpreview : Run the preview using the still capture resolution (may reduce preview fps)
-k, --keypress : Wait between captures for a ENTER, X then ENTER to exit
-s, --signal : Wait between captures for a SIGUSR1 or SIGUSR2 from another process
-g, --gl : Draw preview to texture instead of using video render component
-gc, --glcapture : Capture the GL frame-buffer instead of the camera image
-bm, --burst : Enable 'burst capture mode'
-dt, --datetime : Replace output pattern (%d) with DateTime (MonthDayHourMinSec)
-ts, --timestamp : Replace output pattern (%d) with unix timestamp (seconds since 1970)
-fs, --framestart : Starting frame number in output pattern(%d)
-rs, --restart : JPEG Restart interval (default of 0 for none)

GL parameter commands

-gs, --glscene : GL scene square,teapot,mirror,yuv,sobel,vcsm_square
-gw, --glwin : GL window settings <'x,y,w,h'>

Common Settings commands

-?, --help : This help information
-w, --width : ★Set image width
-h, --height : ★Set image height
-o, --output : ★Output filename (to write to stdout, use '-o -'). If not specified, no file is saved
-v, --verbose : Output verbose information during run
-cs, --camselect : Select camera . Default 0
-md, --mode : Force sensor mode. 0=auto. See docs for other modes available
-gps, --gpsdexif : Apply real-time GPS information to output (e.g. EXIF in JPG, annotation in video (requires libgps.so.23)

Preview parameter commands

-p, --preview : Preview window settings <'x,y,w,h'>
-f, --fullscreen : Fullscreen preview mode
-op, --opacity : Preview window opacity (0-255)
-n, --nopreview : Do not display a preview window
-dn, --dispnum : Display on which to display the preview window (dispmanx/tvservice numbering)

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 stabilisation
-ev, --ev : Set EV compensation - steps of 1/6 stop
-ex, --exposure : Set exposure mode (see Notes)
-fli, --flicker : Set flicker avoid 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, 90, 180, or 270)
-hf, --hflip : ★Set horizontal flip
-vf, --vflip : ★Set vertical flip
-roi, --roi : Set region of interest (x,y,w,d as normalised coordinates [0.0-1.0])
-ss, --shutter : ★Set shutter speed in microseconds
-awbg, --awbgains : Set AWB gains - AWB mode must be off
-drc, --drc : Set DRC Level (see Notes)
-st, --stats : Force recomputation of statistics on stills capture pass
-a, --annotate : Enable/Set annotate flags or text
-3d, --stereo : Select stereoscopic mode
-dec, --decimate : Half width/height of stereo image
-3dswap, --3dswap : Swap camera order for stereoscopic
-ae, --annotateex : Set extra annotation parameters (text size, text colour(hex YUV), bg colour(hex YUV), justify, x, y)
-ag, --analoggain : Set the analog gain (floating point)
-dg, --digitalgain : Set the digital gain (floating point)
-set, --settings : Retrieve camera settings and write to stdout
-fw, --focus : Draw a window with the focus FoM value on the image.


USBカメラの検出チェックは「lsusb」、公式カメラの検出は「vcgencmd get_camera」

Category:#電子工作 Raspberry Pi、Arduinoなど



■ ■ ■ コメント ■ ■ ■

いいっすね!=9

名前 ↑B

コメント(※改行は省略されます)

※3回以上の連続書き込み不可
この記事のアクセス数:78

本カテゴリーで直近コメントが書かれた記事
12/12 00:58:「M5Stamp Fly」をドローン初心者が自宅で飛ばしてファームウェア更新から宙返り、UnitCam付けたりとか159156分前
11/29 08:19:おうち秋月電子かよ!自宅の積み電子キットがすごい量に・・・123日前
11/27 09:16:「Raspberry Pi Pico 2 W」は7ドル(1000円)でBluetoothもWifiも使える125日前
07/01 21:34:Arduinoで航空無線が聴ける。Arduino Nanoで制御するエアバンド受信シールド「SCARP」が9500円。2024年10月出荷開始273日前
12/06 16:22:赤外線カットフィルター無しのラズパイ公式カメラv2にフィルター追加481日前
11/03 10:39:オープンソースの家庭用地震計「EQIS-1」(PRIORIS)の完成品が8580円で登場515日前
09/29 11:31:Raspberry Pi 5が発表。4から2倍高速化、M2ストレージおよびPCI-Express2.0対応。外付けでGPUがつなげちゃう?1万円~550日前
08/28 00:48:Raspberry pi zero 2Wが本当に3500円で来た!zeroとの比較582日前
08/22 09:42:Raspberry zero 2Wが送料込み3500円588日前
06/24 23:21:今月の「トランジスタ技術」はラズパイカメラ特集。凄いこの雑誌セミプロの寄稿を集めた同人誌だ646日前
05/06 22:29:Raspberry PiでCPU温度を測定する方法695日前
04/24 23:54:何日間持つか実験。ラズパイzeroにUSBカメラとモバイルバッテリーをつないでリアルタイム配信707日前
04/08 09:45:『これが届く頃、俺の畑は既に死んでいるだろう』ラズベリーを地植えして超絶後悔した人の手記724日前


→カテゴリー:#電子工作 Raspberry Pi、Arduinoなど(記事数:238)
本カテゴリーの最近の記事(コメント数)
2025.03.05ラズパイ公式!ポメラ的な文章作成用ハンドヘルドPC「Micro Journal Rev.2 ReVamp」。Zero 2W搭載
2025.02.27理系フリマ8が3月1日開催
2024.12.10「M5Stamp Fly」をドローン初心者が自宅で飛ばしてファームウェア更新から宙返り、UnitCam付けたりとか32コメ
2024.12.05SeeedのRaspberry Pi zero用Grove Base(HAT)がベストフィットで良い感じ11コメ
2024.12.04Raspberry Piのカメラで静止画を撮る時のオプションメモ:fswebcam/USBカメラ時とraspistill/公式カメラ9コメ
2024.11.28おうち秋月電子かよ!自宅の積み電子キットがすごい量に・・・30コメ
2024.11.26「Raspberry Pi Pico 2 W」は7ドル(1000円)でBluetoothもWifiも使える46コメ
2024.11.17Raspberry Piベースの立体視カメラを作るためのオープンソースボード「StereoPi」15コメ
2024.11.03Raspberry Piとディスプレイでお手軽デジタルサイネージを作れるオープンソースソフト「Anthias」5コメ
2024.10.08Raspberry piは電源ぶつ切りするとすぐにカーネルパニック起こして起動しなくなる。改善方法と復旧方法27コメ

最近の常連さん
orz★38 白★53 らむ★32 トクメー★17 ななしさそ★72 F★52 ふぇちゅいん(年度末まったり) TW★95 ω★105 umomo★2 特命さん★79 JP★26 ポコ★346 ふぇいちゅん★2 うにゃ(emでネクサス5→�)★38 Dcd★83 すきやき★77 酔もぐら★41 ふぇちゅいんさんふぁん(ゆるりゆラリー)★101 うぃ(滅茶苦茶久しぶり)★70 さてさて★30 とくめい★82 τ(はじめてのすまほ) TW★52 名古屋関西人 TW★25 ☆★45 knob★2 774(←半角のひと)★83 匿名?★28 謎★80 京ポン3B(意地でもエッジ)★40 10年選手★48