i am using Xvfb for starting X server on display 1 and x11vnc is also set for -display :1 along with fluxbox as window manager on Ubuntu 20.04 LTS like using below commands
sudo -i -u ubuntu Xvfb :1 +extension GLX -screen 0 1440x1080x16 -ac
sudo -i -u ubuntu DISPLAY=:1 fluxbox
sudo -i -u ubuntu x11vnc -forever -display :1
and when I run command:
ffmpeg -video_size 1440x1080 -framerate 25 -f x11grab -i :1.0 -c:v libx264rgb -crf 0 -preset ultrafast sample.mp4
it runs, however when i execute programmatically through processbuilder i see that in output buffer stream log file as :1: Invalid argument and doesn't start recording,
Command sent to processBuilder is like below:
pb = new ProcessBuilder(ffmpegLocation,
"-video_size", "1440x1080x16",
"-f", "x11grab",
"-i", ":1",
"-c:v libx264 -crf 0 -preset ultrafast",
"-framerate","25",
outputfilepath());
-FYI I have tried setting environmental variable as export DISPLAY=:1
, but still the same error and also do I need to set the DISPLAY=:1
, since i am setting up display number when I start Xvfb? This used to work using avconv on older version of Ubuntu but I am stuck on display issue for ffmpeg, anyone has idea how to resolve this?