Recording only one window in Gnomes 3 default desktop recorder

9

7

Gnome 3 has great feature under Ctrl-Alt-Shift-R shortcut1. I guess this is Istanbul. It appears that it's not istanbul... Yet I can't find any info about this program.

Where can I find man page? How can I run it from console?
And most importantly: How can I record only one window (similar to Alt+Print Screen)?

seler

Posted 2012-05-14T06:48:49.437

Reputation: 303

I suppose you have already tried man istanbul?

– user1686 – 2012-05-14T08:04:08.727

@grawity: I tried running man istanbul but there were no pages for istanbul. Also there is no istanbul command available. Maybe Gnome 3 default recorder is not istanbul? What is it then? – seler – 2012-05-14T11:29:42.560

Answers

13

According to GNOME API doc, the gnome-shell (shell-recorder class) screen recorder is basically pipeline all screenshot output to a pipeline which is then encoded by GStreamer.

You can use your dconf-editor application and navigate to org.gnome.shell.recorder, in this schema you will find 3 options:

  • file-extension - default on my box to webm
  • framerate - defauly on my box to 30
  • pipeline - which default to pipeline to GStreamer vp8enc for encoding the stream. vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux

So how could we replicate the recording pipeline on command line? We could do so with the gstreamer-tool's gst-launch command. Firstly, you need to install gst-tools on your box and you can start playing with gstreamer!. Here are few examples:

Record to webm (vp8 video & vorbis audio):

gst-launch ximagesrc ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=2 ! mux. alsasrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmux name=mux ! filesink location=screencast.webm

Press Ctrl+C to stop the recording.

Record to ogv (theora video & vorbis audio):

gst-launch ximagesrc ! ffmpegcolorspace ! queue ! theoraenc ! mux. alsasrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. oggmux name=mux ! filesink location=screencast.ogv

Press Ctrl+C to stop the recording.

The pipelines are executed by gst-launch. Here's what they do:

  • Grab the X video image (the desktop)
  • Automatically convert the video to an acceptable format
  • Spawn a background thread [t1] to continue video processing
  • [t1] Encode the video (either to vp8 or theora)
  • [t1] Prep for merging the video into the video shell (webm or ogg)
  • Grab the audio input as raw (the microphone)
  • Spawn a background thread [t2] to continue audio processing
  • [t2] Automatically convert the audio to an acceptable format
  • [t2] Encode the audio to vorbis
  • [t2] Prep for merging the audio into the video shell (webm or ogg)
  • Write encoded audio and video into the video file

Now, you don't have to be scared of gstreamer pipelines anymore! \o/

Trung Lê

Posted 2012-05-14T06:48:49.437

Reputation: 246

8

And most importantly. How can I record only one window?

If you can get the XID of the window, you can pass it to ximagesrc. E.g., if you know what the unique title of the Window is, you can use xwininfo and a little magic to get that. In bash:

TITLE="Terminal Six"
WINDOW_XID=$(xwininfo -tree -root -all | egrep $TITLE | sed -e 's/^ *//' | cut -d\  -f1)`

Now you can just pass that XID to ximagesrc, and of course, finish out the pipeline:

gst-launch-1.0 ximagesrc xid=$WINDOW_XID ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! ...

And FYI, I'm showing you this using the 1.0 version of gstreamer. There is no more ffmpegcolorspace, you use videoconvert instead (latest versions of FFmpeg have had a name change to 'libav' so it's been renamed).

milli

Posted 2012-05-14T06:48:49.437

Reputation: 81

0

Gnome 3 recording uses GStreamer FFmpeg plug-in to output a .webm under user's home.

GStreamer FFmpeg plug-in

http://gstreamer.freedesktop.org/modules/gst-ffmpeg.html

And most importantly: How can I record only one window?

May be zoom the window to fullscreen ?

Rony

Posted 2012-05-14T06:48:49.437

Reputation: 180

What I mean is that I want my video to has resolution of the window I'm recording. Also, I don't need to show others my current time, notifications, network status, volume level etc. edit: Similar to <kbd>Alt</kbd>+<kbd>Print Screen</kbd> – seler – 2012-05-14T12:27:19.600

The gnome3 built-in recording is very limited and even no sound that made me feel like it is for casual usage. There is recordMyDesktop and on the other hand ffmpeg script in Archlinux forum. To me, they all work better than Gnome3's.

– Rony – 2012-05-14T15:51:13.277