Do not allow recording area right now when recording screen/monitor
This commit is contained in:
parent
8b87654f1c
commit
c8b9542f0d
2
TODO
2
TODO
@ -6,3 +6,5 @@ Getting the texture of a window when using a compositor is an nvidia specific li
|
|||||||
Remove dependency on glfw (and glew?).
|
Remove dependency on glfw (and glew?).
|
||||||
Quickly changing workspace and back while recording under i3 breaks the screen recorder. i3 probably unmaps windows in other workspaces.
|
Quickly changing workspace and back while recording under i3 breaks the screen recorder. i3 probably unmaps windows in other workspaces.
|
||||||
Remove hw_get_frame as it creates a new cuda device ptr which we dont use!
|
Remove hw_get_frame as it creates a new cuda device ptr which we dont use!
|
||||||
|
Nvidia 515.57 supports nvfbc direct capture with mouse capture. Check if driver is equal or newer than this and use mouse capture in such situations (with direct capture) supports nvfbc direct capture with mouse capture.
|
||||||
|
See https://trac.ffmpeg.org/wiki/EncodingForStreamingSites for optimizing streaming.
|
10
src/main.cpp
10
src/main.cpp
@ -606,7 +606,7 @@ static void usage() {
|
|||||||
fprintf(stderr, "OPTIONS:\n");
|
fprintf(stderr, "OPTIONS:\n");
|
||||||
fprintf(stderr, " -w Window to record or a display, \"screen\" or \"screen-direct\". The display is the display name in xrandr and if \"screen\" or \"screen-direct\" is selected then all displays are recorded and they are recorded in h265 (aka hevc)."
|
fprintf(stderr, " -w Window to record or a display, \"screen\" or \"screen-direct\". The display is the display name in xrandr and if \"screen\" or \"screen-direct\" is selected then all displays are recorded and they are recorded in h265 (aka hevc)."
|
||||||
"\"screen-direct\" skips one texture copy for fullscreen applications so it may lead to better performance and it works with VRR monitors when recording fullscreen application but may break some applications, such as mpv in fullscreen mode. Recording a display requires a gpu with NvFBC support.\n");
|
"\"screen-direct\" skips one texture copy for fullscreen applications so it may lead to better performance and it works with VRR monitors when recording fullscreen application but may break some applications, such as mpv in fullscreen mode. Recording a display requires a gpu with NvFBC support.\n");
|
||||||
fprintf(stderr, " -s The size (area) to record at in the format WxH, for example 1920x1080. Usually you want to set this to the size of the window. Optional, by default the size of the window, monitor or screen is used (which is passed to -w).\n");
|
fprintf(stderr, " -s The size (area) to record at in the format WxH, for example 1920x1080. Usually you want to set this to the size of the window. Optional, by default the size of the window (which is passed to -w). This option is only supported when recording a window, not a screen/monitor.\n");
|
||||||
fprintf(stderr, " -c Container format for output file, for example mp4, or flv.\n");
|
fprintf(stderr, " -c Container format for output file, for example mp4, or flv.\n");
|
||||||
fprintf(stderr, " -f Framerate to record at.\n");
|
fprintf(stderr, " -f Framerate to record at.\n");
|
||||||
fprintf(stderr, " -a Audio device to record from (pulse audio device). Optional, disabled by default.\n");
|
fprintf(stderr, " -a Audio device to record from (pulse audio device). Optional, disabled by default.\n");
|
||||||
@ -949,6 +949,8 @@ int main(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *record_area = args["-s"].value;
|
||||||
|
|
||||||
uint32_t window_width = 0;
|
uint32_t window_width = 0;
|
||||||
uint32_t window_height = 0;
|
uint32_t window_height = 0;
|
||||||
|
|
||||||
@ -957,6 +959,11 @@ int main(int argc, char **argv) {
|
|||||||
const char *window_str = args["-w"].value;
|
const char *window_str = args["-w"].value;
|
||||||
Window src_window_id = None;
|
Window src_window_id = None;
|
||||||
if(contains_non_hex_number(window_str)) {
|
if(contains_non_hex_number(window_str)) {
|
||||||
|
if(record_area) {
|
||||||
|
fprintf(stderr, "Option -s is not supported when recording a monitor/screen\n");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
if(!nv_fbc_library.load())
|
if(!nv_fbc_library.load())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -978,7 +985,6 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
int record_width = window_width;
|
int record_width = window_width;
|
||||||
int record_height = window_height;
|
int record_height = window_height;
|
||||||
const char *record_area = args["-s"].value;
|
|
||||||
if(record_area) {
|
if(record_area) {
|
||||||
if(sscanf(record_area, "%dx%d", &record_width, &record_height) != 2) {
|
if(sscanf(record_area, "%dx%d", &record_width, &record_height) != 2) {
|
||||||
fprintf(stderr, "Invalid value for -s '%s', expected a value in format WxH\n", record_area);
|
fprintf(stderr, "Invalid value for -s '%s', expected a value in format WxH\n", record_area);
|
||||||
|
Loading…
Reference in New Issue
Block a user