Select timeout error when running video streaming code

1,546 views
Skip to first unread message

Tinashe Mudavanhu

unread,
Apr 4, 2016, 3:09:32 AM4/4/16
to BeagleBoard, jkri...@beagleboard.org
Hi,

I am testing an opencv video capture code on my BBB (running Debian Wheezy: Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux) but getting a select timeout error everytime i run the program. Now i am behind schedule of my final year Iris recognition system Project. (In case you want to know why i am going through this video capture code, it is for tracking the eyes then capture an image that will be processed to obtain an IrisCode.)

I installed opencv 3.0.0 following instructions on http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/#comment-393561 , but had to turn off ffmpeg (suggested on one of the forums: http://stackoverflow.com/questions/31663498/opencv-3-0-0-make-error-with-ffmpeg/31818445#31818445 ) after obtaining a compilation errors but firstly i had compiled ffmpeg from source.

Below is the Video_Capturing code i tested with;

import numpy as np
import cv2

cap = cv2.VideoCapture(0)

while(True):
     # Capture frame-by-frame
     ret, frame = cap.read()

     # Our operations on the frame come here
     gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

     # Display the resulting frame
     cv2.imshow('frame',gray)
     if cv2.waitKey(1) & 0xFF == ord('q'):
         break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
 

After running the code i am obtaining the following information  (Note: The frame is only opening when i run the python script in LXTerminal accessed through tightvnc. It is failing to run through ssh);

oot@beaglebone:~/Project/Testing# python Video_Streaming.py

(process:1488): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
Xlib:  extension "RANDR" missing on display ":1".
select timeout
select timeout
select timeout
select timeout
^Cselect timeout
Traceback (most recent call last):
  File "Video_Streaming.py", line 8, in <module>
    ret, frame = cap.read()
KeyboardInterrupt
root@beaglebone:~/Project/Testing#


I'm stuck i need your help.

Tinashe Mudavanhu

unread,
Apr 6, 2016, 3:03:58 AM4/6/16
to BeagleBoard, jkri...@beagleboard.org
Is anyone out there to assist? I'm stuck

Tinashe Mudavanhu

unread,
Apr 10, 2016, 7:56:06 AM4/10/16
to beagl...@googlegroups.com, jkri...@beagleboard.org
I finally got a solution to the problem. This might help someone out there facing the same problem. Rather i would say i avoided the problem and not really solved the problem. I was able to get a video stream from the preinstalled Debian Distro. OpenCV 3.0.0 seems to have some issues. It is the one that keeps on giving the "select timeout error". I thought it was a v4l driver problem but then i had to compile v4l from source to get the latest update but still obtaining the same error.

What i don't really get is is that, is it a BBB hardware or some driver problem? Why i ask that question is that, the code can run well in an Ubuntu 14.04 PC with installed OpenCV 14.04 LTS.

I hope someone can try it and if there is a solution, i have my eyes open to see it because i would like to use some SIFT packages in OpenCV 3.0.0 on my BBB.   

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/VFuvveM_8Gc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages