TP-Link NC-200 almost works
Question
I just bought a simple network camera, the TP-Link NC200 (UN). I managed to discover the still images and am able to download them using wget. I tried to setup a proper motion.conf configuration file, but motion denies the image saying:
[1] Received first header ('HTTP/1.0 200 OK')
[1] Received first header ('Server: Streamd,F4F26DF3C3CF')
[1] Received first header ('Date: Wed, 03 Aug 2016 12:52:03 UTC')
[1] Received first header ('Content-Type: image/jpg')
[1] Unrecognized content type
Therefore I think this is easily repaired by accepting jpg as content type as well, or providing option like "netcam_content_type". In case I need to run some debug program etc. just let me know. Keep up the good work!
I hope you are able to fix this. For the time being I periodically (every 5 sec) download using a local script and let motion look at the file.
Thanks!
Sven
===================================================
=========== TRACE OF WGET ========================
===================================================
A trace using wget shows:
sven@koolmees:~$ wget --user=admin --password=dHJhOGxh http://192.168.0.243:8080/snapshot.jpg
--2016-08-03 15:15:47-- http://192.168.0.243:8080/snapshot.jpg
Connecting to 192.168.0.243:8080... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Digest realm="TP-Link IP-Camera",qop="auth",nonce="5f0d12600b9dd2481a3867d1b1bd373f000034c514cf200b",opaque="64943214654649846565646421"
Connecting to 192.168.0.243:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 30448 (30K) [image/jpg]
Saving to: ‘snapshot.jpg.1’
snapshot.jpg.1 100%[================================================================>] 29,73K --.-KB/s in 0,1s
2016-08-03 15:15:48 (289 KB/s) - ‘snapshot.jpg.1’ saved [30448/30448]
wget -d --user=admin --password=BASE64_ENC_PASS http://192.168.0.243:8080/snapshot.jpg
Setting --user (user) to admin
Setting --password (password) to BASE64_ENC_PASS
DEBUG output created by Wget 1.17.1 on linux-gnu.
Reading HSTS entries from /home/sven/.wget-hsts
URI encoding = ‘UTF-8’
--2016-08-03 15:41:47-- http://192.168.0.243:8080/snapshot.jpg
Host ‘192.168.0.243’ has not issued a general basic challenge.
Connecting to 192.168.0.243:8080... connected.
Created socket 3.
Releasing 0x000055883365d510 (new refcount 0).
Deleting unused 0x000055883365d510.
---request begin---
GET /snapshot.jpg HTTP/1.1
User-Agent: Wget/1.17.1 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: 192.168.0.243:8080
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.0 401 Unauthorized
Server: Streamd,F4F26DF3C3CF
Date: Wed, 03 Aug 2016 13:41:45 UTC
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 0
WWW-Authenticate: Digest realm="TP-Link IP-Camera",qop="auth",nonce="bab34a3eef1208841ef1f28c251dc29b00003add077eac3c",opaque="64943214654649846565646421"
Connection: close
---response end---
401 Unauthorized
Closed fd 3
Auth scheme found 'Digest'
Auth param list ' realm="TP-Link IP-Camera",qop="auth",nonce="bab34a3eef1208841ef1f28c251dc29b00003add077eac3c",opaque="64943214654649846565646421"'
Auth param realm=TP-Link IP-Camera
Auth param qop=auth
Auth param nonce=bab34a3eef1208841ef1f28c251dc29b00003add077eac3c
Auth param opaque=64943214654649846565646421
Authentication selected: Digest realm="TP-Link IP-Camera",qop="auth",nonce="bab34a3eef1208841ef1f28c251dc29b00003add077eac3c",opaque="64943214654649846565646421"
Connecting to 192.168.0.243:8080... connected.
Created socket 3.
Releasing 0x000055883365d510 (new refcount 0).
Deleting unused 0x000055883365d510.
---request begin---
GET /snapshot.jpg HTTP/1.1
User-Agent: Wget/1.17.1 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: 192.168.0.243:8080
Connection: Keep-Alive
Authorization: Digest username="admin", realm="TP-Link IP-Camera", nonce="bab34a3eef1208841ef1f28c251dc29b00003add077eac3c", uri="/snapshot.jpg", response="74cb2c79481b3c67295f1d140e2cf85f", qop=auth, nc=00000001, cnonce="021f22c5", opaque="64943214654649846565646421"
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.0 200 OK
Server: Streamd,F4F26DF3C3CF
Date: Wed, 03 Aug 2016 13:41:45 UTC
Content-Type: image/jpg
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 29016
Connection: close
---response end---
200 OK
Length: 29016 (28K) [image/jpg]
Saving to: ‘snapshot.jpg’
snapshot.jpg 100%[================================================================>] 28,34K --.-KB/s in 0,1s
Closed fd 3
2016-08-03 15:41:47 (269 KB/s) - ‘snapshot.jpg’ saved [29016/29016]
Saving HSTS entries to /home/sven/.wget-hsts
Environment
Motion version: |
3.2.12 |
ffmpeg version: |
only using libjpeg 1.3 |
Libraries: |
libjpeg, not database |
Server OS: |
Ubuntu 14.04.5 LTS |
--
SvenWallage - 03 Aug 2016
Answer