Jetson TX1 webcam working but screen grab not

I am unable to do a screen grab from an otherwise properly functioning TX1 onboard camera. I confirmed that the onboard camera is working. The following displays correct real-time camera output:

$ gst-launch-1.0 nvcamerasrc fpsRange=“30.0 30.0” ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvtee ! nvvidconv flip-method=2 ! ‘video/x-raw(memory:NVMM), format=(string)I420’ ! nvoverlaysink -e

However, VideoCapture is returning empty frames result.

Here the issue is replicated in python shell:

stream = cv2.VideoCapture(0)

stream.read()
(False, None)

stream.grab()
False

stream.isOpened()
False

Hi MarkPlutowski,

We’re working this issue, and going to have an update version in coming release soon.

Instead of using OpenCV4Tegra, you could try to remove the exisitng Opencv4Tegra and install the common OpenCV 3.1.0 by referring the below thread:
https://devtalk.nvidia.com/default/topic/917386/jetson-tx1/usb-3-0-port-unstable-on-jetson-tx1-/post/4835793/#4835793

This should work as temporary solution on your case.

Thanks

Thank you Nvidia. I gave that a try. Everything went well up to the following step:

ubuntu@tegra-ubuntu:~/src/opencv-3.1.0/samples/gpu$ ./hog --camera 0

GStreamer Plugin: Embedded video playback halted; module v4l2src0 reported: Cannot identify device ‘/dev/video0’.
OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/ubuntu/src/opencv-3.1.0/modules/videoio/src/cap_gstreamer.cpp, line 818
error: /home/ubuntu/src/opencv-3.1.0/modules/videoio/src/cap_gstreamer.cpp:818: error: (-2) GStreamer: unable to start pipeline
in function cvCaptureFromCAM_GStreamer

Hi MarkPlutowski,

The updated OpenCV4Tegra 2.4.13 was released within the JetPack 2.2.

Download Jetpack 2.2 bundle — https://developer.nvidia.com/embedded/jetpack
Access L4T components/docs — https://developer.nvidia.com/embedded/linux-tegra
Please see the Release Notes — http://developer.nvidia.com/embedded/dlc/l4t-release-notes-24-1

Thanks

$ ./JetPack-L4T-2.2-linux-x64.run

Error: JetPack must be run on x86_64 HOST platform. Detected aarch64 platform

I’m running this on the Jetson TX1.

$ lscpu
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 4

JetPack is run from a separate desktop x86_64 Ubuntu Linux host…Jetson is put in recovery mode with the provided micro-USB cable for flash (ethernet is used for other steps), then run JetPack.

I see from another forum on this topic: “Flashing software runs on any x86_64 64-bit desktop Linux machine…a host. JetPack bundles several things together, and depends specifically on the Ubuntu 14.04 Linux distribution (running on x86_64 64-bit hardware).”

I’m developing on the TX1 in standalone, accessing it via usb keyboard and remotely via ssh from macbook.

Is there another means of fixing the VideoCapture issue that doesn’t entail flashing software ?

If it is a software version issue, you will probably have to flash…R23.1 (the original shipping L4T version) had quite a few fixes needed. Flashing does not require JetPack, as individual packages can be added manually. The base flash though will require another Linux machine…if you ignore JetPack and manually flash, then you can run the driver package plus sample rootfs without the desktop host being Ubuntu…it just needs to be Linux. At the core of flashing is an executable program which understands the Jetson in recovery mode…this program runs on most any desktop Linux distribution…JetPack relies on Ubuntu packaging system.

Some people here have had success flashing from a Linux OS installed via a VM, but you’ll need to make sure the VM is using a Linux filesystem, and the USB configuration might be tricky.

Or, you could install Linux to a flash drive, then boot to that, and flash from there. Here’s some instructions on how to install: http://askubuntu.com/questions/525845/how-to-finally-get-ubuntu-to-boot-on-a-mac-from-external-usb-storage

Thanks cstotts and linuxdev.