MCPcopy Create free account
hub / github.com/Proryanator/encoder-benchmark / to_string

Method to_string

engine/src/result.rs:48–95  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

46 }
47
48 fn to_string(&self) -> String {
49 let mut default = String::new();
50
51 let overloaded_indicator = if self.was_overloaded { "[O]" } else { " " };
52 default.push_str(
53 format!(
54 "{}{}x{}\t{}\t{}Mb/s",
55 overloaded_indicator,
56 self.metadata.width,
57 self.metadata.height,
58 self.metadata.fps,
59 self.bitrate
60 )
61 .as_str(),
62 );
63
64 // adjust tabs based on expected vmaf score, or lack of one
65 let vmaf_score_str = if self.was_overloaded {
66 format!("{:.5}\t\t", self.vmaf_score)
67 } else if self.vmaf_score != 0.0 {
68 format!("{:.5}\t", self.vmaf_score)
69 } else {
70 format!("0.00000\t\t")
71 };
72
73 let effective_settings;
74 if self.decode_run {
75 effective_settings = String::from("(Decode)");
76 } else {
77 effective_settings = self.encoder_settings.clone()
78 }
79
80 default.push_str(
81 format!(
82 "\t\t{}\t\t{}\t\t{}{:.0}\t\t{}\t\t{}\t\t{}",
83 format_dhms(self.encode_time),
84 format_dhms(self.vmaf_calculation_time),
85 vmaf_score_str,
86 self.fps_stats.avg,
87 self.fps_stats.one_perc_low,
88 self.fps_stats.ninety_perc,
89 effective_settings
90 )
91 .as_str(),
92 );
93
94 return default;
95 }
96}
97
98pub fn log_results_to_file(

Callers 3

add_resultMethod · 0.45
newMethod · 0.45
log_results_to_fileFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected