## shell-recorder

shell-recorder — Record from a ClutterStage

## Functions

ShellRecorder * | shell_recorder_new ()
void | shell_recorder_set_framerate ()
void | shell_recorder_set_file_template ()
void | shell_recorder_set_pipeline ()
void | shell_recorder_set_draw_cursor ()
void | shell_recorder_set_area ()
gboolean | shell_recorder_record ()
void | shell_recorder_close ()
void | shell_recorder_pause ()
gboolean | shell_recorder_is_recording ()

## Properties

gboolean | draw-cursor | Read / Write
gchar * | file-template | Read / Write
gint | framerate | Read / Write
gchar * | pipeline | Read / Write
MetaScreen * | screen | Write
ClutterStage * | stage | Read / Write

## Types and Values

#define | SHELL_TYPE_RECORDER
| ShellRecorder

## Object Hierarchy

        GObject
        ╰── ShellRecorder

## Description

The ShellRecorder object is used to make recordings ("screencasts") of a ClutterStage. Recording is done via GStreamer. The default is to encode as a Theora movie and write it to a file in the current directory named after the date, but the encoding and output can be configured.

## Functions

### shell_recorder_new ()

    ShellRecorder *
    shell_recorder_new (ClutterStage *stage);

Create a new ShellRecorder to record movies of a ClutterStage

#### Parameters

stage | The ClutterStage |

#### Returns

The newly created ShellRecorder object

### shell_recorder_set_framerate ()

    void
    shell_recorder_set_framerate (ShellRecorder *recorder,
                                  int framerate);

Sets the number of frames per second we try to record. Less frames will be recorded when the screen doesn't need to be redrawn this quickly. (This value will also be set as the framerate for the GStreamer pipeline; whether that has an effect on the resulting video will depend on the details of the pipeline and the codec. The default encoding to webm format doesn't pay attention to the pipeline framerate.)

The default value is 30.

#### Parameters

recorder | the ShellRecorder |
framerate | Framerate used for resulting video in frames-per-second. |

### shell_recorder_set_file_template ()

    void
    shell_recorder_set_file_template (ShellRecorder *recorder,
                                      const char *file_template);

Sets the filename that will be used when creating output files. This is only used if the configured pipeline has an unconnected source pad (as the default pipeline does). If the pipeline is complete, then the filename is unused. The provided string is used as a template.It can contain the following escapes:

`d`: The current date as YYYYYMMDD %%: A literal percent

The default value is 'shell-`d` `u`-`c`.ogg'.

#### Parameters

recorder | the ShellRecorder |
file_template | the filename template to use for output files, or `NULL` for the defalt value. |

### shell_recorder_set_pipeline ()

    void
    shell_recorder_set_pipeline (ShellRecorder *recorder,
                                 const char *pipeline);

Sets the GStreamer pipeline used to encode recordings. It follows the syntax used for gst-launch. The pipeline should have an unconnected sink pad where the recorded video is recorded. It will normally have a unconnected source pad; output from that pad will be written into the output file. (See `shell_recorder_set_file_template()`.) However the pipeline can also take care of its own output - this might be used to send the output to an icecast server via shout2send or similar.

The default value is 'vp9enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=`T` ! queue ! webmmux'

#### Parameters

recorder | the ShellRecorder |
pipeline | the GStreamer pipeline used to encode recordings or `NULL` for the default value. | [nullable]

### shell_recorder_set_draw_cursor ()

    void
    shell_recorder_set_draw_cursor (ShellRecorder *recorder,
                                    gboolean draw_cursor);

### shell_recorder_set_area ()

    void
    shell_recorder_set_area (ShellRecorder *recorder,
                             int x,
                             int y,
                             int width,
                             int height);

### shell_recorder_record ()

    gboolean
    shell_recorder_record (ShellRecorder *recorder,
                           char **filename_used);

Starts recording, Starting the recording may fail if the output file cannot be opened, or if the output stream cannot be created for other reasons. In that case a warning is printed to stderr. There is no way currently to get details on how recording failed to start.

An extra reference count is added to the recorder if recording is succesfully started; the recording object will not be freed until recording is stopped even if the creator no longer holds a reference. Recording is automatically stopped if the stage is destroyed.

#### Parameters

recorder | the ShellRecorder |
filename_used | actual filename used for recording. | [out][optional]

#### Returns

`TRUE` if recording was succesfully started

### shell_recorder_close ()

    void
    shell_recorder_close (ShellRecorder *recorder);

Stops recording. It's possible to call `shell_recorder_record()` again to reopen a new recording stream, but unless change the recording filename, this may result in the old recording being overwritten.

#### Parameters

recorder | the ShellRecorder |

### shell_recorder_pause ()

    void
    shell_recorder_pause (ShellRecorder *recorder);

### shell_recorder_is_recording ()

    gboolean
    shell_recorder_is_recording (ShellRecorder *recorder);

Determine if recording is currently in progress. (The recorder is not paused or closed.)

#### Returns

`TRUE` if the recorder is currently recording.

## Types and Values

### SHELL_TYPE_RECORDER

    #define SHELL_TYPE_RECORDER (shell_recorder_get_type ())

### ShellRecorder

    typedef struct _ShellRecorder ShellRecorder;

## Property Details

### The `“draw-cursor”` property

      “draw-cursor”              gboolean

Whether to record the cursor.

Flags: Read / Write

Default value: TRUE

### The `“file-template”` property

      “file-template”            gchar *

The filename template to use for output files.

Flags: Read / Write

Default value: NULL

### The `“framerate”` property

      “framerate”                gint

Framerate used for resulting video in frames-per-second.

Flags: Read / Write

Allowed values: >= 0

Default value: 30

### The `“pipeline”` property

      “pipeline”                 gchar *

GStreamer pipeline description to encode recordings.

Flags: Read / Write

Default value: NULL

### The `“screen”` property

      “screen”                   MetaScreen *

Screen to record.

Flags: Write

### The `“stage”` property

      “stage”                    ClutterStage *

Stage to record.

Flags: Read / Write