Skip to content

Commit

Permalink
add -o flag + no lower loglevel
Browse files Browse the repository at this point in the history
  • Loading branch information
couleurm committed Apr 24, 2022
1 parent 86b50d3 commit bfb6c9e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions smoothie.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def pause(text):
parser.add_argument("-verbose", "-v", help="increase output verbosity", action="store_true" )
parser.add_argument("-curdir", "-cd", help="save all output to current directory", action="store_true", )
parser.add_argument("-input", "-i", help="specify input video path(s)", action="store", nargs="+", metavar='PATH', type=str)
parser.add_argument("-output", "-o", help="specify output video path(s)", action="store", nargs="+", metavar='PATH', type=str)
parser.add_argument("-vpy", help="specify a VapourSynth script", action="store", nargs=1, metavar='PATH', type=str)
args = parser.parse_args()

Expand Down Expand Up @@ -140,6 +141,10 @@ def pause(text):
while path.exists(out):
out = path.join(outdir, f'{filename} - {choice(flavors)} ({count}){ext}')
count+=1

if args.output:
if ((type(args.input) is list) and (len(args.input) == 1)):
out = args.output[0]

# VapourSynth
if isWin:
Expand All @@ -159,8 +164,8 @@ def pause(text):
vpy = path.abspath(path.join(path.dirname(__file__),'blender.vpy'))

command = [ # This is the master command, it gets appended some extra output args later down
f'{vspipe} -c y4m "{vpy}" --arg input_video="{path.abspath(video)}" --arg config_filepath="{config_filepath}" - ',
f'{conf["encoding"]["process"]} -hide_banner -loglevel warning -stats -i - ',
f'{vspipe} "{vpy}" --arg input_video="{path.abspath(video)}" --arg config_filepath="{config_filepath}" -c y4m - ',
f'{conf["encoding"]["process"]} -hide_banner -loglevel error -stats -i - ',
]

if isWin:
Expand Down Expand Up @@ -196,6 +201,6 @@ def pause(text):
if exitcode != 0:
print(f"Something went wrong with {video}, press any key to un-pause")
if isWin: system('pause>nul')
exit
exit(1)

system(f"title [{round}/{len(args.input)}] Smoothie - Finished! (EOF)")

0 comments on commit bfb6c9e

Please sign in to comment.