aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2026-07-18 17:23:06 +0200
committerdec05eba <dec05eba@protonmail.com>2026-07-18 17:23:06 +0200
commit0c0b40ef92453e8976177698dcb5456637ff3600 (patch)
treeaaeb5d49680859a707968b4c6aa606eee8f943a1 /src/main.cpp
parent3bdc117b311b787b85e2ab6af1b3d63fcef00e49 (diff)
Only show fragmented mp4 version if it applies to the file format
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 6 insertions, 7 deletions
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");
}
}