-1

I use ffmpeg on an Intel Nuc with Xubuntu 22.04 (XFCE4, lightdm), with x11grab for screen capturing the desktop, and sending output to a multicast UDP stream (which is shown on different IPTV sets in the network). The system uses autologin, and autostarts Firefox in kiosk mode, rendering a html5 video.

Everything works fine when a display is attached, but from the moment the hdmi cable is detached, the output video is extremely slow (very shaky, looks like 1 fps, audio is OK although it has occasional hickups).

CPU and memory usage doesn't seem to be affected whether a display is attached or not.

This runs fine on Xubuntu 18.04, although there might be small config changes that I'm not aware of.

To be able to display output when no display is attached, I created a VIRTUAL1 display:

xrandr -d :0 --verbose --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr -d :0 --verbose --addmode VIRTUAL1 "1920x1080_60.00"

my /usr/share/X11/xorg.conf.d/20-intel.conf looks like:

Section "Device"
  Identifier "Intel Graphics"
  Driver "intel"
  Option "VirtualHeads" "1"
  Option "TearFree" "true"
  Option "TripleBuffer" "true"
  Option "DRI" "false"
EndSection

The ffmpeg command:

ffmpeg -r 25 -thread_queue_size 512 -f x11grab -s 1920x1080 -i :0 -thread_queue_size 512 -f alsa -i default -c:a mp2 -f mpegts udp://239.255.255.8:50000?pkt_size=1316

EDIT: I guess this is not really ffmpeg related, since when I connect with vnc to the machine, the same happens: with display connected: everyhting OK. Without display connected: slow, shaky video. So it must be a GPU driver thingy

fre_der
  • 83
  • 10

1 Answers1

0

I had to disable the compositor like this:

xfconf-query -c xfwm4 -p /general/use_compositing -s false

I found the answer in a comment (by user @pim) of an answer in this thread

https://askubuntu.com/questions/950252/x11vnc-headless-on-ubuntu-is-very-slow-until-monitor-connected
fre_der
  • 83
  • 10