ricohapi / libuvc-theta-sample

Other
33 stars 28 forks source link

Gst loopback not streaming frames on Ubuntu 18.04 #6

Closed HainingLuo closed 3 years ago

HainingLuo commented 3 years ago

Hi all,

Thanks for delevoping this great package! I have been recently trying to get live stream of a Theta Z1 on Ubuntu 18.04. As suggested in the tutorials, I have built libuvc-theta, libuvc-theta-sample and v4l2loopback from source on my machine. I also have installed the dependencies for gstreamers listed in the tutorial.

So far, the gst_viewer works perfectly, however, when I ran the gst_loopback, the frames received by opencv videocapture were in None type and the VLC shows Your input can't be opened when I tried to open /dev/video0. The virtual video device is created by running sudo modprobe v4l2loopback.

I can confirm that there were no other cameras connected and virtual video device was created at video0. Does anyone have any idea why this is happening? Any suggestion is appreciated! Many thanks in advance :)

codetricity commented 3 years ago

Are you running it on x86 or Jetson? If it's on x86, there may be some problems with support for certain video cards with v4l2loopback. Try this plug-in for gstreamer for OpenCV

https://github.com/nickel110/gstthetauvc

There is a forum with some additional information on the libuvc-theta project.

HainingLuo commented 3 years ago

Thanks for the reply. I am using a x86 machine (i7-8700K with GTX1080). Following same steps, I have also tried with a Jetson Xavier NX. Similarly, the gst_viewer works well but gst_loopback gives "Internal data stream error". Any suggestion on how to solve this? I have downloaded the gstthetauvc package, just trying to figure out what does it do now. Thanks again.

HainingLuo commented 3 years ago

I figured it out! Turns out that was my own problem. For the VLC, instead of using the VLC installed from Ubuntu Software, the one from apt works (just run /usr/bin/vlc v4l2:///dev/video0 after installation). For OpenCV, switching to python3 solved the issue.