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.
- Signals:
"recording_started" (): Emitted when recording starts.
"recording_stopped" (): Emitted when recording stops.
- Properties:
active (
bool, read-write): Whether recording is currently active.is_paused (
bool, read-write): Whether recording is currently paused.bitrate (
int, read-write, default: 8000): The bitrate of the recording.default_file_location (
str, read-write, default:"$HOME/Videos"): Default location for saving recordings.default_filename (
str, read-write, default:"%Y-%m-%d_%H-%M-%S.mp4"): Default filename for recordings. Supports time formating.
- Raises:
GstNotFoundError -- If GStreamer is not found.
GstPluginNotFoundError -- If GStreamer plugin is not found.
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)
- 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, optional) -- Recording path. It will overridedefault_file_locationanddefault_filenameproperties.record_microphone (
bool, optional) -- Whether record audio from microphone.record_internal_audio (
bool, optional) -- Whether record internal audio.audio_devices (
list[str], optional) -- A list of audio devices names from which audio should be recorded.
- stop_recording() None#
Stop recording.
- pause_recording() None#
Pause recording. This has an effect only if the recording is active and not already paused.
- continue_recording() None#
Continue recording. This has an effect only if the recording is active and paused.