From df08459ede4a0557489bf4df99c7e652e9c13d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 23 Jun 2021 12:16:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Some=20more=20sanity=20checking?= =?UTF-8?q?=20of=20FFMPEG=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/timelapse.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index f7743a454..eabc92b12 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -1161,6 +1161,9 @@ class TimelapseRenderJob(object): logger = logging.getLogger(__name__) ### Not all players can handle non-mpeg2 in VOB format + if not videocodec: + videocodec = "libx264" + if videocodec == "mpeg2video": containerformat = "vob" else: @@ -1171,14 +1174,16 @@ class TimelapseRenderJob(object): ) placeholders = { "ffmpeg": ffmpeg, - "fps": str(fps), + "fps": str(fps if fps else "25"), "input": input, "output": output, "videocodec": videocodec, - "threads": str(threads), - "bitrate": str(bitrate), + "threads": str(threads if threads else "1"), + "bitrate": str(bitrate if bitrate else "10000k"), "containerformat": containerformat, - "filters": "-vf " + sarge.shell_quote(filter_string) if filter_string else "", + "filters": ("-vf " + sarge.shell_quote(filter_string)) + if filter_string + else "", } logger.debug("Rendering movie to {}".format(output))