[FFmpeg-user] How would you record a single window's video and audio on Linux?

Moritz Barsnick barsnick at gmx.net
Wed Jul 6 10:55:00 CEST 2016


On Tue, Jul 05, 2016 at 23:50:23 -0400, John Lewis wrote:
> How would you record a single window's video and audio on Linux? I
> usually see things in an x11 window and hear things via pulseaudio.

There's some nice documentation here:
https://trac.ffmpeg.org/wiki/Capture/Desktop

If ffmpeg is compiled with x11grab/xcbgrab, you can record a window by
giving its position:
https://www.ffmpeg.org/ffmpeg-devices.html#x11grab
This doesn't accept window names or IDs though (unlike other tools
might), and doesn't follow moving windows.

As for pulseaudio, documentation seems to be sparse, but it should be
possible to record from pulse. I believe I have done it. The wiki entry
quoted above does have an "alsa with pulse" example. It also depends on
whether you want to record a certain device (i.e. your microphone) or
the audio *output*. For the latter, you may need to use the pulse tools
to redirect that audio to a dedicated stream (or whatever it is called,
I don't remember). Sorry, this is vague and probably insufficient info.

Moritz


More information about the ffmpeg-user mailing list