Recently moved from JP3.3 to JP4.2.1 and have an analog video capture card with custom driver in my TX2 system. In 3.3 there were no issues capturing the analog video, but in 4.2.1 I get this error when launching GStreamer-
gst-launch-1.0 v4l2src device="/dev/video100" ! 'video/x-raw, width=(int)704, height=(int)480, format=(string)UYVY' ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video100' has no supported format
Additional debug info:
gstv4l2object.c(3760): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Call to S_FMT failed for UYVY @ 704x480: Invalid argument
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
I started debugging and found that using a different format gives a different error, in this case YUYV instead of UYVY:
WARNING: erroneous pipeline: could not link v4l2src0 to fakesink0, v4l2src0 can't handle caps video/x-raw, width=(int)704, height=(int)480, format=(string)YUYV
However, using v4l2-ctl I can capture the video in either YUYV or UYVY with a command like this
v4l2-ctl --stream-mmap --stream-count=100 -d /dev/video100 --set-fmt-video=width=704,height=480,pixelformat=UYVY --stream-to=test.raw
Then play the video back using ffmpeg and the video plays fine and looks normal
ffplay -f rawvideo -video_size 704x480 -framerate 30 -pixel_format yuyv422 test-uyuv.raw
In fact I can use FFMPEG to capture the video directly to mpeg and it looks fine
ffmpeg -f video4linux2 -i /dev/video100 test.mpeg
Something about GStreamer v1.14 or the Nvidia gst plugins must have changed since V4L appears to work fine. I have tried many video caps, resolutions, and pixel formats and always get one of the two errors above. Can anyone offer suggestions on how to debug further?
Thank you,
Andy