Getting errors while live streaming from Theta Z1 + Jetson Nano to opencv

Could you advise me to get rid of this issue? it’s urgent

command 1: gst-launch-1.0 thetauvcsrc mode=4K ! queue ! h264parse ! decodebin ! queue ! autovideosink sync=false

OUTPUT:

Setting pipeline to PAUSED …

ERROR: Pipeline doesn’t want to pause.

ERROR: from element /GstPipeline:pipeline0/GstThetauvcsrc:thetauvcsrc0: Found 1 Theta(s), but none available.

Additional debug info:

gstthetauvcsrc.c(513): gst_thetauvcsrc_start (): /GstPipeline:pipeline0/GstThetauvcsrc:thetauvcsrc0

Setting pipeline to NULL …

Freeing pipeline …

command 2:

import cv2
cap = cv2.VideoCapture(“thetauvcsrc
! decodebin
! autovideoconvert
! video/x-raw,format=BGRx
! queue ! videoconvert
! video/x-raw,format=BGR ! queue ! appsink”)

OUTPUT:

[ WARN:0@0.318] global cap_gstreamer.cpp:2839 handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module thetauvcsrc0 reported: Found 1 Theta(s), but none available.
[ WARN:0@0.323] global cap_gstreamer.cpp:1698 open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0@0.323] global cap_gstreamer.cpp:1173 isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Traceback (most recent call last):
File “/home/botadmin/test.py”, line 11, in
raise IOError(‘Cannot open RICOH THETA’)
OSError: Cannot open RICOH THETA

more details:

Python 3.11.7 (main, Feb 12 2024, 13:14:15) [GCC 7.5.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import cv2
print(cv2.getBuildInformation())

General configuration for OpenCV 4.9.0 =====================================
Version control: 4.9.0

Platform:
Timestamp: 2024-03-15T08:55:31Z
Host: Linux 4.9.337-tegra aarch64
CMake: 3.10.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: RELEASE

CPU/HW features:
Baseline: NEON FP16
Dispatched code generation: NEON_DOTPROD NEON_FP16
requested: NEON_FP16 NEON_BF16 NEON_DOTPROD
NEON_DOTPROD (1 files): + NEON_DOTPROD
NEON_FP16 (2 files): + NEON_FP16

C/C++:
Built as dynamic libs?: YES
C++ standard: 11
C++ Compiler: /usr/bin/c++ (ver 7.5.0)
C++ flags (Release): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,–gc-sections -Wl,–as-needed -Wl,–no-undefined
Linker flags (Debug): -Wl,–gc-sections -Wl,–as-needed -Wl,–no-undefined
ccache: NO
Precompiled headers: NO
Extra dependencies: dl m pthread rt
3rdparty dependencies:

OpenCV modules:
To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching ts video videoio
Disabled: world
Disabled by dependency: -
Unavailable: java python2
Applications: tests perf_tests examples apps
Documentation: NO
Non-free algorithms: NO

GUI: NONE
GTK+: NO
VTK support: NO

Media I/O:
ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
WEBP: build (ver encoder: 0x020f)
PNG: build (ver 1.6.37)
TIFF: build (ver 42 - 4.2.0)
JPEG 2000: build (ver 2.5.0)
OpenEXR: build (ver 2.3.0)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: NO
FFMPEG: NO
avcodec: NO
avformat: NO
avutil: NO
swscale: NO
avresample: NO
GStreamer: YES (1.14.5)
v4l/v4l2: YES (linux/videodev2.h)

Parallel framework: pthreads

Trace: YES (with Intel ITT)

Other third-party libraries:
Lapack: NO
Eigen: YES (ver 3.3.4)
Custom HAL: YES (carotene (ver 0.0.1, Auto detected))
Protobuf: build (3.19.1)
Flatbuffers: builtin/3rdparty (23.5.9)

OpenCL: YES (no extra features)
Include path: /home/botadmin/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python 3:
Interpreter: /home/botadmin/myenv/bin/python3 (ver 3.11.7)
Libraries: /usr/local/lib/libpython3.11.a (ver 3.11.7)
numpy: /home/botadmin/myenv/lib/python3.11/site-packages/numpy/core/include (ver 1.26.4)
install path: /home/botadmin/myenv/lib/python3.11/site-packages/cv2/python-3.11

Python (for build): /home/botadmin/myenv/bin/python3

Java:
ant: NO
Java: NO
JNI: NO
Java wrappers: NO
Java tests: NO

Install to: /home/botadmin/myenv

these are already installed and compiled :
gstthetauvc libusb-compat-0.1 libuvc-theta-sample libptp2-theta libuvc-theta v4l2loopback

echo $GST_PLUGIN_PATH
/usr/lib/aarch64-linux-gnu/gstreamer-1.0

echo $PKG_CONFIG_PATH

/usr/local/lib/pkgconfig and it has these two files libusb.pc libuvc.pc

please help me to run this script with opencv

did you see this post?

Have you run

sudo apt purge libuvc-dev

Yes, I did all this sudo apt purge libuvc-dev and verified that it was not installed, I am using libuvc-theta only.

Did you ever install libuvc-dev on the Jetson Nano at any point in the past for other development?

Did you see this response?

What version of jetpack are you using?

Also, you could try and use the specific Jetson decoder and sink.

“nvv4l2decoder ! nv3dsink sync=false”

No, I never install libuvc-dev but I verified this and it was not installed
jetpack version : 4.6.4-b39

could you send me the full command @craig ?

I’m running the same version of Jetpack

I can test it with a Z1 later today.

Is the firmware of your Z1 updated? You can use the free desktop app on Mac/Windows of the free mobile app on Android/iOS to update the Z1 firmware.

thanks @Craig we bought 3 Ricoh theta z1 after seeing your post and videos, we thought this could help us in our case but now we’re facing issues but I knew it will be fixed by your support.

cat /etc/nv_tegra_release

R32 (release), REVISION: 7.4, GCID: 33514132, BOARD: t210ref, EABI: aarch64, DATE: Fri Jun 9 04:25:08 UTC 2023

Do you know how to upgrade the firmware inside the RICOH THETA Z1?

If you connect the Z1 to a computer with Wifi when the Z1 is a hotspot, you can get the firmware version with:

http://192.168.1.1/osc/info

Yes, I will do this @Craig thanks

I want to use gstthetauvc with opencv for live streaming so please guide me for this.

not working

Is the camera mounted as a filesystem?

@Vijay_Saw unfortunately, there is something wrong with my Jetson Nano and I don’t have equipment to test this with right now. However, I did install and run Jetpack 7.1 (nv_tegra_release) in June of 2023 and it worked fine.

I remember that someone else at a University was having the same problem as you. I believe that the source of the problem was that the camera was being mounted as a filesystem.

Also, I’ve never used Docker with my install. I used Etcher with the image.

Did you get the SD Card Image from this link?

I also used Etcher to flash the image and today I reinstalled everything but still I am getting an error
the only think I have to do is to update firmware
./gst_loopback

start, hit any key to stop
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Error: Internal data stream error.
stop

Isn’t that a different error than you had before?

The original error you posted was Found 1 Theta(s), but none available.

image

The error you just posted is

Error: Internal data stream error.

Do you have the viewer working with ./gst_viewer?

BTW, I ordered a replacement Jetson Nano for my personal testing, but it may take 2 weeks to getto my office. In the meantime, we have several years of people testing the Z1 with Linux for streaming. There’s a lot of great information on this site.

yes get_viewer is working and I was getting above error that I have posted earlier on running this command gst-launch-1.0 thetauvcsrc mode=4K ! queue ! h264parse ! decodebin ! queue ! autovideosink sync=false

In the thread above, the person had almost the same problem as you. He marked the last post as “Solution”. Maybe you can try and contact him?

It seemed like the last pipeline worked for him.

Note that in that discussion, the THETA was mounted on the Jetson as a filesystem at some point which caused a problem.

You have the camera showing and working with gst_viewer, right?

$ ./gst_viewer -l
No : Product            : Serial    
 0 : RICOH THETA Z1     : 10010104  

You’ve loaded v4l2loopback with modprobe

as root

 # modprobe v4l2loopback

lsmod shows v4l2loopback in the kernel.

$ lsmod
Module                  Size  Used by
uvcvideo               88565  0
bnep                   16562  2
zram                   26166  4
overlay                48691  0
spidev                 13282  0
v4l2loopback           37383  0

v4l2-ctl shows the dummy video device

$ v4l2-ctl --info
Driver Info (not using libv4l2):
	Driver name   : v4l2 loopback
	Card type     : Dummy video device (0x0000)
	Bus info      : platform:v4l2loopback-000
	Driver version: 4.9.140
	Capabilities  : 0x85208003

if you have gst_viewer working, it’s likely you’ll get the loopback working soon.