Habe da schon einige Versuche gemacht.
Nun kann ich den Dateanaufbau nicht ganz Deuten, und Wie kriege ich den Bildstring raus?
Habe da eine Anwendung Kopiert so zu sagen und bekomme Folgende Antwort:
Die Antwort daten Interpretiere ich so:
Startbefehl
Verstrichene Zeit in Sekunden
Verstichene Zeit in MüSekunden
Dateigrösse
Init Läuft
Attempting to connect to camera...
200
OK
Connected!
--oxONE_IMAGExo
x-ts-sec: 1294532113
x-ts-usec: 840820
Content-Type: image/jpeg
Content-Length: 8431
ÿØÿà
Hier der testcode der Kamera welche eine Trendnet IP522P ist
Code: Alles auswählen
# -*- coding: cp1252 -*-
import httplib
import base64
import StringIO
ip='192.168.0.3'
username='admin'
password='admin'
IP = ip
Username = username
Password = password
Connected = False
print "Init Läuft"
print 'Attempting to connect to camera...'
try:
h = httplib.HTTP(IP)
h.putrequest('GET','/video/mjpg.cgi')
h.putheader('Authorization', 'Basic %s' % base64.encodestring('%s:%s' % (Username, Password))[:-1])
h.endheaders()
errcode, errmsg, headers = h.getreply()
File = h.getfile()
print errcode
print errmsg
Connected = True
print 'Connected!'
#return True
except:
print 'Unable to Connect'
Connected = False
#return False
if Connected:
s = File.readline()
print s# '--myboundry'
s = File.readline()
print s
s = File.readline()
print s
s = File.readline()
print s
s = File.readline()
print s
s = File.readline()
print s
"""
s = File.readline()
print s
s = File.readline()
print s
s = File.readline()
print s
"""
# 'Content-Length: #####'
framesize = int(s[16:])
s = File.read(framesize)
# jpeg data
while s[0] != chr(0xff): # strip off some junk in front of the jpeg
s = s[1:]
x= StringIO.StringIO(s)
print s
Thomas