# 錄影指令 ###### tags: `camera` ### 在 Command Line 環境下指令 |指令|說明| |-|-| |-t|設定影片的時間(ms)| |-o|設定影片存放的路徑| |-w|設定影片的寬(pixel)| |-h|設定影片的高(pixel)| * 錄 5 秒的 1080p30 的影片 (預設寬高1920*1080) ``` raspivid -t 5000 -o video.h264 ``` * 錄 5 秒的 1080p30 的影片,寬高為 640*480 ``` raspivid -t 5000 -w 640 -h 480 -o video.h264 ``` ### 在 Python 環境下指令 ```python import picamera camera = picamera.PiCamera() camera.start_recording('video.h264') camera.wait_recording(3) camera.stop_recording() ```