Ask Your Question

Revision history [back]

[Python, windows 10] Reducing VideoCapture latency from UDP

Purpose: capturing real time (no latency) UDP video stream from Raspberry Pi on windows 10 + win python.

Currently: VideoCapture(“udp:/[IP]:[PORT]”) works well. However, it seems to buffer incoming frames and produce 1-3 seconds delay, which is unacceptable.

More details: I can capture UDP video stream using mplayer with setting frame rate much higher than the one from PI (mplayer frame rate - 60fps, Pi - 15fps). This guaranties that the latest frame shown as quick as we can receive from UDP. I have measured end-to-end Pi + Mplayer latency and it is 200 ms (160-400ms). I would like to get the same results using OpenCV.

Problem: VideoCapture does not accept file descriptor as an input (it accepts file name or device id only). There would be no problem if I could provide my file descriptor or buffer pointer to VideoCapture. However, as of my current understanding I could not do this.

Note: I know this is not a problem on Linux, where named pipes actually work!!! – Sorry this is not the case on “awesome” windows (you would have to configure ACLs for named pipes, which is a pain using python!) :(