Capture a video of a given X Window with gstreamer.
xwininfo
The window ID will look something like:
xwininfo: Window id: 0x60000f "xterm"
From the gstreamer ximagesrc
documentation (update the window ID as necessary):
gst-launch-1.0 ximagesrc xid=0x60000f ! video/x-raw,framerate=5/1 ! videoconvert ! theoraenc ! oggmux ! filesink location=desktop.ogg
gst-launch-1.0 ximagesrc xid=0x60000f ! video/x-raw,framerate=5/1 ! videoconvert ! queue ! x264enc pass=5 quantizer=26 speed-preset=6 ! mp4mux fragment-duration=500 ! filesink location="capture.mp4"
Convert this to a bash script.