February 19th, 2013, 06:49 PM
Ethernet packet processing with Python
I have a dlink DCS-930L camera. I have directly connect it to my computer (a direct cat5 connection), and I assigned a staic IP adress, and everything works great. (by the way my OS is Linux)
When I open a web-browser, and connect to the static IP address that I've assigned for the camera (e.g. log into 192.168.0.20) camera just works fine real time.
This was to verify that my camera works fine, and that I was able to establish the Ethernet connection correctly.
Now, what I need to do is to do some image processing on the video frames that I receive over the Ethernet from the camera. So, I don't want to use the web-browser anymore as a means of display, and instead, I want to use Python to read this frames.
In other words, let's say that the camera produces 30 frames/second, and each frame having a certain size (e.g 1920x1080 pixels).
All I want to do is to start reading this frames in by Python. I don't mind if I am missing frames and if I am processing it slowly. Even if I am able to process one frame over few seconds, I am still okay with that.
Since video is a collection of images (in this case 30 images per second), I want to be able to read these images using Python, and be able to do whatever processing that I need to do on this images.
If I had these images saved on the computer, I knew how to open these images with Python, and start to manipulate them. But, since in this case, the images are in fact being streamed, I just want to know how can I sample them (maybe one every few second), and do some manipulation using Python?
Please let me know if my question is still wage, and I will try to clarify it as much as I can.