Python and webcam capture delay?

Tim Roberts timr at
Sun Jul 5 20:36:11 EDT 2009

"jack catcher (nick)" <nomail at> wrote:
>I'm thinking of using Python for capturing and showing live webcam 
>stream simultaneously between two computers via local area network. 
>Operating system is Windows. I'm going to begin with VideoCapture 
>extension, no ideas about other implementation yet. Do you have any 
>suggestions on how short delay I should hope to achieve in showing the 
>video? This would be part of a psychological experiment, so I would need 
>to deliver the video stream with a reasonable delay (say, below 100ms).

You need to do the math on this.  Remember that a full 640x480 RGB stream
at 30 frames per second runs 28 megabytes per second.  That's more than
twice what a 100 megabit network can pump.

You can probably use Python to oversee this, but you might want to consider
using lower-level code to control the actual hardware.  If you are
targeting Windows, for example, you could write a DirectShow graph to pump
into a renderer that transmits out to a network, then another graph to
receive from the network and display it.

You can manage the network latency by adding a delays in the local graph.
Tim Roberts, timr at
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list