From 3e632d49a6f881a708e843d0511b37708c1667c8 Mon Sep 17 00:00:00 2001 From: marko Date: Fri, 18 Feb 2022 17:31:17 +0100 Subject: [PATCH] create output dir if not already there --- DieJudoGürtelprüfung/clipper | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/DieJudoGürtelprüfung/clipper b/DieJudoGürtelprüfung/clipper index 9f21a66..e9da10e 100755 --- a/DieJudoGürtelprüfung/clipper +++ b/DieJudoGürtelprüfung/clipper @@ -7,6 +7,8 @@ import subprocess import glob import sys import argparse +import os + config = { 'vcodec': "vp9", @@ -26,6 +28,13 @@ with open(jsonFileName) as jf: ydl_opts = {"outtmpl": "%(id)s"} for clip in clipDict: + # create the directories so ffmped doesn't complain + try: + outputDir = os.path.dirname(clip['target']) + os.makedirs(outputDir) + except: + print(f"Couldn't create {outputDir}") + infoDict = None with youtube_dl.YoutubeDL(ydl_opts) as ydl: infoDict = ydl.extract_info(clip['source'], download=False) @@ -70,7 +79,9 @@ for clip in clipDict: # "an":None, "y":None, "pass":"1", - "b:v":"512k", "minrate":"375k", "maxrate":"1088k", + # "b:v":"276k", "minrate":"138k", "maxrate":"400k", # x360 + "b:v":"512k", "minrate":"256k", "maxrate":"742k", # x480 LQ + # "b:v":"750k", "minrate":"375k", "maxrate":"1088k", # x480 MQ "quality":"good", } )