1

I want to record a certain program window via FFMPEG, but x11 can't capture window. Is there some way to do it on Linux?

On Windows I can do this:

ffmpeg -f gdigrab -framerate 30 -i title="System Monitor" -b:v 3M test.flv

But how can I do the same window capture on Linux via title=System Monitor?

x11grab does not support title=

fixer1234
  • 28,064
Yove
  • 11

2 Answers2

3

There is no feature to capture specific windows with x11grab in ffmpeg, but you can manually provide the coordinates to do so.

Use xwininfo to get the geometry of the target window:

$ xwininfo
  Please select the window about which you would like
  information by clicking the mouse in that window.
  [...]
  -geometry 80x24-61-68

This translates to a command in ffmpeg that looks like:

ffmpeg -video_size 80x24 -f x11grab -i :0.0+61,68 output

The recording area is fixed, so if the window moves it can go outsize of the recording area. It is also not exclusive, so if another window covers the recording area then that will also get recorded.

llogan
  • 63,280
1

I know that x11 cannot capture window, the question is whether it is possible to capture a specific window, not the screen area

Currently not possible using ffmpeg in Linux.

llogan
  • 63,280