mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 02:29:40 +00:00
fast default encode
This commit is contained in:
parent
90deb4a92f
commit
6514e51df8
2 changed files with 59 additions and 1 deletions
58
asdf.py
Normal file
58
asdf.py
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
|
toolbar_width = 40
|
||||||
|
|
||||||
|
# setup toolbar
|
||||||
|
sys.stdout.write("[%s]" % (" " * toolbar_width))
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stdout.write("\b" * (toolbar_width+1)) # return to start of line, after '['
|
||||||
|
|
||||||
|
for i in range(toolbar_width):
|
||||||
|
time.sleep(0.1) # do real work here
|
||||||
|
# update the bar
|
||||||
|
sys.stdout.write("-")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
sys.stdout.write("]\n") # this ends the progress bar
|
||||||
|
|
||||||
|
def progress_bar(iteration=0, total=0, prefix='', suffix='', decimals=1, length=50, fill='█', print_end="\r"):
|
||||||
|
"""
|
||||||
|
Call in a loop to create terminal progress bar
|
||||||
|
@params:
|
||||||
|
iteration - Required : current iteration (Int)
|
||||||
|
total - Required : total iterations (Int)
|
||||||
|
prefix - Optional : prefix string (Str)
|
||||||
|
suffix - Optional : suffix string (Str)
|
||||||
|
decimals - Optional : positive number of decimals in percent complete (Int)
|
||||||
|
length - Optional : character length of bar (Int)
|
||||||
|
fill - Optional : bar fill character (Str)
|
||||||
|
printEnd - Optional : end character (e.g. "\r", "\r\n") (Str)
|
||||||
|
"""
|
||||||
|
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total)))
|
||||||
|
filled_length = int(length * iteration // total)
|
||||||
|
bar = fill * filled_length + '-' * (length - filled_length)
|
||||||
|
#sys.stdout.write("\b" * (filled_length + 1))
|
||||||
|
print(f'{prefix}|{bar}| {percent}% {suffix}')
|
||||||
|
print('%s |%s| %s%% %s' % (prefix, bar, percent, suffix), end=print_end)
|
||||||
|
# Print New Line on Complete
|
||||||
|
if iteration == total:
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
def toolbar():
|
||||||
|
# setup toolbar
|
||||||
|
|
||||||
|
toolbar_width = 40
|
||||||
|
sys.stdout.write("[%s]" % (" " * toolbar_width))
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stdout.write("\b" * (toolbar_width+1)) # return to start of line, after '['
|
||||||
|
|
||||||
|
for i in range(toolbar_width):
|
||||||
|
time.sleep(0.1) # do real work here
|
||||||
|
# update the bar
|
||||||
|
sys.stdout.write("-")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
sys.stdout.write("]\n") # this ends the progress bar
|
||||||
|
|
2
main.py
2
main.py
|
@ -24,7 +24,7 @@ except:
|
||||||
print('ERROR: No PyScenedetect installed, try: sudo pip install scenedetect')
|
print('ERROR: No PyScenedetect installed, try: sudo pip install scenedetect')
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_ENCODE = ' --passes=1 --tile-columns=2 --tile-rows=2 --cpu-used=5 --end-usage=q --cq-level=63 --aq-mode=1'
|
DEFAULT_ENCODE = ' --passes=1 --tile-columns=2 --tile-rows=2 --cpu-used=8 --end-usage=q --cq-level=63 --aq-mode=0'
|
||||||
FFMPEG = 'ffmpeg -hide_banner -loglevel warning '
|
FFMPEG = 'ffmpeg -hide_banner -loglevel warning '
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue