Recorder#

class ignis.services.recorder.RecorderService(*args: Any, **kwargs: Any)#

A screen recorder. Uses XDG Desktop portal and PipeWire. Allow record screen with microphone audio and internal system audio.

Dependencies:
  • GStreamer

  • PipeWire

  • gst-plugin-pipewire

  • gst-plugins-good

  • gst-plugins-ugly

  • pipewire-pulse: for audio recording.

Raises:

Example usage:

from ignis.services.recorder import RecorderService
from ignis.utils import Utils

recorder = RecorderService.get_default()

recorder.start_recording(record_internal_audio=True)

# record for 30 seconds and then stop
Utils.Timeout(ms=30 * 1000, target=recorder.stop_recording)
recording_started()#
  • Signal

Emitted when recording starts.

recording_stopped()#
  • Signal

Emitted when recording stops.

property active: bool#
  • read-only

Whether recording is currently active.

property is_paused: bool#
  • read-only

Whether recording is currently paused.

property bitrate: int#
  • read-write

The bitrate of the recording.

Default: 8000

property default_file_location: str#
  • read-write

The default location for saving recordings.

Default: $HOME/Videos.

property default_filename: str#
  • read-write

The default filename for recordings. Supports time formating.

Default: %Y-%m-%d_%H-%M-%S.mp4

start_recording(path: str | None = None, record_microphone: bool = False, record_internal_audio: bool = False, audio_devices: list[str] | None = None) None#

Start recording.

Parameters:
  • path (str | None, default: None) -- Recording path. It will override default_file_location and default_filename properties.

  • record_microphone (bool, default: False) -- Whether record audio from microphone.

  • record_internal_audio (bool, default: False) -- Whether record internal audio.

  • audio_devices (list[str] | None, default: None) -- A list of audio devices names from which audio should be recorded.

Return type:

None

stop_recording() None#

Stop recording.

Return type:

None

pause_recording() None#

Pause recording. This has an effect only if the recording is active and not already paused.

Return type:

None

continue_recording() None#

Continue recording. This has an effect only if the recording is active and paused.

Return type:

None