aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/main.cpp13
2 files changed, 7 insertions, 8 deletions
diff --git a/README.md b/README.md
index c0c7726..02c644e 100644
--- a/README.md
+++ b/README.md
@@ -221,7 +221,7 @@ See [https://git.dec05eba.com/?p=about](https://git.dec05eba.com/?p=about).
Some linux distros (such as manjaro and fedora) disable hardware accelerated h264/hevc on AMD/Intel because of "patent license issues". If you are using an arch-based distro then you can install mesa-git instead of mesa and if you are using another distro then you may have to switch to a better distro. On fedora based distros you can follow this: [Hardware Accelerated Codec](https://rpmfusion.org/Howto/Multimedia).\
You can alternatively install the flatpak version of GPU Screen Recorder from [flathub](https://flathub.org/apps/details/com.dec05eba.gpu_screen_recorder) which doesn't have this issue on any distro.
## I have an old nvidia GPU that supports nvenc but I get a cuda error when trying to record
-Newer ffmpeg versions don't support older nvidia cards. Try installing GPU Screen Recorder flatpak from [flathub](https://flathub.org/apps/details/com.dec05eba.gpu_screen_recorder) instead. It comes with an older ffmpeg version which might work for your GPU.
+Newer ffmpeg versions don't support older nvidia cards. Try installing GPU Screen Recorder flatpak from [flathub](https://flathub.org/apps/details/com.dec05eba.gpu_screen_recorder) instead. It comes with a custom version of ffmpeg to support older nvidia GPUs.
## I get a black screen/glitches while live streaming
It seems like ffmpeg earlier than version 6.1 has some type of bug. Install ffmpeg version 6.1 or later and then reinstall GPU Screen Recorder to fix this issue. The flatpak version of GPU Screen Recorder comes with a newer version of ffmpeg so no extra steps are needed.
## I can't play the video in my browser directly or in discord
diff --git a/src/main.cpp b/src/main.cpp
index 852a3c4..ec1941a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1040,20 +1040,19 @@ static bool add_hdr_metadata_to_video_stream(gsr_capture *cap, AVStream *video_s
static void set_format_context_options(AVFormatContext *av_format_context) {
if(LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(62, 6, 101)) {
- bool hybrid_fragmented_available = false;
av_opt_set(av_format_context->priv_data, "use_editlist", "1", 0);
const AVOption *opt = av_opt_find(av_format_context->priv_data, "movflags", NULL, 0, 0);
if (opt && opt->unit) {
const AVOption *flag = av_opt_find(av_format_context->priv_data, "hybrid_fragmented", opt->unit, 0, 0);
- if (flag) {
- hybrid_fragmented_available = true;
+ if (flag)
av_opt_set(av_format_context->priv_data, "movflags", "+hybrid_fragmented", 0);
- }
}
-
- if(!hybrid_fragmented_available)
- fprintf(stderr, "gsr warning: hybrid_fragmented movflags is not available in your FFmpeg version. If you experience stutter in the mp4 file then update your FFmpeg to at least version 8 or record to a mkv file\n");
} else {
+ const AVOutputFormat *output_format = av_format_context->oformat;
+ const char *file_extension = output_format->extensions ? output_format->extensions : "";
+ if(strcmp(file_extension, "mp4") != 0 && strcmp(file_extension, "mov") != 0)
+ return;
+
fprintf(stderr, "gsr warning: your FFmpeg version is known to be buggy (it doesn't have working hybrid_fragmented movflags). If you experience stutter in the mp4 file then update your FFmpeg to at least version 8 or record to a mkv file\n");
}
}