5,710
edits
Changes
→Hardware Peripherals
After these libraries are built, you can then <code>cd</code> to each example project, <code>make</code>, and run the resultant binary file. Please note that these instructions are repeated in the included <code>README</code> file.
*getting started - http://www.raspberrypi.org/archives/3890
*code: https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/raspicam
===PIR triggered (motion triggered) camera===*taking photos with PIR sensor - http://www.raspberrypi.org/learning/parent-detector/*launch python script in detached screen session:<syntaxhighlight lang="bash">sudo screen -dmS mocap /home/pi/code/housemachine/pircam.py</syntaxhighlight>*reconnect to screen:<syntaxhighlight lang="bash">sudo screen -r mocap</syntaxhighlight>*copy new video files:<syntaxhighlight lang="bash">rsync -va --ignore-existing pi@office.local:~/videos/pircam/ ~/Pictures/ceiling_fisheye/</syntaxhighlight> ===mmal opencv modetect===*set recording format in code.*with motion detection opencv - http://www.sodnpoo.com/posts.xml/raspberrypi_camera_with_opencv_motion_detection_and_recording.xml*https://github.com/sodnpoo/rpi-mmal-opencv-modetect*run in terminal and save motion frames to video:<syntaxhighlight lang="bash"> ./mmal_opencv_modect > video.h264</syntaxhighlight> ===picam python interface===*http://www.raspberrypi.org/learning/python-picamera-setup/===Streaming from RPi to OS X===*RPi: <pre>raspivid -t 999999 -o - | nc 192.168.2.31 5001</pre>*Laptop: <pre>nc -l 5001 | mplayer -fps 31 -cache 1024 -</pre>====low-latency====*http://blog.tkjelectronics.dk/2013/06/how-to-stream-video-and-audio-from-a-raspberry-pi-with-no-latency/ ===Adding an M12 mount===*http://wiki.raspberrytorte.com/index.php?title=Camera_Module_Lens_Modifcation#Lens_Mount_Modification===Taking a Photo=raspistill==
<syntaxhighlight lang="bash">
raspistill -o image.jpg
</syntaxhighlight>
*faster photo: https://bitbucket.org/niklas_rother/rasperry-pi-userland/raw/master/host_applications/linux/apps/raspicam/raspifastcamd_scripts
===Take a taking video=with raspivid==
*take a video
<syntaxhighlight lang="bash">
</syntaxhighlight>
===New Video Parameters=new video modes==
*http://www.raspberrypi.org/new-camera-mode-released/
*install rpi-update:
</syntaxhighlight>
*half resolution, binned:
<syntaxhighlight lang="bash">
raspivid -w 640 -h 480 -fps 90 -t 10000 -o test90fps.h264
</syntaxhighlight>
==streaming the pi camera==
*RPi:
<syntaxhighlight lang="bash">
raspivid -t 999999 -o - | nc 192.168.2.31 5001
</syntaxhighlight>
*Laptop:
<syntaxhighlight lang="bash">
nc -l 5001 | mplayer -fps 31 -cache 1024 -
</syntaxhighlight>
*low-latency: http://blog.tkjelectronics.dk/2013/06/how-to-stream-video-and-audio-from-a-raspberry-pi-with-no-latency/
==python interface (picam)==
*http://www.raspberrypi.org/learning/python-picamera-setup/
==motion-triggered capture==
*PIR triggered (motion triggered) camera
*PIR sensor - http://www.raspberrypi.org/learning/parent-detector/
*launch python script in detached screen session:
<syntaxhighlight lang="bash">
sudo screen -dmS mocap /home/pi/code/housemachine/pircam.py
</syntaxhighlight>
*reconnect to screen:
<syntaxhighlight lang="bash">
sudo screen -r mocap
</syntaxhighlight>
*copy new video files:
<syntaxhighlight lang="bash">
rsync -va --ignore-existing pi@office.local:~/videos/pircam/ ~/Pictures/ceiling_fisheye/
</syntaxhighlight>
*mmal opencv modetect
*set recording format in code.
*with motion detection opencv - http://www.sodnpoo.com/posts.xml/raspberrypi_camera_with_opencv_motion_detection_and_recording.xml
*https://github.com/sodnpoo/rpi-mmal-opencv-modetect
*run in terminal and save motion frames to video:
<syntaxhighlight lang="bash">
./mmal_opencv_modect > video.h264
</syntaxhighlight>
==alternate lens mounts==
*Adding an M12 mount: http://wiki.raspberrytorte.com/index.php?title=Camera_Module_Lens_Modifcation#Lens_Mount_Modification
=Hardware Peripherals=
Verified Peripherals - http://elinux.org/RPi_VerifiedPeripherals
==C-Media USB sound device==