ros-drivers / video_stream_opencv

A package to open video streams and publish them in ROS using the opencv videocapture mechanism
227 stars 159 forks source link

Select Timeout Issue When Testing #58

Closed nickkraus closed 4 years ago

nickkraus commented 4 years ago

After installing, and running ./test_video_resource.py 0 I get the errors below, any ideas? I am using a SainSmart IMX219 Camera Module on Jetson Nano.

Trying to open resource: /dev/video0 Correctly opened resource, starting to show feed. select timeout select timeout OpenCV Error: Assertion failed (total() == 0 || data != NULL) in Mat, file /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/core/include/opencv2/core/mat.inl.hpp, line 431 Traceback (most recent call last): File "./test_video_resource.py", line 43, in rval, frame = cap.read() cv2.error: /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/core/include/opencv2/core/mat.inl.hpp:431: error: (-215) total() == 0 || data != NULL in function Mat

awesomebytes commented 4 years ago

That's an internal error of OpenCV, I'm guessing it's not able to extract an image (size 0 it reports?) from the device.

Does the camera work with some other software like 'cheese'?

Good luck!

nickkraus commented 4 years ago

Thanks for the quick reply! Image streams fine if I run:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e

from: https://github.com/JetsonHacksNano/CSI-Camera

In addition to this issue, when I run $ roslaunch video_stream_opencv camera.launch, I get a few other errors/warnings:

  1. GLib-GObject-CRITICAL **: 21:49:43.015: g_object_unref: assertion 'G_IS_OBJECT (object)' failed (and G_IS_ELEMENT) and

  2. A few moments later I get a bunch of VIDIOC_QBUF: Invalid argument messages

Its probably a system setup issue as opposed to an issue with the git repo. Just thought i'd post to see if you have seen it before.

awesomebytes commented 4 years ago

There is a different ROS package that uses GST to get access to the webcam. You configure it with your gst command. I forgot the name of the package but a quick Google surely will make you find it.

I think that may work better for you!

On Sat, Jan 18, 2020, 14:52 nickkraus notifications@github.com wrote:

Thanks for the quick reply! Image streams fine if I run:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e

from: https://github.com/JetsonHacksNano/CSI-Camera

In addition to this issue, when I run $ roslaunch video_stream_opencv camera.launch, I get a few issues:

1.

GLib-GObject-CRITICAL **: 21:49:43.015: g_object_unref: assertion 'G_IS_OBJECT (object)' failed (and G_IS_ELEMENT) and 2.

A few moments later I get a bunch of VIDIOC_QBUF: Invalid argument messages

Its probably a system setup issue as opposed to an issue with the git repo. Just thought i'd post to see if you have seen it before.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-drivers/video_stream_opencv/issues/58?email_source=notifications&email_token=AANEK5FNNVHDB67G6LQQYQLQ6J4HJA5CNFSM4KIQTPOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJJPVMQ#issuecomment-575863474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEK5HUJBD3M6O55K4WCH3Q6J4HJANCNFSM4KIQTPOA .

nickkraus commented 4 years ago

Not a problem with the repo as far as I can tell. Similar issues when using gscam repo. Closing

DanKamilov commented 4 years ago

Not a problem with the repo as far as I can tell. Similar issues when using gscam repo. Closing

how do you resolve it? I have the same problem

nickkraus commented 4 years ago

Didn't resolve it. Havent gotten around to it in a while. Im suspicious of the ribbon cable connection although I doubt thats it considering I can get it to stream. I may try an ethernet or usb camera just to be sure.

tjcheem commented 4 years ago

I am having the same issue. it keeps printing "select timeout" when trying to use my usb webcam. Streaming in another app works fine. Any suggestions. I did not alter any files before running.