2017-12-27

How to make my own recording system for the ip camera

My camera is Dahua IPC-HDW5231R-Z. Its firmware is 2.460.0000.7.R(Build Date: 2017-03-06).

I want to make my own recording system. Because the cam is unreliable. The cam has a feature of motion detection recording. It can record maximum 5 seconds before the event occurred. I think the 5 seconds are enough. But sometimes it does not work properly. Some recordings do not have pre-event scenes totally.

The cam supports HTTP API made by Dahua. The cam pushes HTTP messages to attached clients when events occur. This can be tested by wget, easily. But I use curl instead of wget, because curl has options for TCP_KEEPINTVL and TCP_KEEPIDLE. It helps to find connection problems. I cannot find the options for wget from the manpage.

I made a simple event listener script.
https://git.io/vbQME

OK. Next step is how to record.
The first idea is the buffered(delayed) stream.
http://archive.is/KhOMD
http://archive.is/NpNOI
http://archive.is/E2Kf4

But the above solution requires high processor power on RaspberryPi B2. I want to run my own recording system on RaspberryPi. I could not improve it.
In addition, FFmpeg has long initializing time from command beginning to real recording. If the command is run when an event message is received, there can be unrecorded time before the real recording. So I have given up the above method.

I thought another idea. Recording is segmented into a series of small chunks like N seconds videos. When an event message is arrived, useless videos are removed and the usefuls are stored. Motion detection of the cam is not reliable. So 24/7 continuous recording should be made. The motion detection messages are logged because they are helpful.

You can see the followings for segmented recording with ffmpeg.
http://archive.is/PN3dN
http://archive.is/HwzCd

I wrote my own command like the following.
https://git.io/vbd91

Someone says long-time running ffmpeg can use a lot of resources of the system.
http://archive.is/9UND8
But my ffmpeg of RaspberryPi has not shown problems yet.

So a process to do segmented recording should have max running time. And the scheduler like cron repeats the process.
http://archive.is/1z3pM

Still, this way has unrecorded-time problem as I mentioned above. So two different recording processes should have intentional overlap duration.

I use systemd timer.
Write .service file.
https://git.io/vNwFT
http://archive.is/gSDCN

Reload systemd.
systemctl --user daemon-reload

Test .service before enabling.
systemctl --user start xxx.service

See log.
journalctl --user -f

Write .timer file.
https://git.io/vNwb3
http://archive.is/2n5NC

Enable timer and then reboot.
systemctl --user enable xxx.timer

Recording file move configurations.
https://git.io/vNo8g
https://git.io/vNo82
https://git.io/vNo8a

Script to remove old records.
https://git.io/vN6MM
You should setup systemd/timer for this.

Script to synchronize time of camera.
https://git.io/vNXig


References
https://goo.gl/pFuaQp

2017-12-23

FPS and I-fame interval

http://archive.is/GHm0p
http://archive.is/h6HBK
http://archive.is/Tv2c5
http://archive.is/6kHpL
http://archive.is/IMG1N

Get event/alarm notifications from dahua/hikvision ip camera

dahua
http://archive.is/MKuxV
http://archive.is/CK5iY
http://archive.is/Jsge7
http://archive.is/zLz4w
http://archive.is/f5uEY
http://archive.is/oJvOS
http://archive.is/FIO4k
http://archive.is/KV77N
http://archive.is/mlsI8
http://archive.is/PmlAp
http://archive.is/QAHwT
http://archive.is/3LCJ7
http://archive.is/Rb9FB
https://goo.gl/fHtiU1
http://archive.is/SeOGi

hikvision
http://archive.is/nn7JP
http://archive.is/cywI9
http://archive.is/o4sRt
https://goo.gl/BNTDox

http://archive.is/oqMKw
http://archive.is/DkLYA
http://archive.is/N369S

2017-12-18

나만의 소머리 곰탕 끓이기

소머리 및 잡뼈는 12시간 이상 찬물에 담궈 핏물을 뺀다. 도중에 2~3번 물을 갈아 준다.
솥에 물을 넣고 끓인다. 물이 끓으면, 소머리 및 잡뼈를 넣는다. 다시 물이 끓을 때 까지 기다린다.
물이 끓으면, 소머리 및 잡뼈를 건져낸다. 솥에 있는 물은 모두 버리고, 솥을 한번 행군다.
건져낸 소머리 및 잡뼈는 찬물에 행군다.
소머리 및 잡뼈를 찬물과 같이 솥에 넣고 끓인다.
물이 끓으면, 불을 중불 또는 약불로 조절 후 계속 끓인다.
1시간 30분에서 2시간 정도 삶았을 때, 고기가 어느 정도 익었는지 확인한다. 고기가 충분히 익었다면, 불을 끄고 고기를 건져낸다. 만약 고기가 충분히 익지 않았다면, 계속 끓인다. 그리고 30분 간격으로 익은 정도를 확인한다. 고기가 너무 익으면, 썰기 힘들다. 건져낸 고기는 어느 정도 식힌 후, 썰어서 비닐봉투에 소분해서 냉동 보관한다.
고기를 썰고 남은 뼈는 다시 솥에 넣고 끓인다. 만약 물이 많이 줄었다면, 물을 추가로 붓는다.
물이 끓기 시작 한 후 부터 2시간 정도 푹 끓인 후 불을 끈다.
뼈를 건져낸다.
뼈를 건져내고 남은 곰국은 다른 솥 혹은 냄비에 옮겨 담는다. 곰국이 식으면 기름을 걷어내고 먹으면 된다.
건져낸 뼈를 물과 함께 다시 솥에 넣고 끓인다. 물이 끓으면, 중불 또는 약불로 조절 후, 2~3시간 더 끓인다.
불을 끄고 뼈를 건져낸다.
뼈를 건져내고 남은 곰국은 다른 솥 혹은 냄비에 옮겨 담는다. 곰국이 식으면 기름을 걷어내고 먹으면 된다.
1차 곰국, 2차 곰국을 따로 따로 먹어도 되고, 섞어서 먹어도 된다.
곰국은 비닐봉투에 소분해서 담은 후, 지퍼락에 넣어서 냉동 보관 한다. 냉동 보관할 수 없다면, 하루에 한번씩 끓여 놓아야 한다.

2017-12-08

About Windows Loader v2.2.2 by Daz

https://goo.gl/yfZuBQ

MD5: 323c0fd51071400b51eedb1be90a8188

The N version is not supported.

2017-12-06

Windows 7 ISO checksums

http://archive.is/6x7Bf
http://archive.is/E0Htu
http://archive.is/bTUsl

비판톨 Bepanthol 나이트케어 립크림 가격

바이엘 비판톨 나이트케어 립크림.
우리 동네 시장 사거리 근처 새로 생긴 약국에서 7000원에 구입함.
너무 비싼 듯.
인터넷에서 사더라도 제품 4000원 + 배송비 2500원 임.

2017-12-04

인감증명서 발급 비용 무료

인감증명서를 발급받는 이유가 공문에 첨부하거나 관공서에 증빙 자료 제출인 경우, 발급 비용을 받지 않는다고 한다. 이때 해당 공문이나 서류 등을 보여주고 증명서를 발급받아야 한다.

휴대폰 분실 후기

nexus s, 3g usim, annex telecom (a mobile).

고객센터 전화해서 분실로 인한 일시정지 신청함. 이렇게 하면, 발신, 데이터 사용이 중지됨. 그리고 해당 기계는 국내에서 사용 불가됨.

계정 비밀번호를 변경함. 특히 구글.

gs25 편의점 또는 고객센터를 통해서 3g usim chip 일반형을 구입한 후, 고객센터를 통해 등록해서 기존에 사용하던 번호 그대로 옮겨서 사용가능함.

유심을 판매하는 gs25 편의점은 에넥스텔레콤 홈페이지를 참고하라. 유심에는 3g, lte 두 종류가 있다. 그리고 크기별로 일반, 마이크로, 나노 종류가 있다. 해당 편의점에 연락해서 자신이 원하는 유심 재고가 있는지 확인하라.
나는 xx 시외버스터미널 롯데 시네마 근처 편의점에서 구입했다. 해당 편의점는 모든 형태의 유심 재고가 있더라.

유심 구입 및 등록 전에, 가지고 있는 공기계가 사용가능한지 고객센터를 통해 확인하라.

이후에는 기계의 gps 기능을 항시 켜두고, 구글 지도 타임라인 기능을 사용하자. 뿐만 아니라 삼성 기계의 경우 삼성 자체의 디바이스 찾기 기능을 활용하는 것도 고려하자.

2017-12-03

집 현관문 열쇠 키뭉치 교체

a-153, 데드볼트, 원키, 투키, 라이온투키 등으로 검색하면 됨.
키뭉치만 교체 가능함. 
손잡이까지 전부 교체하지 않아도 됨.