Tool/software:
Hi,
We're facing some difficulties with our video pipeline.
we set video format using " v4l2-ctl -d /dev/video3 --set-fmt-video=width=1280,height=720,pixelformat=UYVY " command, but when we run the pipeline as " gst-launch-1.0 -v v4l2src device=/dev/video3 ! videoconvert ! autovideosink " it overwrites our previous configuration, as show bellow in the example.
root@am62pxx-evm:~# v4l2-ctl -d /dev/video3 --set-fmt-video=width=1280,height=720,pixelformat=UYVY root@am62pxx-evm:~# v4l2-ctl -d /dev/video3 --get-fmt-video Format Video Capture: Width/Height : 1280/720 Pixel Format : 'UYVY' (UYVY 4:2:2) Field : None Bytes per Line : 2560 Size Image : 1843200 Colorspace : Rec. 709 Transfer Function : Rec. 709 YCbCr/HSV Encoding: Rec. 709 Quantization : Limited Range Flags : root@am62pxx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video3 ! videoconvert ! autovideosink Setting pipeline to PAUSED ... warning: queue 0xffff8c000be0 destroyed while proxies still attached: xdg_wm_base@7 still attached wl_seat@6 still attached wl_subcompositor@5 still attached wl_compositor@4 still attached wl_registry@2 still attached Pipeline is live and does not need PREROLL ... Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0"; Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, format=(string)YVYU, interlace-mode=(string)progressive, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)Y42B, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)Y42B, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage.GstGhostPad:sink.GstProxyPad:proxypad1: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)Y42B, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLUploadElement:gluploadelement0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)RGBA, texture-target=(string)2D /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLColorConvertElement:glcolorconvertelement0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)RGBA, texture-target=(string)2D /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLColorBalance:glcolorbalance0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)RGBA, texture-target=(string)2D /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)RGBA, texture-target=(string)2D /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLColorBalance:glcolorbalance0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)RGBA, texture-target=(string)2D /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLColorConvertElement:glcolorconvertelement0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)RGBA, texture-target=(string)2D /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLUploadElement:gluploadelement0.GstPad:sink: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)Y42B, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage.GstGhostPad:sink: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)Y42B, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, format=(string)Y42B, colorimetry=(string)bt709 /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, format=(string)YVYU, interlace-mode=(string)progressive, colorimetry=(string)bt709 ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. Additional debug info: /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2src.c(950): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Buffer pool activation failed Execution ended after 0:00:00.061778235 Setting pipeline to NULL ... ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. Additional debug info: /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) warning: queue 0xffff8c04fd30 destroyed while proxies still attached: xdg_wm_base@13 still attached wl_seat@12 still attached wl_subcompositor@8 still attached wl_compositor@11 still attached wl_registry@14 still attached Freeing pipeline ... root@am62pxx-evm:~# v4l2-ctl -d /dev/video3 --get-fmt-video Format Video Capture: Width/Height : 3840/2160 Pixel Format : 'YVYU' (YVYU 4:2:2) Field : None Bytes per Line : 7680 Size Image : 16588800 Colorspace : Rec. 709 Transfer Function : Rec. 709 YCbCr/HSV Encoding: Rec. 709 Quantization : Limited Range Flags :
Hello Sergio,
I believe gst-launch-1.0 changed the format of the video device node. If you do the following,
gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw, width=1280, height=720,format=UYVY
I believe you should have the same format as set by the v4l2-ctl command.
Regards,
Jianzhong
Hello Jianzhong,
Yes you are correct, but we're using a Qt application to control the camera, and qt pipeline uses something near that pipeline.
"gst-launch-1.0 v4l2src device=/dev/video3 ! autovideosink"
so every time that we ran the program it reconfigure video format. Do you know any way to prevent that from happening?
Regards,
Can you try to use "media-ctl" to set the format? For example github.com/.../setup_camera_ox05b.sh