I try to execute a python2 script which is supposed to display a movie file.

When I execute this code with VNC it works, I can see the movie being played (eventhough the fps is limitted around 2...)

while True:
    ret,frame = cap.read()
    if cv2.waitKey(1) & 0xFF ==ord('q'):

But when I execute the same script from a Putty SSH console I got the error message :

(frame:964): Gtk-WARNING **: cannot open display:

After a bit of searching over the internet I tried the command:

export DISPLAY=:0.0

Then it works the same way as if it was launched trough VNC (2fps) eventhough is supposed to play the clip really fast !

Should I try without enabling the VNC server for getting the video played at the desired speed?

Do you have any tips/direction where to get answer from ?

When I try the same script on my laptop it works like a charm.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.