aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-20 04:14:55 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-20 04:14:55 +0100
commit5d999a9c97b986ff513aa6df71719914a41cb3eb (patch)
tree2119f3941364e7f589bafa0357d58015505e6c35
parent7885bec3b304f79b1933156b624a293df64f7aa3 (diff)
Fix video thumbnail not maintaining aspect ratio
-rw-r--r--TODO3
-rw-r--r--src/FileAnalyzer.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/TODO b/TODO
index 4c2611d..b437734 100644
--- a/TODO
+++ b/TODO
@@ -221,4 +221,5 @@ Add ctrl+o keybind to open the selected media in an external application (video,
Local anime bookmark.
Local anime history.
Replace youtube subscriptions page (rss) with youtube api. This allows us to get get video status for videos (and description).
-Add watch progress to youtube (and maybe also lbry and peertube?). \ No newline at end of file
+Add watch progress to youtube (and maybe also lbry and peertube?).
+Ctrl+R set chapter to finished reading in chapters page. \ No newline at end of file
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;