Skip to content

Commit 8c5aacd

Browse files
committed
0.3rc2
1 parent f13997a commit 8c5aacd

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

transcode.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
- allow comma-separated string for --preset, e.g. medium,slow,slower, map to list
1414
- ~~if presets.json does not exist, download from github~~
1515
- need to format source / output filenames: drop resolution suffixes
16-
- add check: if working directory == script location, exit with warning to symlink transcode.py onto $PATH
17-
- add --install arg to create symlink at /usr/local/bin?
16+
- add check: if working directory == script location, exit with warning to symlink transcode.py onto $PATH, else if different directory but no symlink, prompt to run --install
17+
- add --install arg (with optional path to custom $PATH location) to create symlink at /usr/local/bin or custom $PATH location?
1818
1919
"""
2020

@@ -78,30 +78,29 @@ def main():
7878
os.mkdir("hevc")
7979

8080
# Do the thing
81-
task_start_time = datetime.now()
81+
time_script_started = datetime.now()
8282
for file in source_files:
8383
session = Session(file, args)
8484
session.summarize()
85-
print(session.command + "\n")
86-
job_start_time = datetime.now()
85+
time_session_started = datetime.now()
8786
session.start()
8887
session.job.wait()
89-
job_end_time = datetime.now()
90-
job_elapsed_time = job_end_time - job_start_time
91-
fps = session.source["frames"] / job_elapsed_time.seconds
88+
time_session_finished = datetime.now()
89+
time_session_duration = time_session_finished - time_session_started
90+
fps = session.source["frames"] / time_session_duration.seconds
9291
source_file_size = session.source["filesize"] / 1000000
9392
output_file_size = os.path.getsize(session.path["output"]) / 1000000
9493
compression_ratio = int(100 - (output_file_size / source_file_size * 100))
95-
print("\n{date}: Finished {output_file}".format(date=str(job_end_time), output_file=session.path["output"]))
96-
session.log(job_elapsed_time, fps, compression_ratio)
94+
print("\n{date}: Finished {output_file}".format(date=str(time_session_finished), output_file=session.path["output"]))
95+
session.log(time_session_duration, fps, compression_ratio)
9796
print("\n\n\n\n\n")
9897
if args.delete:
9998
session.cleanup()
10099

101-
task_end_time = datetime.now()
102-
task_elapsed_time = task_end_time - task_start_time
100+
time_script_finished = datetime.now()
101+
time_script_duration = time_script_finished - time_script_started
103102

104-
sys.exit("{date}: Finished after {task_elapsed_time}.\n".format(date=str(datetime.now()), task_elapsed_time=task_elapsed_time))
103+
sys.exit("{date}: Finished after {duration}.\n".format(date=str(datetime.now()), duration=time_script_duration))
105104

106105
# Check for Python 3.8 (required for shlex usage)
107106
if not (sys.version_info[0] >= 3 and sys.version_info[1] >= 8):

0 commit comments

Comments
 (0)