2014-01-13

라즈베리파이를 webcam 스트리밍 서버로 만들기

1. 먼저 웹캠을 준비하자. 호환목록 리스트는 다음과 같다.

http://elinux.org/RPi_USB_Webcams

 

내가 고른 웹캠은 Microsoft VX-2000 이것이다. 10달러에 저렴하게(?) 구입.

http://www.microsoft.com/hardware/en-us/d/lifecam-vx-2000

 

2. motion을 먼저 설치하고 나중에 웹캠을 연결한다. 이유는 모르겠지만 가끔 에러가 나서 그렇다.

sudo apt-get install motion

 

3. 웹캠을 연결하고 확인해 본다. 웹캠이 연결이 안되면 다음 단계로 못 간다. 잘 확인하자.

lsusb

pi@mika ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 045e:0761 Microsoft Corp.
Bus 001 Device 006: ID 067b:2507 Prolific Technology, Inc. PL2507 Hi-speed USB to IDE bridge controller
pi@mika ~ $

 

4. 모션 설정파일을 수정한다.

sudo nano /etc/motion/motion.conf

 

다음과 같이 고친다.

daemon OFF 이것을 ON 으로 바꾼다.
webcam_localhost ON 이것을 OFF 로 바꾼다.

 

5. 모션 스타트업 파일을 수정한다. 기본적으로 off로 되어있다.

sudo nano /etc/default/motion

 

다음과 같이 고친다.

start_motion_daemon=no 를 yes로 고친다.

 

6. 모션 서버를 시작 한다.

sudo service motion start

 

7. 확인해 보자. 라즈베리파이아이피:포트번호8081 이렇게 입력 하면 된다. (크롬,사파리에서 버그가 있다. 아직 안됨, FireFox추천)

192.168.0.15:8081

 

포트포워딩이나 그런 것을 해야 할 수도 있지만 여기에선 생략한다.

 

다음과 같이 동작한다.

Screen Shot 2014 01 13 at 15 23 35

 

추가 팁:

a. 포트번호를 바꾸기. 기본적으로 8081 포트로 되어있다. 하지만 80으로 바꿔보자.

sudo nano /etc/motion/motion.conf

 

다음과 같이 고친다.

webcam_port 8081 이것을 80으로 번호를 바꿔준다.

 

재시작 한다.

sudo service motion restart

 

b. 프레임 텍스트를 크게 하자.

sudo nano /etc/motion/motion.conf

 

다음과 같이 고친다.

text_double off 이것을 on으로 바꾼다.

 

재시작 한다.

sudo service motion restart

 

 

참고:

http://pingbin.com/2012/12/raspberry-pi-web-cam-server-motion/

http://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camera

 

크롬버그 해결방법:

http://chris.gg/2012/07/using-a-ps3-eyetoy-with-the-raspberry-pi/

 

 

1 comment:

  1. Hello, This is Future Dimension,

    we provide sposync.com to access to your device with
    streaming and control using webRTC technology Free.

    Only one required app is a web browser - Chromium and
    provided python websocket server on RPI.
    (tested for Buster and Chromium 72)

    You can define the control command and extra security key if needed.
    With these inputs, only you can access to your device remotely.
    Please contact misdiva1bil@gmail.com

    Thanks,
    David FDI
    RPI 탑재 Chromium 활용 원격 접속 제어 및 스트리밍 서비스 무료 - 앱 개발전 간단한 제어 명령만 정의되면 기능등 시험 가능 sposync.com https://youtu.be/3l2O2i6UX20
    Free Video Ads, Event Hosting, P2P Call & Control

    ReplyDelete