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/