0

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=

  • 1
    Are you referring to a Microsoft Windows application, or a Linux application and you're having trouble getting FFMPEG to capture its window? Can you provide more detail on your situation? – fixer1234 May 13 at 6:20
  • 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= – Yove May 13 at 7:30
1

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.

  • Please re-read the question, I know that x11 cannot capture window, the question is whether it is possible to capture a specific window, not the screen area – Yove May 14 at 8:26
  • @Yove Your question did not elaborate this. New answer added. – llogan May 14 at 17:28
0

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.

  • Do not know if there are any other ways to do it? Thank you in advance – Yove May 15 at 15:03
  • @Yove No, I am not aware of any other ways. – llogan May 15 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.