From 31e10cf1cbf2d6ea37817c7f0a232ce213f37123 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sun, 23 Oct 2022 20:56:13 +0200 Subject: [PATCH] Move encoding options. Add version variable --- Sparks_in_Blender_encode.py | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Sparks_in_Blender_encode.py b/Sparks_in_Blender_encode.py index 216ddb4..90513f0 100755 --- a/Sparks_in_Blender_encode.py +++ b/Sparks_in_Blender_encode.py @@ -14,6 +14,24 @@ from collections import OrderedDict import json +# encoding options used +encoding = { + "libx264": { + "crf": [15, 20, 25, 30, 35], + "presets": ["fast", "medium", "slow", "veryslow"], + }, + "libx265": { + "crf": [15, 20, 25, 30, 35], + "presets": ["fast", "medium", "slow", "veryslow"], + }, + "libaom-av1": {"crf": [20, 25, 30, 35, 40], "presets": [0, 2, 4, 6]}, + "libsvtav1": {"crf": [20, 25, 30, 35, 40], "presets": [0, 4, 8, 12]}, +} + +# program version +# make tests reproducible by tag +version = "v0.0.1a1" + # always round timestamp to integer def now(): return int(time.time()) @@ -59,23 +77,10 @@ def write_line( if __name__ == "__main__": - encoding = { - "libx264": { - "crf": [15, 20, 25, 30, 35], - "presets": ["fast", "medium", "slow", "veryslow"], - }, - "libx265": { - "crf": [15, 20, 25, 30, 35], - "presets": ["fast", "medium", "slow", "veryslow"], - }, - "libaom-av1": {"crf": [20, 25, 30, 35, 40], "presets": [0, 2, 4, 6]}, - "libsvtav1": {"crf": [20, 25, 30, 35, 40], "presets": [0, 4, 8, 12]}, - } - if not os.path.isdir("encoded"): os.mkdir("encoded") - datafile = "data-" + str(now()) + ".csv" + datafile = version + "-data-" + str(now()) + ".csv" with open(datafile, "w", newline="") as file: write = csv.writer(file)