mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
-overlay-replay > -restart-replay-on-save
This commit is contained in:
1
TODO
1
TODO
@@ -10,7 +10,6 @@ Support amf and qsv.
|
|||||||
Disable flipping on nvidia? this might fix some stuttering issues on some setups. See NvCtrlGetAttribute/NvCtrlSetAttributeAndGetStatus NV_CTRL_SYNC_TO_VBLANK https://github.com/NVIDIA/nvidia-settings/blob/d5f022976368cbceb2f20b838ddb0bf992f0cfb9/src/gtk%2B-2.x/ctkopengl.c.
|
Disable flipping on nvidia? this might fix some stuttering issues on some setups. See NvCtrlGetAttribute/NvCtrlSetAttributeAndGetStatus NV_CTRL_SYNC_TO_VBLANK https://github.com/NVIDIA/nvidia-settings/blob/d5f022976368cbceb2f20b838ddb0bf992f0cfb9/src/gtk%2B-2.x/ctkopengl.c.
|
||||||
Replays seem to have some issues with audio/video. Why?
|
Replays seem to have some issues with audio/video. Why?
|
||||||
Cleanup unused gl/egl functions, macro, etc.
|
Cleanup unused gl/egl functions, macro, etc.
|
||||||
Add option to disable overlapping of replays (the old behavior kinda. Remove the whole replay buffer data after saving when doing this).
|
|
||||||
Set audio track name to audio device name (if not merge of multiple audio devices).
|
Set audio track name to audio device name (if not merge of multiple audio devices).
|
||||||
Add support for webcam, but only really for amd/intel because amd/intel can get drm fd access to webcam, nvidia cant. This allows us to create an opengl texture directly from the webcam fd for optimal performance.
|
Add support for webcam, but only really for amd/intel because amd/intel can get drm fd access to webcam, nvidia cant. This allows us to create an opengl texture directly from the webcam fd for optimal performance.
|
||||||
Reverse engineer nvapi so we can disable "force p2 state" on linux too (nvapi profile api with the settings id 0x50166c5e).
|
Reverse engineer nvapi so we can disable "force p2 state" on linux too (nvapi profile api with the settings id 0x50166c5e).
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
project('gpu-screen-recorder', ['c', 'cpp'], version : '5.0.2', default_options : ['warning_level=2'])
|
project('gpu-screen-recorder', ['c', 'cpp'], version : '5.0.3', default_options : ['warning_level=2'])
|
||||||
|
|
||||||
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
|
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
|
||||||
if get_option('buildtype') == 'debug'
|
if get_option('buildtype') == 'debug'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gpu-screen-recorder"
|
name = "gpu-screen-recorder"
|
||||||
type = "executable"
|
type = "executable"
|
||||||
version = "5.0.2"
|
version = "5.0.3"
|
||||||
platforms = ["posix"]
|
platforms = ["posix"]
|
||||||
|
|
||||||
[config]
|
[config]
|
||||||
|
|||||||
32
src/main.cpp
32
src/main.cpp
@@ -1069,7 +1069,7 @@ static void open_video_hardware(AVCodecContext *codec_context, VideoQuality vide
|
|||||||
static void usage_header() {
|
static void usage_header() {
|
||||||
const bool inside_flatpak = getenv("FLATPAK_ID") != NULL;
|
const bool inside_flatpak = getenv("FLATPAK_ID") != NULL;
|
||||||
const char *program_name = inside_flatpak ? "flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder" : "gpu-screen-recorder";
|
const char *program_name = inside_flatpak ? "flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder" : "gpu-screen-recorder";
|
||||||
printf("usage: %s -w <window_id|monitor|focused|portal> [-c <container_format>] [-s WxH] -f <fps> [-a <audio_input>] [-q <quality>] [-r <replay_buffer_size_sec>] [-overlap-replay yes|no] [-k h264|hevc|av1|vp8|vp9|hevc_hdr|av1_hdr|hevc_10bit|av1_10bit] [-ac aac|opus|flac] [-ab <bitrate>] [-oc yes|no] [-fm cfr|vfr|content] [-bm auto|qp|vbr|cbr] [-cr limited|full] [-df yes|no] [-sc <script_path>] [-cursor yes|no] [-keyint <value>] [-restore-portal-session yes|no] [-portal-session-token-filepath filepath] [-encoder gpu|cpu] [-o <output_file>] [--list-capture-options [card_path] [vendor]] [--list-audio-devices] [--list-application-audio] [-v yes|no] [-gl-debug yes|no] [--version] [-h|--help]\n", program_name);
|
printf("usage: %s -w <window_id|monitor|focused|portal> [-c <container_format>] [-s WxH] -f <fps> [-a <audio_input>] [-q <quality>] [-r <replay_buffer_size_sec>] [-restart-replay-on-save yes|no] [-k h264|hevc|av1|vp8|vp9|hevc_hdr|av1_hdr|hevc_10bit|av1_10bit] [-ac aac|opus|flac] [-ab <bitrate>] [-oc yes|no] [-fm cfr|vfr|content] [-bm auto|qp|vbr|cbr] [-cr limited|full] [-df yes|no] [-sc <script_path>] [-cursor yes|no] [-keyint <value>] [-restore-portal-session yes|no] [-portal-session-token-filepath filepath] [-encoder gpu|cpu] [-o <output_file>] [--list-capture-options [card_path] [vendor]] [--list-audio-devices] [--list-application-audio] [-v yes|no] [-gl-debug yes|no] [--version] [-h|--help]\n", program_name);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1130,11 +1130,11 @@ static void usage_full() {
|
|||||||
printf(" Note that the video data is stored in RAM, so don't use too long replay buffer time and use constant bitrate option (-bm cbr) to prevent RAM usage from going too high in busy scenes.\n");
|
printf(" Note that the video data is stored in RAM, so don't use too long replay buffer time and use constant bitrate option (-bm cbr) to prevent RAM usage from going too high in busy scenes.\n");
|
||||||
printf(" Optional, disabled by default.\n");
|
printf(" Optional, disabled by default.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" -overlap-replay\n");
|
printf(" -restart-replay-on-save\n");
|
||||||
printf(" Should replays overlap. For example if this is set to 'yes' and replay time (-r) is set to 60 seconds and a replay is saved once then the first replay video is 60 seconds long\n");
|
printf(" Restart replay on save. For example if this is set to 'no' and replay time (-r) is set to 60 seconds and a replay is saved once then the first replay video is 60 seconds long\n");
|
||||||
printf(" and if a replay is saved 10 seconds later then the second replay video will also be 60 seconds long and contain 50 seconds of the previous video as well.\n");
|
printf(" and if a replay is saved 10 seconds later then the second replay video will also be 60 seconds long and contain 50 seconds of the previous video as well.\n");
|
||||||
printf(" If this is set to 'no' then after a replay is saved the replay buffer data is cleared and the second replay will start from that point onward.\n");
|
printf(" If this is set to 'yes' then after a replay is saved the replay buffer data is cleared and the second replay will start from that point onward.\n");
|
||||||
printf(" Optional, set to 'yes' by default.\n");
|
printf(" Optional, set to 'no' by default.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" -k Video codec to use. Should be either 'auto', 'h264', 'hevc', 'av1', 'vp8', 'vp9', 'hevc_hdr', 'av1_hdr', 'hevc_10bit' or 'av1_10bit'.\n");
|
printf(" -k Video codec to use. Should be either 'auto', 'h264', 'hevc', 'av1', 'vp8', 'vp9', 'hevc_hdr', 'av1_hdr', 'hevc_10bit' or 'av1_10bit'.\n");
|
||||||
printf(" Optional, set to 'auto' by default which defaults to 'h264'. Forcefully set to 'h264' if the file container type is 'flv'.\n");
|
printf(" Optional, set to 'auto' by default which defaults to 'h264'. Forcefully set to 'h264' if the file container type is 'flv'.\n");
|
||||||
@@ -3062,7 +3062,7 @@ int main(int argc, char **argv) {
|
|||||||
{ "-q", Arg { {}, true, false } },
|
{ "-q", Arg { {}, true, false } },
|
||||||
{ "-o", Arg { {}, true, false } },
|
{ "-o", Arg { {}, true, false } },
|
||||||
{ "-r", Arg { {}, true, false } },
|
{ "-r", Arg { {}, true, false } },
|
||||||
{ "-overlap-replay", Arg { {}, true, false } },
|
{ "-restart-replay-on-save", Arg { {}, true, false } },
|
||||||
{ "-k", Arg { {}, true, false } },
|
{ "-k", Arg { {}, true, false } },
|
||||||
{ "-ac", Arg { {}, true, false } },
|
{ "-ac", Arg { {}, true, false } },
|
||||||
{ "-ab", Arg { {}, true, false } },
|
{ "-ab", Arg { {}, true, false } },
|
||||||
@@ -3389,17 +3389,17 @@ int main(int argc, char **argv) {
|
|||||||
replay_buffer_size_secs += std::ceil(keyint); // Add a few seconds to account of lost packets because of non-keyframe packets skipped
|
replay_buffer_size_secs += std::ceil(keyint); // Add a few seconds to account of lost packets because of non-keyframe packets skipped
|
||||||
}
|
}
|
||||||
|
|
||||||
bool overlap_replay = true;
|
bool restart_replay_on_save = false;
|
||||||
const char *overlap_replay_str = args["-overlap-replay"].value();
|
const char *restart_replay_on_save_str = args["-restart-replay-on-save"].value();
|
||||||
if(!overlap_replay_str)
|
if(!restart_replay_on_save_str)
|
||||||
overlap_replay_str = "yes";
|
restart_replay_on_save_str = "no";
|
||||||
|
|
||||||
if(strcmp(overlap_replay_str, "yes") == 0) {
|
if(strcmp(restart_replay_on_save_str, "yes") == 0) {
|
||||||
overlap_replay = true;
|
restart_replay_on_save = true;
|
||||||
} else if(strcmp(overlap_replay_str, "no") == 0) {
|
} else if(strcmp(restart_replay_on_save_str, "no") == 0) {
|
||||||
overlap_replay = false;
|
restart_replay_on_save = false;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Error: -overlap-replap should either be either 'yes' or 'no', got: '%s'\n", overlap_replay_str);
|
fprintf(stderr, "Error: -restart-replay-on-save should either be either 'yes' or 'no', got: '%s'\n", restart_replay_on_save_str);
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4251,7 +4251,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
std::lock_guard<std::mutex> lock(write_output_mutex);
|
std::lock_guard<std::mutex> lock(write_output_mutex);
|
||||||
save_replay_packets.clear();
|
save_replay_packets.clear();
|
||||||
if(!overlap_replay) {
|
if(restart_replay_on_save) {
|
||||||
frame_data_queue.clear();
|
frame_data_queue.clear();
|
||||||
frames_erased = true;
|
frames_erased = true;
|
||||||
replay_start_time = clock_get_monotonic_seconds() - paused_time_offset;
|
replay_start_time = clock_get_monotonic_seconds() - paused_time_offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user