just changing stuff
This commit is contained in:
38
bulk_covert_drop_audio_only.py
Normal file
38
bulk_covert_drop_audio_only.py
Normal 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")
|
||||
Reference in New Issue
Block a user