3

I can start the xvfb instance just fine

Xvfb :1 -screen 0 800x600x24

I can then launch firefox and have it load correctly but the window is always smaller than the resolution I set during the xvfb command.

firefox http://www.ebay.com --display=:1

enter image description here

You can see the black bar, that's the full resolution. It appears it's sizing to what the page wants but it will never fill it out completely.

Ryan Detzel
  • 3,251

3 Answers3

3

Here is a solution, not pretty but works. Uses xdotool to set size after Firefox is running.

First:

xdotool search --onlyvisible firefox

This will display a single window ID, windowid. Then:

xdotool windowmove windowid 0 0
xdotool windowsize windowid 1280 720

You must first do the windowmove and follow it by the windowsize.

In some cases once I did this, the size and position were correct forever more, in other cases had to run again each time I ran Firefox.

Seth
  • 59,332
sbakke
  • 31
1

Assume the border is there and compensate accordingly in your capture. If you need 1024x768, then set the screen size to 1034x778 and capture 1024x768

Xvfb :1 -screen 0 1034x778x24 > /dev/null &
ffmpeg -t 1 -s 1024x768 -f x11grab -i :1.0+10,10 -f mjpeg screenshot.png
0

I've run into the same issue and solved it by setting the resolution as arguments (to the same I used for Xvfb) when starting the browser.

Chrome

--window-size=1024,768

Firefox

--width=1024 --height=768

seasick
  • 256