Connecting GoPro hero 6 black as a webcam

I have conned my GoPro hero 6 via a HDMI to USB capture card to the USB port of the Jetson nano 2gb. However I am not sure how to view the video feed from it.

I tired using Cheese, but it doesn’t show any output, and I have tried running the commands for USB cameras from here Taking Your First Picture with CSI or USB Camera | NVIDIA Developer but they usually result in just an error message and no video feed

You may try to start with your USB adapter not plugged in.
In a terminal, launch:

watch -n 1 'ls /dev/video*'

Then plug your camera in and note the new video node path that appears when you’ve plugged your USB adapter in. Assuming here /dev/video1, you would adapt.

Then, see what formats, resolutions and framerates your camera suppport. This requires v4l-tools;

sudo apt update
sudo apt install v4l-utils

# Query your cam modes, you would adpat video node number:
v4l2-ctl --device /dev/video1 --list-formats-ext

From that information, it would be possible to further advise.

Sorry for hijacking the OP post but I have a similar issue.

So I have run the following cmd lines and this is the output.

v4l2-ctl --device /dev/video2 --list-formats-ext

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : Motion-JPEG
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'YUYV'
Name        : YUYV 4:2:2
	Size: Discrete 1280x720
		Interval: Discrete 0.100s (10.000 fps)
	Size: Discrete 640x480
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 640x360
		Interval: Discrete 0.033s (30.000 fps)

Index       : 2
Type        : Video Capture
Pixel Format: 'H264' (compressed)
Name        : H.264
	Size: Discrete 1920x1080
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 1280x720
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 640x480
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 640x360
		Interval: Discrete 0.033s (30.000 fps)

`

So you would display your camera, assuming you have an X display, with:

# Raw mode (YUYV 4:2:2):
gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw, format=YUY2, width=1280, height=720, framerate=30/1 ! xvimagesink
# if not working fine, try adding mmap 
gst-launch-1.0 v4l2src device=/dev/video2 io-mode=2 ! video/x-raw, format=YUY2, width=1280, height=720, framerate=30/1 ! xvimagesink

# MJPEG
gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280,height=720, framerate=30/1 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink
# or
gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280,height=720, framerate=30/1 ! jpegparse ! nvjpegdec ! 'video/x-raw(memory:NVMM),format=I420' ! nvvidconv ! xvimagesink

# Not sure for H264 through v4l2src...
gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink

I tried the following

nvidia@nvidia-desktop:~/Documents/MC/build$ gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw, format=YUY2, width=1280, height=720, framerate=30/1 ! xvimagesink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
nvidia@nvidia-desktop:~/Documents/MC/build$

nvidia@nvidia-desktop:~/Documents/MC/build$ gst-launch-1.0 v4l2src device=/dev/video2 io-mode=2 ! video/x-raw, format=YUY2, width=1280, height=720, framerate=30/1 ! xvimagesink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
nvidia@nvidia-desktop:~/Documents/MC/build$

nvidia@nvidia-desktop:~/Documents/MC/build$ gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280,height=720, framerate=30/1 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
gstv4l2src.c(658): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.022725958
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
nvidia@nvidia-desktop:~/Documents/MC/build$

nvidia@nvidia-desktop:~/Documents/MC/build$ gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280,height=720, framerate=30/1 ! jpegparse ! nvjpegdec ! ‘video/x-raw(memory:NVMM),format=I420’ ! nvvidconv ! xvimagesink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
gstv4l2src.c(658): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.020646686
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
nvidia@nvidia-desktop:~/Documents/MC/build$

nvidia@nvidia-desktop:~/Documents/MC/build$ gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
gstv4l2src.c(658): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.026731354
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
nvidia@nvidia-desktop:~/Documents/MC/build$

@nicholas.bissessar
I’d suggest to move back to your original topic or create a new one.
You may post there the ouput of lsusb -t.
You may also try H264 with io-mode=2.

Thank you for replying and sorry for the delayed response.

The USB connection doesn’t seem to be the issue as upon running:

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

I get:

ioctl: VIDIOC_ENUM_FMT
Index       : 0
Type        : Video Capture
Pixel Format: 'YUYV'
Name        : YUYV 4:2:2

Also when i try to run the command:
nvgstcapture-1.0 --camsrc=0 --cap-dev-node=0
it returns the following error:

$ nvgstcapture-1.0 --camsrc=0 --cap-dev-node=0
Encoder null, cannot set bitrate!
Encoder Profile = High
Runtime USB Camera Commands:

  Help : 'h'
  Quit : 'q'
  Set Capture Mode:
  mo:<val>
      (1): image
      (2): video
  Get Capture Mode:
  gmo
  Capture: enter 'j' OR
       followed by a timer (e.g., jx5000, capture after 5 seconds) OR
       followed by multishot count (e.g., j:6, capture 6 images)
       timer/multihot values are optional, capture defaults to single shot with timer=0s
  Start Recording : enter '1'
  Stop Recording  : enter '0'
  Set Preview Resolution:
  pcr:<val> e.g., pcr:2
      (0) : 176x144
      (1) : 320x240
      (2) : 640x480
      (3) : 1280x720
      (4) : 1920x1080
  NOTE: Preview/Encode resolution will be same as Capture resolution for USB-Camera
  Get Preview Resolution:
  gpcr
  Get Image Capture Resolution:
  gicr
  Get Video Capture Resolution:
  gvcr
  Set Capture Device Node:
  cdn:<val> e.g., cdn:0
      (0): /dev/video0
      (1): /dev/video1
      (2): /dev/video2
  Get Capture Device Node:
  gcdn


Runtime encoder configuration options:

  Set Encoding Bit-rate(in bytes):
  br:<val> e.g., br:4000000
  Get Encoding Bit-rate(in bytes):
  gbr
  Set Encoding Profile(only for H.264):
  ep:<val> e.g., ep:1
      (0): Baseline
      (1): Main
      (2): High
  Get Encoding Profile(only for H.264):
  gep
  Force IDR Frame on video Encoder(only for H.264):
  Enter 'f' 


** Message: 22:29:57.608: <main:4670> iterating capture loop ....
ERROR on bus: by /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstV4l2Src:v4l2src0: Internal data stream error.
debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
** Message: 22:29:57.663: <main:4680> Capture completed
** Message: 22:29:57.665: <main:4729> Camera application will now exit

I tried running a simple USB webcam with it, and it seem to work fine with the above commands, but with me using a GoPro through a capture card the interference doesn’t seem to work and is what I need help with

Hi,
For capturing frames through v4l2, please refer to
Jetson Nano FAQ
Q: I have a USB camera. How can I launch it on Jetson Nano?

But somehow it does not show information of width,height.framerate in the v4l2-ctl command. May need to get the information from vendor.