I’m investigating the v4l2 video capture with the gstreamer.
I can get the image with the following pipeline.
DISPLAY=:0.0 gst-launch-1.0 v4l2src device=/dev/video0 -e ! ‘video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080’ ! xvimagesink sync=false
But I’d like to process its image data as NVMM RGBA format data on appsink.
So I tried the following pipeline.
DISPLAY=:0.0 gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080’ ! videoconvert ! ‘video/x-raw, format=(string)I420, width=1920, height=1080’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=RGBA, widht=1920, height=1080’ ! nvoverlaysink sync=false -v
But it failed as follows.
What should I do ?
DISPLAY=:0.0 gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080’ ! videoconvert ! ‘video/x-raw, format=(string)I420, width=1920, height=1080’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=RGBA, widht=1920, height=1080’ ! nvoverlaysink sync=false -v
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, colorimetry=(string)bt709, interlace-mode=(string)progressive
Setting pipeline to PLAYING …
New clock: GstSystemClock
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, colorimetry=(string)bt709, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YV12, width=(int)1920, height=(int)1080, widht=(int)1920, framerate=(fraction)60000/1001, colorimetry=(string)bt709, interlace-mode=(string)progressive
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)
Execution ended after 0:00:00.660372288
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …