2

I'm using the following command to render a video of a chrome browser running inside a virtual frame buffer (using xvfb):

ffmpeg -f x11grab -i :5 -s `DISPLAY=:5 xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 30 tests.mpg

When I omit the DISPLAY=:5 xdpyinfo | grep 'dimensions:'|awk '{print $2}', it will render at about 1024x768, so I invoked xdpyinfo to get the resolution of the display and tell ffmpeg about it.

But when I use the command, it shows the same cropped area, only stretched to fit the resolution I gave ffmpeg.

I would like to be able to record the whole virtual frame buffer without cropping or stretching. Is there a way to do so?

I have compiled ffmpeg from source just this morning, running v2.8.git

Jeff Huijsmans
  • 1,388
  • 1
  • 14
  • 35

1 Answers1

4

The arguments that come after -i control the output, not the input.

To set the source resolution use -video_size with the xdpyinfo output before the -i. For the framerate use -framerate.

The format for the x11grab input is [hostname]:display_number.screen_number[+x_offset,y_offset].

ffmpeg -video_size `DISPLAY=:5 xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -framerate 30 -f x11grab -i :5.0+0,0 output.mpg

Check the docs and the guide: https://trac.ffmpeg.org/wiki/Capture/Desktop

aergistal
  • 29,947
  • 5
  • 70
  • 92