From c11306c5fdc7a772aad4063ee08a0bb413ae8e4b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 11 Nov 2024 00:06:29 +0100 Subject: Add --list-capture-options option --- README.md | 7 +++++- TODO | 5 +--- src/main.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 78 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3379c06..1ccbbad 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,12 @@ There is also a new alternative UI for GPU Screen Recorder in the style of Shado ## Recording Here is an example of how to record your monitor and the default audio output: `gpu-screen-recorder -w screen -f 60 -a default_output -o ~/Videos/test_video.mp4`. Yyou can stop and save the recording with `Ctrl+C` or by running `killall -SIGINT gpu-screen-recorder`. -You can see a list of monitor names to record if you use an invalid monitor name, for example: `gpu-screen-recorder -w invalid -f 60 -o video.mp4`. +You can see a list of capture options to record if you run `gpu-screen-recorder --list-capture-options`. This will list possible capture options and monitor names, for example:\ +``` + window + DP-1|1920x1080 +``` +in this case you could record a window or a monitor with the name `DP-1`. ## Streaming Streaming works the same as recording, but the `-o` argument should be path to the live streaming service you want to use (including your live streaming key). Take a look at `scripts/twitch-stream.sh` to see an example of how to stream to twitch. ## Replay mode diff --git a/TODO b/TODO index cee04ac..2abd451 100644 --- a/TODO +++ b/TODO @@ -186,9 +186,6 @@ Support surround audio in application audio recording. Right now only stereo sou Support application audio recording without pulseaudio combined sink. -If recording application audio setup gsr_pipewire_audio and add gsr_pipewire_audio_add_link_from_app_to_stream for application and the created combined sink. - Use gsr_pipewire_audio_add_link_from_app_to_stream_inverted for inverted scenario. Parse inverted scenario as well. - Support transposing (rotating) with vaapi. This isn't supported on many devices with rgb buffer, but its supported with nv12 buffer (on intel at least). -Link name for stream_name input is wrong. It should be Playback_FL/Playback_FR now with combined sink. Add function for combined sink, or rewrite existing code. \ No newline at end of file +Cleanup pipewire_audio.c (proper error handling and memory cleanup of proxies). \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index b5c5a72..d256b1b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1081,9 +1081,12 @@ static void usage_full() { fprintf(stderr, " If this is \"portal\" then xdg desktop screencast portal with PipeWire will be used. Portal option is only available on Wayland.\n"); fprintf(stderr, " If you select to save the session (token) in the desktop portal capture popup then the session will be saved for the next time you use \"portal\",\n"); fprintf(stderr, " but the session will be ignored unless you run GPU Screen Recorder with the '-restore-portal-session yes' option.\n"); - fprintf(stderr, " If this is \"screen\" or \"screen-direct-force\" then all monitors are recorded on Nvidia X11. On AMD/Intel or wayland \"screen\" will record the first monitor found.\n"); - fprintf(stderr, " \"screen-direct-force\" is not recommended unless you use a VRR (G-SYNC) monitor on Nvidia X11 and you are aware that using this option can cause games to freeze/crash or other issues because of Nvidia driver issues.\n"); + fprintf(stderr, " If this is \"screen\" or \"screen-direct-force\" then all monitors are recorded on Nvidia X11.\n"); + fprintf(stderr, " On AMD/Intel or wayland \"screen\" will record the first monitor found.\n"); + fprintf(stderr, " \"screen-direct-force\" is not recommended unless you use a VRR (G-SYNC) monitor on Nvidia X11 and you are aware that using this option can cause\n"); + fprintf(stderr, " games to freeze/crash or other issues because of Nvidia driver issues.\n"); fprintf(stderr, " \"screen-direct-force\" option is only available on Nvidia X11. VRR works without this option on other systems.\n"); + fprintf(stderr, " Run GPU Screen Recorder with the --list-capture-options to list valid values for this option.\n"); fprintf(stderr, "\n"); fprintf(stderr, " -c Container format for output file, for example mp4, or flv. Only required if no output file is specified or if recording in replay buffer mode.\n"); fprintf(stderr, " If an output file is specified and -c is not used then the container format is determined from the output filename extension.\n"); @@ -1200,6 +1203,15 @@ static void usage_full() { fprintf(stderr, " Supported capture options (window, focused, screen, monitors and portal, if supported by the system).\n"); fprintf(stderr, " If opengl initialization fails then the program exits with 22, if no usable drm device is found then it exits with 23. On success it exits with 0.\n"); fprintf(stderr, "\n"); + fprintf(stderr, " --list-capture-options\n"); + fprintf(stderr, " List available capture options. Lists capture options in the following format (prints them to stdout and exits):\n"); + fprintf(stderr, "