Gstreamer capturing virtual display

Hi,
I am working on a project where I run multiple virtual displays on Jetson Nano 2GB and each to be captured and streamed using gstreamer. (I am having HDMI monitor connected, and working directly with the board for now.)

I managed to make Xvfb working but following set of commands fails:

Terminal 1

Xvfb :1 -screen 0 640x480x16

Terminal 2

export DISPLAY=:1
gst-launch-1.0 -q ximagesrc ! nvvidconv ! fakesink

nvbuf_utils: Could not get EGL display connection
WARNING: erroneous pipeline: could not link ximagesrc0 to nvvconv0

The same command works ok when using DISPLAY=:0. I can also confirm DISPLAY 1 works, I can launch apps on it and make screenshots using:

DISPLAY=:1 import -window root ~/Desktop/screenshot.png

Any idea how to proceed from here? How can I create multiple virtual displays and capture content with gstreamer…

Hi,
Is your X server on DISPLAY 1 or 0? Looks like it is on 0 so that you can run the gstreamer pipeline successfully.

The nvvidconv plugin is based on NvBuffer APIs. It is part of jetson_multiemdia_api. For more information, could you set export DISPLAY=:1 and see if you can run the sample:

/usr/src/jetson_multimedia_api/samples/00_video_decode

Hi DaneLLL,

thanks for your response. Seems I need to provide little more details to better explain my case.

X server is on DISPLAY 0 and I can successfully use gstreamer there, it all works ok. But that is not my concern.

What I need for my project is to programmatically activate additional virtual monitors with variable resolutions, launch programs on it and use gstreamer to capture.

My idea was to use Xvfb, but that doesnt seem working (EGL error). Do you have any idea how can I programmatically create additional virtual monitors?

I ended up using single X server artificially resized beyond monitor size (xrandr --fb ...), launching apps positioned outside the visible area and capturing with gstreamer using startx/endx coordinates.