aboutsummaryrefslogtreecommitdiff
path: root/src/FileAnalyzer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FileAnalyzer.cpp')
-rw-r--r--src/FileAnalyzer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp
index 2ce8250..5b67b8d 100644
--- a/src/FileAnalyzer.cpp
+++ b/src/FileAnalyzer.cpp
@@ -136,10 +136,10 @@ namespace QuickMedia {
snprintf(middle_seconds_str, sizeof(middle_seconds_str), "%d", middle_seconds);
if(width > 0 && height > 0) {
- char framesize[128];
- snprintf(framesize, sizeof(framesize), "%dx%d", width, height);
+ char size_arg_str[512];
+ snprintf(size_arg_str, sizeof(size_arg_str), "scale=%d:%d:force_original_aspect_ratio=decrease", width, height);
- const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-ss", middle_seconds_str, "-i", file.get_filepath().c_str(), "-vframes", "1", "-s", framesize, "--", destination_path_tmp.data.c_str(), nullptr };
+ const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-ss", middle_seconds_str, "-i", file.get_filepath().c_str(), "-vframes", "1", "-vf", size_arg_str, "--", destination_path_tmp.data.c_str(), nullptr };
if(exec_program(program_args, nullptr, nullptr) != 0) {
fprintf(stderr, "Failed to execute ffmpeg, maybe its not installed?\n");
return false;