From e158cb2a8b38176db6a187e2f17ddd8fef764c88 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 20 Jun 2023 20:31:06 +0200 Subject: [PATCH] Translate -c mkv to -c matroska --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 5da59ab..29ed7c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1245,6 +1245,9 @@ int main(int argc, char **argv) { } const char *container_format = args["-c"].value(); + if(container_format && strcmp(container_format, "mkv") == 0) + container_format = "matroska"; + int fps = atoi(args["-f"].value()); if(fps == 0) { fprintf(stderr, "Invalid fps argument: %s\n", args["-f"].value()); @@ -1498,7 +1501,10 @@ int main(int argc, char **argv) { // The output format is automatically guessed by the file extension avformat_alloc_output_context2(&av_format_context, nullptr, container_format, filename); if (!av_format_context) { - fprintf(stderr, "Error: Failed to deduce container format from file extension\n"); + if(container_format) + fprintf(stderr, "Error: Container format '%s' (argument -c) is not valid\n", container_format); + else + fprintf(stderr, "Error: Failed to deduce container format from file extension\n"); _exit(1); }