38 lines
942 B
Python
38 lines
942 B
Python
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
import os
|
|
|
|
|
|
droppedFile = sys.argv[1]
|
|
droppedName = Path(droppedFile).name
|
|
|
|
skipto = ""
|
|
duration = ""
|
|
|
|
print(droppedName)
|
|
|
|
|
|
|
|
del sys.argv[0]
|
|
|
|
#vid:
|
|
|
|
|
|
for file in sys.argv:
|
|
i = 0
|
|
path = file
|
|
basename = os.path.basename(file)
|
|
print(file)
|
|
#arguments = ( "ffmpeg.exe ", " -i ", '"', each, '"',skipto, duration, " -map 0:v ", ",'"',"E:/Projects/python/ffmpeg_by_textfile/out_done/", basename, '"' )
|
|
args = 'ffmpeg.exe -i "{file}" -map 0:v -c:v libx265 -preset slow -crf 21 -x265-params level=51:no-sao:bframes=8:psy-rd=1.5:psy-rdoq=5:aq-mode=3:ref=6 -pix_fmt yuv420p10le -map 0:a -c:a copy -map 0:s -c:s copy -f matroska "E:/Projects/python/ffmpeg_quality_testing/out/{basename}"'.format(file=file, basename=basename)
|
|
#arg_list = "".join(map(str, arguments))
|
|
print(args)
|
|
#print(each)
|
|
subprocess.run(args)
|
|
i += 1
|
|
|
|
|
|
|
|
|
|
k=input("press close to exit") |