|
13 | 13 | - allow comma-separated string for --preset, e.g. medium,slow,slower, map to list |
14 | 14 | - ~~if presets.json does not exist, download from github~~ |
15 | 15 | - 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? |
18 | 18 |
|
19 | 19 | """ |
20 | 20 |
|
@@ -78,30 +78,29 @@ def main(): |
78 | 78 | os.mkdir("hevc") |
79 | 79 |
|
80 | 80 | # Do the thing |
81 | | - task_start_time = datetime.now() |
| 81 | + time_script_started = datetime.now() |
82 | 82 | for file in source_files: |
83 | 83 | session = Session(file, args) |
84 | 84 | session.summarize() |
85 | | - print(session.command + "\n") |
86 | | - job_start_time = datetime.now() |
| 85 | + time_session_started = datetime.now() |
87 | 86 | session.start() |
88 | 87 | 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 |
92 | 91 | source_file_size = session.source["filesize"] / 1000000 |
93 | 92 | output_file_size = os.path.getsize(session.path["output"]) / 1000000 |
94 | 93 | 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) |
97 | 96 | print("\n\n\n\n\n") |
98 | 97 | if args.delete: |
99 | 98 | session.cleanup() |
100 | 99 |
|
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 |
103 | 102 |
|
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)) |
105 | 104 |
|
106 | 105 | # Check for Python 3.8 (required for shlex usage) |
107 | 106 | if not (sys.version_info[0] >= 3 and sys.version_info[1] >= 8): |
|
0 commit comments