From 276395f468c8ee05951401a1d352e0dec3c3a3a8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 1 Apr 2021 17:59:36 +0200 Subject: Matrix: add room directory for joining rooms, resize video thumbnail --- src/FileAnalyzer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/FileAnalyzer.cpp') diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp index b397def..adfb7cc 100644 --- a/src/FileAnalyzer.cpp +++ b/src/FileAnalyzer.cpp @@ -87,8 +87,9 @@ namespace QuickMedia { return 0; } - bool video_get_first_frame(const char *filepath, const char *destination_path) { - const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-i", filepath, "-vframes", "1", "-f", "singlejpeg", destination_path, nullptr }; + bool video_get_first_frame(const char *filepath, const char *destination_path, int width, int height) { + std::string thumbnail_size = std::to_string(width) + "x" + std::to_string(height); + const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-i", filepath, "-vframes", "1", "-f", "singlejpeg", "-s", thumbnail_size.c_str(), destination_path, nullptr }; std::string ffmpeg_result; if(exec_program(program_args, nullptr, nullptr) != 0) { fprintf(stderr, "Failed to execute ffmpeg, maybe its not installed?\n"); -- cgit v1.2.3