2016년 10월 25일 화요일

스마트 프로덕트 프로젝트 10/25 IP카메라 모션 검출과 저장

IP카메라 모션 검출과 저장

1. Circular Stream이용한 저장

picamera의 circular stream을 이용하여 메모리에 최근 영상만 계속 저장
모션이 검출되면 별도 파일로 저장

https://picamera.readthedocs.io/en/release-1.12/recipes2.html#splitting-to-from-a-circular-stream

2. 모션 검출

http://www.ostafichuk.com/raspberry-pi-projects/python-picamera-motion-detection/


실습

- 2의 모션 검출 방법을 참고하여 1의 detect_motion() 함수 완성
- 저장 파일의 이름을 before.h264, after.h264가 아니라 현재시간.before.h264, 현재시간.after.h264로 저장할 것. 예를 들어 201610225091055.before.h264