diff --git a/manpage/wf-recorder.1 b/manpage/wf-recorder.1 index ec3f843..88a6127 100644 --- a/manpage/wf-recorder.1 +++ b/manpage/wf-recorder.1 @@ -13,6 +13,7 @@ .Op Fl c, -codec Ar output_codec .Op Fl r, -framerate Ar framerate .Op Fl d, -device Ar encoding_device +.Op Fl -no-dmabuf .Op Fl D, -no-damage .Op Fl f Ar filename.ext .Op Fl F Ar filter_string @@ -88,6 +89,11 @@ Use the option in addition to the vaapi options to convert the data in software, before sending it to the GPU. .Pp +.It Fl -no-dmabuf +By default, wf-recorder will try to use only GPU buffers and copies if using a GPU encoder. +However, this can cause issues on some systems. +In such cases, this option will disable the GPU copy and force a CPU one. +.Pp .It Fl D , -no-damage By default, wf-recorder will request a new frame from the compositor only when the screen updates. This results in a much smaller output diff --git a/src/main.cpp b/src/main.cpp index c8abf81..cdedbf3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -887,6 +887,7 @@ int main(int argc, char *argv[]) constexpr const char* default_cmdline_output = "interactive"; std::string cmdline_output = default_cmdline_output; + bool force_no_dmabuf = false; struct option opts[] = { { "output", required_argument, NULL, 'o' }, @@ -902,6 +903,7 @@ int main(int argc, char *argv[]) { "sample-rate", required_argument, NULL, 'R' }, { "sample-format", required_argument, NULL, 'X' }, { "device", required_argument, NULL, 'd' }, + { "no-dmabuf", no_argument, NULL, '&' }, { "filter", required_argument, NULL, 'F' }, { "log", no_argument, NULL, 'l' }, { "audio", optional_argument, NULL, 'a' }, @@ -1008,6 +1010,10 @@ int main(int argc, char *argv[]) parse_codec_opts(params.audio_codec_options, optarg); break; + case '&': + force_no_dmabuf = true; + break; + default: printf("Unsupported command line argument %s\n", optarg); } @@ -1040,7 +1046,7 @@ int main(int argc, char *argv[]) } // check we use same device as compositor - if (!params.hw_device.empty() && params.hw_device == drm_device_name) + if (!params.hw_device.empty() && params.hw_device == drm_device_name && !force_no_dmabuf) { use_dmabuf = true; } else {