Urna Semper
Instructor ' s Name
June 14, 2014
Briefly:
Customize the Raspberry Pi to a wireless portable surveillance camera, plug in a USB camera, plug in the USB WiFi, then encode the data of the camera, push the encoded data to the streaming media server, others can watch the data collected by the Raspberry Pi camera through the streaming media server.
Content:
The Raspberry Pi power supply, plug in HDMI, connected to the display, is a MINIPC, in fact, this is very normal, but Raspberry Pi this thing is a simple MINIPC system, the support of the device is very little, plus the USB camera is older, is a few years ago bought, So not very good, LSUSB can see the USB can be recognized, but there is no corresponding driver
ls/dev/did not see Video0,lsmod also did not see v4l such information, and USB WiFi, can be identified, Raspberry Pi was bought last year, may kernel relative to a bit old, so there is no support on the download Pidora, installed a new. Because Raspberry Pi is SD card loading system, so, installation system is more convenient, will image through DD to sdcard inside can. After the installation, the USB WiFi can be recognized, but the USB camera is still not recognized, so that the need to re-drive;
Click ( here) to collapse or open
- [Email protected] ~]# LSUSB
- Bus 001 Device 008:id 046d:c31c Logitech, Inc. Keyboard K120 for Business
- Bus 001 Device 010:id 046d:c05a Logitech, Inc. m90/m100 Optical Mouse
- Bus 001 Device 006:id 0c45:62c0 microdia Sonix USB 2.0 Camera
- Bus 001 Device 005:id 1a40:0101 Terminus Technology Inc. Hub
- Bus 001 Device 004:id 0bda:8178 Realtek Semiconductor Corp rtl8192cu 802.11n WLAN Adapter
- Bus 001 Device 003:id 0424:ec00 Standard Microsystems Corp smsc9512/9514 Fast Ethernet Adapter
- Bus 001 Device 002:id 0424:9512 Standard Microsystems Corp smc9512/9514 USB Hub
- Bus 001 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub
With this information you can see two related USB messages, one USB camera
Click ( here) to collapse or open
- Bus 001 Device 006:id 0c45:62c0 microdia Sonix USB 2.0 Camera
The other one is USB WIFI
Click ( here) to collapse or open
- Bus 001 Device 004:id 0bda:8178 Realtek Semiconductor Corp rtl8192cu 802.11n WLAN Adapter
You can see that the USB camera is Microdia Sonix USB 2.0 Camera
The driver of this device has been in the Linux-2.6, but Pidora is not supported by default, so you need to re-compile Linuxkernel, custom, support RTL8192CU and Sonix camera can be, and then made of RPM, Install via RPM:
Click ( here) to collapse or open
- RPM-UVH kernelxxxxxxxxx.rpm
Once installed, you can see the boot information below.
Click ( here) to collapse or open
- [Email protected] ~]# Ls/boot
- BOOT.SCR Config.txt Config.txt.pal Grub start.elf
- Bootcode.bin Config.txt.hdmi_nooverscan Config.txt.pal_brazil kernel-3.12.17-2.20140415git1782035.rpfr20.img Start.elf.desc
- Cmdline.txt Config.txt.hdmi_overscan Fixup.dat kernel-3.12.20-1.20140521git7bd46e7.rpfr20.img start_cd.elf
- Config-3.12.17-2.20140415git1782035.rpfr20 Config.txt.ntsc_japan Fixup_cd.dat kernel.img start_x.elf
- Config-3.12.20-1.20140521git7bd46e7.rpfr20 Config.txt.ntsc_northamerica Fixup_x.dat Lost+found
Then restart the Raspberry Pi and you will find that the/video0 device driver file appears under/dev:
Click ( here) to collapse or open
- [Email protected] ~]# ls/dev/vide*
- /dev/video0
The camera is moving, so how do we collect the video data next?
This article is from bbs.chinaffmpeg.com Monkey King wrote
Through the ffmpeg can, in Raspberry Pi installed ffmpeg, in fact, Raspberry Pi convenient place is he is a minipc, very convenient, the PC under the compile FFmpeg when the source package to Raspberry Pi can be, The other steps are the same as the PC;
Then collect the camera data:
Because camera under Linux is generally v4l, that is, video4linux or video4linux2, and ffmeg can support this, then you can see as shown; USB camera can know some parameters, video is RawData, YUY2 data, resolution is 640x480;
It can then be encoded by FFmpeg, as with local files;
Click ( here) to collapse or open
- Ffmpeg-r 30-f video4linux2-i/dev/video0-vcodec libx264-r:v 25-b:v 2000k-pix_fmt yuv420p-preset ultrafast-s 640x4 80-f flv Rtmp://192.168.1.194/chinaffmpeg/sunwukong
The encoding speed is just right and can push the stream.
RTMP server can use Nginx-rtmp, because the Raspberry Pi is powered by USB, then you can use the rechargeable treasure, you can take away
Here's a look.
Http://blog.chinaunix.net/uid-11344913-id-4304172.html
Open source Project Raspberry Pi---wireless surveillance camera