Hi,
I have a GMSL2 camera and it’s working as /dev/video0:
v4l2-ctl -d /dev/video0 -V
Format Video Capture:
Width/Height : 3840/2160
Pixel Format : 'YUYV'
Field : None
Bytes per Line : 7680
Size Image : 16588800
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
Can I say its raw format is YUYV? (I’m not sure)
If I tested it with videoconvert
like this, it works:
gst-launch-1.0 -v v4l2src device=/dev/video0 !
'video/x-raw, width=3840, height=2160, format=YUY2, framerate=30/1' !
videoconvert !
'video/x-raw, width=3840, height=2160, format=BGRx, framerate=30/1' !
appsink caps='video/x-raw,format=BGRx' max-buffers=1
Please note that the first cap filter format is YUY2
because the test result show that YUYV
does not work, which seems to conflicts with v4l2-ctl -d /dev/video0 -V
result.
from the -v
log below, I can see it’s converted to BGRx
.
/GstPipeline:pipeline0/GstAppSink:appsink0.GstPad:sink: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)30/1, interlace-mode=(string)progressive, format=(string)BGRx
Now I want to use nvvidconv
to do the format convert to RGB/BGR or similar format, to use the hardware acceleration.
I replaced videoconvert
by nvvidconv
, but it does not work
gst-launch-1.0 -v v4l2src device=/dev/video0 !
'video/x-raw, width=3840, height=2160, format=YUY2, framerate=30/1' !
nvvidconv !
'video/x-raw, width=3840, height=2160, format=BGRx, framerate=30/1' !
appsink caps='video/x-raw,format=BGRx' max-buffers=1
I have run gst-inspect-1.0 nvvidconv
and verified that nvvidconv
supports YUY2
as source format and BGRx
as sink format.
I don’t know why nvvidconv
can’t replace videoconvert
.
Any mistake I have made?