Hi.
I’m trying to write a program that support screencasting with dmabuf source. I’m using niri as the WM, which use gnome’s screencast portal, for some reason pipewire can only give dmabuf screencast data, with BGRx(XR24) format, and the DRM modifier is something like 0x030000000060601x (or 0x0300000000e0801x), which is nvidia’s block linear drm format.
I’m trying to use the following pipeline, to download it to system memory:
GST_GL_PLATFORM=egl GST_DEBUG=pipewiresrc:9,gl*:9,DEFAULT:3 gst-launch-1.0 pipewiresrc ! 'video/x-raw(memory:DMABuf),format=DMA_DRM,drm-format=XR24:0x300000000606015' ! glupload ! 'video/x-raw(memory:GLMemory)' ! glcolorconvert ! 'video/x-raw(memory:GLMemory),format=BGRA' ! gldownload ! 'video/x-raw,format=BGRA' ! fakesink
but it shows error:
WARNING: erroneous pipeline: could not link gluploadelement0 to glcolorconvertelement0, gluploadelement0 can't handle caps video/x-raw(memory:GLMemory)
the full log is
❯ sh ./test.sh
0:00:00.018832590 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:3032:gst_gl_upload_new:<glupload0> Created new GLUpload for context (NULL)
0:00:00.018849404 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:475:_gl_memory_upload_transform_caps:<glupload0> direction src, transformed video/x-raw(ANY) into video/x-raw(memory:GLMemory); video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition)
0:00:00.018883236 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1513:_direct_dma_buf_upload_transform_caps:<glupload0> direction src, transformed video/x-raw(ANY) into video/x-raw(memory:DMABuf), format=(string)DMA_DRM; video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition), format=(string)DMA_DRM
0:00:00.018906989 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1499:_direct_dma_buf_upload_transform_caps:<glupload0> direction src, fails to transformed DMA caps video/x-raw(ANY)
0:00:00.018911726 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1095:_dma_buf_upload_transform_caps:<glupload0> direction src,
transformed video/x-raw(ANY)
into video/x-raw(memory:DMABuf), format=(string)DMA_DRM; video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition), format=(string)DMA_DRM
0:00:00.018968339 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:475:_gl_memory_upload_transform_caps:<glupload0> direction src, transformed video/x-raw(ANY) into video/x-raw(memory:GLMemory); video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition)
0:00:00.018997229 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1513:_direct_dma_buf_upload_transform_caps:<glupload0> direction src, transformed video/x-raw(ANY) into video/x-raw(memory:DMABuf), format=(string)DMA_DRM; video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition), format=(string)DMA_DRM
0:00:00.019020732 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1499:_direct_dma_buf_upload_transform_caps:<glupload0> direction src, fails to transformed DMA caps video/x-raw(ANY)
0:00:00.019025067 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1095:_dma_buf_upload_transform_caps:<glupload0> direction src,
transformed video/x-raw(ANY)
into video/x-raw(memory:DMABuf), format=(string)DMA_DRM; video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition), format=(string)DMA_DRM
0:00:00.019084744 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019091411 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019096492 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1053:_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019102839 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:2069:_raw_data_upload_drm_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019115986 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019121350 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019126372 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1053:_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019133517 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:2069:_raw_data_upload_drm_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019146903 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019152329 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019157278 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1053:_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019163381 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:2069:_raw_data_upload_drm_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019359509 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019364409 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1446:_direct_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019369571 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:1053:_dma_buf_upload_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019375599 989853 0x564ba77f9930 DEBUG glupload gstglupload.c:2069:_raw_data_upload_drm_transform_caps:<glupload0> direction sink, fails to transformed DMA caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, drm-format=(string)XR24:0x300000000606015, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019634331 989853 0x564ba77f9930 DEBUG gldownloadelement gstgldownloadelement.c:1096:gst_gl_download_element_transform_caps:<gldownloadelement0> returning caps video/x-raw(memory:GLMemory); video/x-raw
0:00:00.019720718 989853 0x564ba77f9930 DEBUG gldownloadelement gstgldownloadelement.c:1096:gst_gl_download_element_transform_caps:<gldownloadelement0> returning caps video/x-raw(memory:GLMemory); video/x-raw
0:00:00.019824260 989853 0x564ba77f9930 DEBUG gldownloadelement gstgldownloadelement.c:1096:gst_gl_download_element_transform_caps:<gldownloadelement0> returning caps video/x-raw(memory:GLMemory), format=(string)BGRA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, rectangle, external-oes }; video/x-raw(memory:DMABuf), format=(string)DMA_DRM, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string)BGRA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.019924267 989853 0x564ba77f9930 DEBUG gldownloadelement gstgldownloadelement.c:1096:gst_gl_download_element_transform_caps:<gldownloadelement0> returning caps video/x-raw(memory:GLMemory), format=(string)BGRA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, rectangle, external-oes }; video/x-raw(memory:DMABuf), format=(string)DMA_DRM, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string)BGRA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.020024289 989853 0x564ba77f9930 DEBUG gldownloadelement gstgldownloadelement.c:1096:gst_gl_download_element_transform_caps:<gldownloadelement0> returning caps video/x-raw(memory:GLMemory), format=(string)BGRA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, rectangle, external-oes }; video/x-raw(memory:DMABuf), format=(string)DMA_DRM, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string)BGRA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
WARNING: erroneous pipeline: could not link gluploadelement0 to glcolorconvertelement0, gluploadelement0 can't handle caps video/x-raw(memory:GLMemory)
System info: archlinux, with gstreamer version 1.26.7. I also found this mr, but I don’t know if the problem it fixed appears in 1.26.7 already.
I know this drm setting can work with vulkan, and I tested egl indeed accept this format with modifier without external-only, using `eglQueryDmaBufModifiersEXT`. I’m really confused about where could be wrong. Really appreciated your help please!