For addition, I can run this pipeline (I found from Internet)
gst-launch-1.0 v4l2src device="/dev/video0" name=e ! 'video/x-raw, width=640, height=480' ! videoconvert ! 'video/x-raw, width=640, height=480, format=(string)YUY2' ! xvimagesink
and popup a window showing the camera image
Also, I found something looks related (How to change source pixel format from YUYV to MJPG - #2 by DaneLLL). I tried the pipeline
$gst-launch-1.0 v4l2src ! videoconvert ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! xvimagesink
WARNING: erroneous pipeline: could not link nvvideoconvert0 to xvimagesink0, xvimagesink0 can't handle caps video/x-raw(memory:NVMM), format=(string)NV12
If I delete the (memory:NVMM)
as gst-launch-1.0 v4l2src ! videoconvert ! nvvideoconvert ! 'video/x-raw,format=NV12' ! xvimagesink
, I got error:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_mini_object_copy: assertion 'mini_object != NULL' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_structure_copy: assertion 'structure != NULL' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_structure_copy: assertion 'structure != NULL' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(gst-launch-1.0:24714): GStreamer-CRITICAL **: 10:31:54.621: gst_mini_object_ref: assertion 'mini_object != NULL' failed
Setting pipeline to PLAYING ...
New clock: GstSystemClock
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.003078642
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
If I change the NV12
to YUY2
:
gst-launch-1.0 v4l2src ! videoconvert ! nvvideoconvert ! 'video/x-raw,format=YUY2' ! xvimagesink
Window popup again to show the camera frame.
To be honest, I do not know much about the meaning of the parameter I typed above about the pipeline as I just copy and try with anything I saw… I hope this can also help to solve the problem.
Thxx a lot!!