-
Notifications
You must be signed in to change notification settings - Fork 12
Improve handling of ffmpeg output #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
58ae63a
2eedd22
d7611d2
1f702bf
35b4d43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -356,8 +356,8 @@ def benchmark(ffmpeg_cmd: str, debug_flag: bool, prog_bar, limit=0) -> tuple: | |
| result = { | ||
| "max_streams": max_pass, | ||
| "failure_reasons": failure_reason, | ||
| "single_worker_speed": max_pass_run_data["speed"], | ||
| "single_worker_rss_kb": max_pass_run_data["rss_kb"], | ||
| "single_worker_speed": max_pass_run_data.get("speed", 0), | ||
| "single_worker_rss_kb": max_pass_run_data.get("rss_kb", 0), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sets lasts run rss_kb to zero if not available - This has no effect on the runtime, but on the results. Even though this does not introduce greater issues, the lack of this value indicates there are other issues to be solved. |
||
| } | ||
| if prog_bar: | ||
| prog_bar.update(status="Done", workers=max_pass, speed=f"{last_speed:.02f}") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,8 @@ def workMan(worker_count: int, ffmpeg_cmd: str, passed_logger: Logger) -> tuple: | |
| workrss = float( | ||
| rssline[1].split("=")[-1].replace("kB", "").replace("KiB", "") | ||
| ) # maxrss | ||
| else: | ||
| workrss = 0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sets lasts run rss_kb to zero if not available - This has no effect on the runtime, but on the results. Even though this does not introduce greater issues, the lack of this value indicates there are other issues to be solved. |
||
|
|
||
| if re.match(r"^bench: utime", line): | ||
| timeline = line.split() | ||
|
|
@@ -134,7 +136,10 @@ def workMan(worker_count: int, ffmpeg_cmd: str, passed_logger: Logger) -> tuple: | |
| new_line = line.split() | ||
| frames.append(int(float(new_line[0].split("=")[-1]))) | ||
| framerates += int(float(new_line[1].split("=")[-1])) | ||
| speeds.append(float(new_line[6].split("=")[-1].replace("x", ""))) | ||
| speed = new_line[6].split("=")[-1].replace("x", "") | ||
| if speed == "N/A": | ||
| speed = 0 | ||
| speeds.append(float(speed)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the speed value doesnt exist at all instead of being written to with "N/A"? Also its not clear what causes ffmpeg to not report this value. Anyways_ Instead the run should be marked as unhealthy, by returning the failure. |
||
| lineAmmount = len(framelines) | ||
| if lineAmmount == 0: | ||
| lineAmmount = 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets speed to zero - The Client may try to downscale the ammount of workers, or not mark this run instantly as failed.
Additionaly, why is this access protected in
core.py? Shouldn't it be ALWAYS written to inworker.pyin the first place?In fact, this PR already introduces the handling of this value in
worker.py- this is just duplicated code.This should not be done this way.
Specifically the lack of this value indicates a greater issue.
The run should be marked as failed.