From 33cb77e7b1e2525aead539aba4a179ca6838c6a3 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 1 Jan 2021 11:11:51 +0100 Subject: [PATCH] Fix small video detection --- ScreenPlay/src/createimportvideo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ScreenPlay/src/createimportvideo.cpp b/ScreenPlay/src/createimportvideo.cpp index 365490f0..fb6ebd0a 100644 --- a/ScreenPlay/src/createimportvideo.cpp +++ b/ScreenPlay/src/createimportvideo.cpp @@ -373,15 +373,15 @@ bool CreateImportVideo::createWallpaperVideoPreview() args.append("-i"); args.append(m_videoPath); // If the video is shorter than 5 seconds we simply convert the original to webm - if (m_smallVideo) { - qInfo() << "Small video detected!"; + if (!m_smallVideo) { + qInfo() << "Regular video length detected!"; args.append("-vf"); // We allways want to have a 5 second clip via 24fps -> 120 frames // Divided by the number of frames we can skip (timeInSeconds * Framrate) // scale & crop parameter: https://unix.stackexchange.com/a/284731 args.append("select='not(mod(n," + QString::number((m_length / 5)) + "))',setpts=N/FRAME_RATE/TB,crop=in_h*16/9:in_h,scale=-2:400"); - // Disable audio } + // Disable audio args.append("-an"); args.append(m_exportPath + "/preview.webm"); emit processOutput("ffmpeg " + Util::toString(args));