GoPro Camera not working in Jetson Tx2

Hi, I have tried both GoPro Hero 5 and 6 that works on my Ubuntu and Windows 10 but doesn’t worked in Jetson Tx 2. I believe the USB camera is detected but there’s no input video (probably pixel format problem).

When I input it detects the camera as video1

ls /dev/video*
/dev/video0  /dev/video1

With this command it gives

v4l2-ctl -d /dev/video1 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2

Things that I’ve tried :

  • Using Cheese app, it detect USB Camera 3.0 but doesn't show anything
  • Try with ``` gst-launch-1.0 v4l2src device="/dev/video1" ! "video/x-raw,width=1920,height=1080,format=I420" ! nvoverlaysink ```

    but produces error

    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    
  • Try with Python and OpenCV and produces error ``` cv2.error: OpenCV(3.4.1-dev) /home/nvidia/opencv/modules/highgui/src/window.cpp:356: error: (-215) size.width>0 && size.height>0 in function imshow ```

Any help will be appreciated. Thanks

Hi,
Please try

gst-launch-1.0 v4l2src device="/dev/video1" ! "video/x-raw,width=1920,height=1080,format=YUY2" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvoverlaysink

YUYV is defined as YUY2 in gstreamer frameworks.

@DaneLLL thanks for the reply, I tried that command and it shows

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Nothing happened

Hi,
Does GoPro camera work as a v4l2 source? It seems to be an IP camera per

@DaneLLL actually I’m not really sure about that. I tried the source code on the link you gave above, but still nothing i shown after running the python code

Hi,
Please share how hero 5 work on Ubuntu. We have hero 4 but the USB cable is only for charging and cannot see /dev/video1 being created.

Does it show all resolutions in running:

v4l2-ctl -d /dev/video1 --list-formats-ext

@DaneLLL thanks for the reply, on Ubuntu I only connect the GoPro through USB3.0 Capture device, open cheese application and it shows the video. Here’s the result of above command:

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 640x360
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 720x480
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 720x576
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 768x576
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 856x480
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 960x540
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1024x576
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1280x800
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1280x1024
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1368x768
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1440x900
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1600x1200
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1680x1050
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1920x1200
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.017s (59.940 fps)
			Interval: Discrete 0.020s (50.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (29.970 fps)
			Interval: Discrete 0.040s (25.000 fps)

Hi,
It seems like GoPro Hero 5 does not support UVC drivers. It does not mention it in user manual:
[url]https://gopro.com/content/dam/help/hero5-black/manuals/HERO5Black_UM_ENG_REVD_Web.pdf[/url]

Please share how you successfully run it on PC Ubuntu. Do you use the default type C to type A cable to connect Hero 5 and PC, and run a gstreamer command?

What gives:

gst-launch-1.0 -v v4l2src device=/dev/video1 ! fakesink

@DaneLLL I didn’t try with gstreamer on my PC Ubuntu. I connect Gopro to my PC using USB3.0 Capture device like this

@Honey_Patouceul it will stuck at this state

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive

You may try:

gst-launch-1.0 -v v4l2src device=/dev/video1 ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive' ! videoconvert ! xvimagesink

It may be slow however, so you may also try:

gst-launch-1.0 -v v4l2src device=/dev/video1 ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive' ! nvvidconv ! nvegltransform ! nveglglessink

@Honey_Patouceul both commands give gst-launch-1.0 window but it doesn’t show the video. Only shows the captured ubuntu screen when I run that command (broken image / video)

You may post the output of first command for investigating further.

You may also try:

GST_DEBUG=*:3  gst-launch-1.0 -ev v4l2src device=/dev/video1 ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive' ! videoconvert ! xvimagesink

and look in debug messages for errors.

@Honey_Patouceul the command produces very long traceback, here’s the example. I also doubt that this is the UVC problem

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
0:00:00.279215962 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.279281498 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1181:gst_v4l2_buffer_pool_dqbuf:<v4l2src0:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:00.279304762 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.279360026 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.279383834 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.279423002 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.279444090 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.279477658 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.279497371 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.286888363 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.286982828 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.287045580 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.287064812 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.287099948 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.287116812 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.287149516 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.287171948 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.294888893 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.295078302 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.295202302 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.295239550 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.295287006 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.295312318 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.295349727 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.295371455 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.302595119 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.302656495 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload
0:00:00.302703951 16149   0x55c240dcf0 WARN           v4l2allocator gstv4l2allocator.c:1351:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:00.302761935 16149   0x55c240dcf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1946:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src> Dropping corrupted buffer without payload

Not sure, but it may be related to this issue. You may try to rebuild gstreamer without libv4l2.

[EDIT: I’m not confident about this suggestion. You may also try adding queue:

gst-launch-1.0 -ev v4l2src device=/dev/video1 ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive' ! queue ! videoconvert ! xvimagesink

or try to set io-mode property of v4l2src to 1 or 2:

gst-launch-1.0 -ev v4l2src device=/dev/video1 io-mode=1 ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1, colorimetry=(string)bt709, interlace-mode=(string)progressive' ! queue ! videoconvert ! xvimagesink

]

@Honey_Patouceul thanks for the help, but still same result. I’m not sure whether this is the gopro problem or my USB3.0 Capture device is not supported

If anybody is looking for a solution on how to connect to a recent GoPro over WiFi, using the built in rtmp streaming, you can build nginx and it’s rtmp module on your tegra device stream to it and get the stream back out into gstreamer (eg. for deepstream) using the rtmpsrc source element. It’s even more convenient if you set your tegra device up as a hotspot.