diff --git a/README.md b/README.md index d7632cc..7a8334f 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ You can see which variables that you can use in the `gpu-screen-recorder.env` fi You can use the `scripts/save-replay.sh` script to save a replay and by default the systemd service saves videos in `$HOME/Videos`. ## Run a script when a video is saved Run `gpu-screen-recorder` with the `-sc` option to specify a script that should be run when a recording/replay a saved, for example `gpu-screen-recorder -w screen -sc ./script.sh -o video.mp4`.\ -The first argument to the script is the file path to the saved video. The second argument is either "regular" for regular recordings and "replay" for replays.\ +The first argument to the script is the file path to the saved video. The second argument is either "regular" for regular recordings, "replay" for replays or "screenshot" for screenshots.\ This can be used to for example showing a notification with the name of video or moving a video to a folder based on the name of the game that was recorded. ## Plugins GPU Screen Recorder supports plugins for rendering additional graphics on top of the monitor/window capture. The plugin interface is defined in `plugin/plugin.h` and it gets installed to `gsr/plugin.h` in the systems include directory (usually `/usr/include`). diff --git a/TODO b/TODO index b715d79..935c220 100644 --- a/TODO +++ b/TODO @@ -321,4 +321,6 @@ kde plasma portal capture for screenshot doesn't work well because the portal ui It's possible for microphone audio to get desynced when recording together with desktop audio, when not recording app audio as well. Test recording desktop audio and microphone audio together (-a "default_output|default_input") for around 30 minutes. -We can use dri2connect/dri3open to get the /dev/dri/card device. Note that this doesn't work on nvidia x11. \ No newline at end of file +We can use dri2connect/dri3open to get the /dev/dri/card device. Note that this doesn't work on nvidia x11. + +Add support for QVBR (QP with target bitrate). diff --git a/src/args_parser.c b/src/args_parser.c index 5e1fb2d..6e0d854 100644 --- a/src/args_parser.c +++ b/src/args_parser.c @@ -311,7 +311,7 @@ static void usage_full() { printf("\n"); printf(" -df Organise replays in folders based on the current date.\n"); printf("\n"); - printf(" -sc Run a script on the saved video file (asynchronously). The first argument to the script is the filepath to the saved video file and the second argument is the recording type (either \"regular\" or \"replay\").\n"); + printf(" -sc Run a script on the saved video file (asynchronously). The first argument to the script is the filepath to the saved video/screenshot file and the second argument is the recording type (either \"regular\", \"replay\" or \"screenshot\").\n"); printf(" Not applicable for live streams.\n"); printf(" Note: the script has to be executable.\n"); printf("\n"); diff --git a/src/cuda.c b/src/cuda.c index 23954a4..00683cf 100644 --- a/src/cuda.c +++ b/src/cuda.c @@ -65,6 +65,7 @@ bool gsr_cuda_load(gsr_cuda *self, Display *display, bool do_overclock) { goto fail; } + // TODO: Use the device associated with the opengl graphics context CUdevice cu_dev; res = self->cuDeviceGet(&cu_dev, 0); if(res != CUDA_SUCCESS) { diff --git a/src/main.cpp b/src/main.cpp index cbee2c4..2187d0b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2347,11 +2347,16 @@ static void capture_image_to_file(args_parser &arg_parser, gsr_egl *egl, gsr_ima } gsr_egl_swap_buffers(egl); - - const int image_quality = video_quality_to_image_quality_value(arg_parser.video_quality); - if(!gsr_image_writer_write_to_file(&image_writer, arg_parser.filename, image_format, image_quality)) { - fprintf(stderr, "gsr error: capture_image_to_file_wayland: failed to write opengl texture to image output file %s\n", arg_parser.filename); - _exit(1); + + if(!should_stop_error) { + const int image_quality = video_quality_to_image_quality_value(arg_parser.video_quality); + if(!gsr_image_writer_write_to_file(&image_writer, arg_parser.filename, image_format, image_quality)) { + fprintf(stderr, "gsr error: capture_image_to_file_wayland: failed to write opengl texture to image output file %s\n", arg_parser.filename); + _exit(1); + } + + if(arg_parser.recording_saved_script) + run_recording_saved_script_async(arg_parser.recording_saved_script, arg_parser.filename, "screenshot"); } gsr_image_writer_deinit(&image_writer);