just changing stuff

This commit is contained in:
Elghinnarisa
2023-03-26 18:31:49 +02:00
parent f8ccf44a92
commit 790fd3538e
8 changed files with 242 additions and 18 deletions

View File

@@ -0,0 +1,38 @@
import subprocess
import sys
from pathlib import Path
import os
output_folder_name = "/bulk_convert_out/"
droppedFile = sys.argv[1]
droppedName = Path(droppedFile).name
skipto = ""
duration = ""
print(droppedName)
#get path of script location and remove the tail
head_tail = os.path.split(sys.argv[0])
output_path = head_tail[0]
del sys.argv[0]
#check if output folder exists, otherwise create it
isExist = os.path.exists(output_path+output_folder_name)
if not isExist:
os.makedirs(output_path+output_folder_name)
for file in sys.argv:
basename = os.path.basename(file)
print(file)
# opus audio - might not work for surround -
args = 'ffmpeg.exe -i "{file}" -map 0:v -c:v copy -map 0:a:0 -c:a libopus -b:a 192 -map 0:a -c:a libopus -b:a 192k -map 0:s -c:s copy -f matroska "{output_path}{output_folder_name}{basename}"'.format(file=file, output_path=output_path, output_folder_name=output_folder_name, basename=basename)
#arg_list = "".join(map(str, arguments))
print(args)
#print(each)
subprocess.run(args)
k=input("press close to exit")