G
GMane Python
Hello All.
Using a network camera with built-in webserver, I'd like to have a python
program download .jpg files on a local lan. the location is
http://<ip-address>/jpg/image.jpg.
Currently, I'm importing urllib and using urlopen to the address, then
read()-ing it, saving it to a binary file. All that is working great, but
maybe a bit slowly. I'm getting ~2.3 frames per second, and would like
between 5-10 frames per second.
Am I approaching this incorrectly? I have to do a urlopen, then .read()
for each image. Is there any way to 'persist' the urlopen so I just have to
keep read()-ing or maybe is there a type of streaming read? I have many
cameras, so there are many threads simultaneously reading and dropping them
in a central Queue for saving later.
I appreciate it!
-Dave
WebImage = urllib.urlopen("http://<ip-address>/jpg/image.jpg").read()
QueuePacket = []
QueuePacket.append(WebImage)
Using a network camera with built-in webserver, I'd like to have a python
program download .jpg files on a local lan. the location is
http://<ip-address>/jpg/image.jpg.
Currently, I'm importing urllib and using urlopen to the address, then
read()-ing it, saving it to a binary file. All that is working great, but
maybe a bit slowly. I'm getting ~2.3 frames per second, and would like
between 5-10 frames per second.
Am I approaching this incorrectly? I have to do a urlopen, then .read()
for each image. Is there any way to 'persist' the urlopen so I just have to
keep read()-ing or maybe is there a type of streaming read? I have many
cameras, so there are many threads simultaneously reading and dropping them
in a central Queue for saving later.
I appreciate it!
-Dave
WebImage = urllib.urlopen("http://<ip-address>/jpg/image.jpg").read()
QueuePacket = []
QueuePacket.append(WebImage)