Hi dusty
thanks for the inputs, this was very helpful. We are making slight progress. So, first I checked the camera on my desktop and made sure it works there. Then I plugged it into its own USB tower on the Nano (I have a keyboard and a mouse in the other tower).
First I ran video-viewer --help
and checked that the --debug
and --verbose
flags result in the same output. Then I proceeded to try to run through all of these configurations:
tl;dr:
- 160x120 and 176x144 @ 30 Hz work
- 320x240 and above do not work
- the
--input-rate
parameter does not get passed through
Long version:
I tried running the smaller sizes and got the following results for video-viewer --input-width=160 --input-height=120 --input-rate=15 --verbose /dev/video1
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera -- attempting to create device v4l2:///dev/video1
(video-viewer:10401): GStreamer-CRITICAL **: 10:39:26.638: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
(video-viewer:10401): GStreamer-CRITICAL **: 10:39:26.638: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
(video-viewer:10401): GStreamer-CRITICAL **: 10:39:26.639: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
[gstreamer] gstCamera -- found v4l2 device: USB 2.0 PC Cam
[gstreamer] v4l2-proplist, device.path=(string)/dev/video1, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)uvcvideo, v4l2.device.card=(string)"USB\ 2.0\ PC\ Cam", v4l2.device.bus_info=(string)usb-70090000.xusb-2.3, v4l2.device.version=(uint)264588, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera -- found 6 caps for v4l2 device /dev/video1
[gstreamer] [0] video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)1024, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/2;
[gstreamer] [1] video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [2] video/x-raw, format=(string)YUY2, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [3] video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [4] video/x-raw, format=(string)YUY2, width=(int)176, height=(int)144, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [5] video/x-raw, format=(string)YUY2, width=(int)160, height=(int)120, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] gstCamera -- selected device profile: codec=raw format=yuyv width=160 height=120
[gstreamer] gstCamera pipeline string:
[gstreamer] v4l2src device=/dev/video1 ! video/x-raw, format=(string)YUY2, width=(int)160, height=(int)120 ! appsink name=mysink
[gstreamer] gstCamera successfully created device v4l2:///dev/video1
[video] created gstCamera from v4l2:///dev/video1
------------------------------------------------
gstCamera video options:
------------------------------------------------
-- URI: v4l2:///dev/video1
- protocol: v4l2
- location: /dev/video1
- port: 1
-- deviceType: v4l2
-- ioType: input
-- codec: raw
-- width: 160
-- height: 120
-- frameRate: 30.000000
-- bitRate: 0
-- numBuffers: 4
-- zeroCopy: true
-- flipMethod: none
-- loop: 0
------------------------------------------------
[OpenGL] glDisplay -- X screen 0 resolution: 1920x1080
[OpenGL] glDisplay -- X window resolution: 1920x1080
[OpenGL] glDisplay -- display device initialized (1920x1080)
[video] created glDisplay from display://0
------------------------------------------------
glDisplay video options:
------------------------------------------------
-- URI: display://0
- protocol: display
- location: 0
-- deviceType: display
-- ioType: output
-- codec: raw
-- width: 1920
-- height: 1080
-- frameRate: 0.000000
-- bitRate: 0
-- numBuffers: 4
-- zeroCopy: true
-- flipMethod: none
-- loop: 0
------------------------------------------------
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> v4l2src0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> v4l2src0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstCamera -- onPreroll
[gstreamer] gstCamera recieve caps: video/x-raw, format=(string)YUY2, width=(int)160, height=(int)120, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, colorimetry=(string)2:4:5:1, interlace-mode=(string)progressive
[gstreamer] gstCamera -- recieved first frame, codec=raw format=yuyv width=160 height=120 size=38400
RingBuffer -- allocated 4 buffers (38400 bytes each, 153600 bytes total)
[gstreamer] gstreamer changed state from READY to PAUSED ==> mysink
[gstreamer] gstreamer message async-done ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> mysink
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> pipeline0
RingBuffer -- allocated 4 buffers (57600 bytes each, 230400 bytes total)
[gstreamer] gstreamer message qos ==> v4l2src0
video-viewer: captured 1 frames (160 x 120)
[OpenGL] glDisplay -- set the window size to 160x120
[OpenGL] creating 160x120 texture (GL_RGB8 format, 57600 bytes)
[cuda] registered openGL texture for interop access (160x120, GL_RGB8, 57600 bytes)
video-viewer: captured 2 frames (160 x 120)
video-viewer: captured 3 frames (160 x 120)
video-viewer: captured 4 frames (160 x 120)
video-viewer: captured 5 frames (160 x 120)
video-viewer: captured 6 frames (160 x 120)
video-viewer: captured 7 frames (160 x 120)
video-viewer: captured 8 frames (160 x 120)
video-viewer: captured 9 frames (160 x 120)
video-viewer: captured 10 frames (160 x 120)
video-viewer: captured 11 frames (160 x 120)
video-viewer: captured 12 frames (160 x 120)
video-viewer: captured 13 frames (160 x 120)
video-viewer: captured 14 frames (160 x 120)
video-viewer: captured 15 frames (160 x 120)
video-viewer: captured 16 frames (160 x 120)
video-viewer: captured 17 frames (160 x 120)
video-viewer: captured 18 frames (160 x 120)
video-viewer: captured 19 frames (160 x 120)
video-viewer: captured 20 frames (160 x 120)
video-viewer: captured 21 frames (160 x 120)
video-viewer: captured 22 frames (160 x 120)
video-viewer: captured 23 frames (160 x 120)
video-viewer: captured 24 frames (160 x 120)
video-viewer: captured 25 frames (160 x 120)
video-viewer: captured 26 frames (160 x 120)
video-viewer: captured 27 frames (160 x 120)
video-viewer: captured 28 frames (160 x 120)
video-viewer: captured 29 frames (160 x 120)
video-viewer: captured 30 frames (160 x 120)
video-viewer: captured 31 frames (160 x 120)
video-viewer: captured 32 frames (160 x 120)
video-viewer: captured 33 frames (160 x 120)
video-viewer: captured 34 frames (160 x 120)
video-viewer: captured 35 frames (160 x 120)
video-viewer: captured 36 frames (160 x 120)
video-viewer: captured 37 frames (160 x 120)
video-viewer: captured 38 frames (160 x 120)
video-viewer: captured 39 frames (160 x 120)
video-viewer: captured 40 frames (160 x 120)
^Creceived SIGINT
video-viewer: shutting down...
[gstreamer] gstCamera -- stopping pipeline, transitioning to GST_STATE_NULL
[gstreamer] gstCamera -- pipeline stopped
video-viewer: shutdown complete
the video-options
sections tells me that the --input-rate=15
parameter does not get passed through. I tried with --input-rate=15/1
, also without success.
Running higher resolutions with the --debug
flag (and attempted --input-rate
) resulted in the following:
cmd: video-viewer --input-width=640 --input-height=480 --input-rate=15 --debug /dev/video1
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera -- attempting to create device v4l2:///dev/video1
(video-viewer:10683): GStreamer-CRITICAL **: 10:47:53.226: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
(video-viewer:10683): GStreamer-CRITICAL **: 10:47:53.227: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
(video-viewer:10683): GStreamer-CRITICAL **: 10:47:53.227: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
[gstreamer] gstCamera -- found v4l2 device: USB 2.0 PC Cam
[gstreamer] v4l2-proplist, device.path=(string)/dev/video1, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)uvcvideo, v4l2.device.card=(string)"USB\ 2.0\ PC\ Cam", v4l2.device.bus_info=(string)usb-70090000.xusb-2.3, v4l2.device.version=(uint)264588, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera -- found 6 caps for v4l2 device /dev/video1
[gstreamer] [0] video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)1024, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/2;
[gstreamer] [1] video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [2] video/x-raw, format=(string)YUY2, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [3] video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [4] video/x-raw, format=(string)YUY2, width=(int)176, height=(int)144, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] [5] video/x-raw, format=(string)YUY2, width=(int)160, height=(int)120, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 };
[gstreamer] gstCamera -- selected device profile: codec=raw format=yuyv width=640 height=480
[gstreamer] gstCamera pipeline string:
[gstreamer] v4l2src device=/dev/video1 ! video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480 ! appsink name=mysink
[gstreamer] gstCamera successfully created device v4l2:///dev/video1
[video] created gstCamera from v4l2:///dev/video1
------------------------------------------------
gstCamera video options:
------------------------------------------------
-- URI: v4l2:///dev/video1
- protocol: v4l2
- location: /dev/video1
- port: 1
-- deviceType: v4l2
-- ioType: input
-- codec: raw
-- width: 640
-- height: 480
-- frameRate: 30.000000
-- bitRate: 0
-- numBuffers: 4
-- zeroCopy: true
-- flipMethod: none
-- loop: 0
------------------------------------------------
[OpenGL] glDisplay -- X screen 0 resolution: 1920x1080
[OpenGL] glDisplay -- X window resolution: 1920x1080
[OpenGL] glDisplay -- display device initialized (1920x1080)
[video] created glDisplay from display://0
------------------------------------------------
glDisplay video options:
------------------------------------------------
-- URI: display://0
- protocol: display
- location: 0
-- deviceType: display
-- ioType: output
-- codec: raw
-- width: 1920
-- height: 1080
-- frameRate: 0.000000
-- bitRate: 0
-- numBuffers: 4
-- zeroCopy: true
-- flipMethod: none
-- loop: 0
------------------------------------------------
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> v4l2src0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> v4l2src0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0
[gstreamer] gstreamer message stream-start ==> pipeline0
video-viewer: failed to capture video frame
video-viewer: failed to capture video frame
video-viewer: failed to capture video frame
video-viewer: failed to capture video frame
^Creceived SIGINT
video-viewer: failed to capture video frame
video-viewer: shutting down...
[gstreamer] gstCamera -- stopping pipeline, transitioning to GST_STATE_NULL
[gstreamer] gstCamera -- pipeline stopped
video-viewer: shutdown complete
So I think we are getting somewhere. Any thoughts why the --input-rate
parameter does not get fed through? I am not quite sure which file in which package requires modification for this, video-source.cpp or video-options.cpp? What do you think?
Kind regards
Nico