Reading benchmark start
This commit is contained in:
parent
85d5984369
commit
9ab75f281f
Binary file not shown.
|
@ -239,6 +239,8 @@ fn etch_color(source: &mut EmbedSource, data: &Vec<u8>, global_index: &mut usize
|
|||
}
|
||||
|
||||
fn read_bw(source: &EmbedSource, current_frame: i32, final_frame: i32, final_bit: i32) -> anyhow::Result<Vec<bool>>{
|
||||
let _timer = Timer::new("Dislodging frame");
|
||||
|
||||
let width = source.actual_size.width;
|
||||
let height = source.actual_size.height;
|
||||
let size = source.size as usize;
|
||||
|
@ -271,6 +273,8 @@ fn read_bw(source: &EmbedSource, current_frame: i32, final_frame: i32, final_bit
|
|||
}
|
||||
|
||||
fn read_color(source: &EmbedSource, current_frame: i32, final_frame: i32, final_byte: i32) -> anyhow::Result<Vec<u8>>{
|
||||
let _timer = Timer::new("Dislodging frame");
|
||||
|
||||
let width = source.actual_size.width;
|
||||
let height = source.actual_size.height;
|
||||
let size = source.size as usize;
|
||||
|
@ -520,6 +524,7 @@ pub fn etch(path: &str, data: Data, settings: Settings) -> anyhow::Result<()> {
|
|||
}
|
||||
|
||||
pub fn read(path: &str, threads: usize) -> anyhow::Result<Vec<u8>> {
|
||||
let _timer = Timer::new("Dislodging frame");
|
||||
let instruction_size = 5;
|
||||
|
||||
let mut video = VideoCapture::from_file(&path, CAP_ANY)
|
||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -14,24 +14,13 @@ async fn main() -> anyhow::Result<()> {
|
|||
println!("This tool allows you to turn any file into a compression-resistant video that can be uploaded to YouTube for Infinite Storage:tm:");
|
||||
println!("\nHow to use:");
|
||||
println!("1. Zip all the files you will be uploading");
|
||||
println!("2. Use the embed option on the archive (THE VIDEO WILL BE SEVERAL TIMES LARGER THAN THE FILE: original size * 8 * block size^2 = new size)");
|
||||
println!("2. Use the embed option on the archive (THE VIDEO WILL BE SEVERAL TIMES LARGER THAN THE FILE, 4x in case of optimal compression resistance preset)");
|
||||
println!("3. Upload the video to your YouTube channel. You probably want to keep it up as unlisted");
|
||||
println!("4. Use the download option to get the video back");
|
||||
println!("5. Use the dislodge option to get your files back from the downloaded video");
|
||||
println!("6. PROFIT. Enjoy being a leech on a huge corporation's servers\n");
|
||||
|
||||
ui::summon_gooey().await?;
|
||||
// let bytes = etcher::rip_bytes("src/tests/Baby.wav")?;
|
||||
// let binary = etcher::rip_binary(bytes)?;
|
||||
|
||||
// let data = Data::from_binary(binary);
|
||||
// let settings = Settings::new(1, 30, 640, 360);
|
||||
|
||||
// etcher::etch("src/out/output.avi", data, settings)?;
|
||||
|
||||
// let out_data = etcher::read("src/out/output.avi")?;
|
||||
|
||||
// etcher::write_bytes("src/out/Baby2.wav", out_data)?;
|
||||
|
||||
return Ok(());
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ fn embed_path() -> anyhow::Result<()> {
|
|||
let threads = CustomType::<usize>::new("How many threads to dedicate for processing ?")
|
||||
.with_error_message("Please type a valid number")
|
||||
.with_help_message("The more threads, the merrier")
|
||||
.with_default(4)
|
||||
.with_default(8)
|
||||
.prompt()?;
|
||||
|
||||
let out_mode = match out_mode {
|
||||
|
@ -205,7 +205,7 @@ fn dislodge_path() -> anyhow::Result<()> {
|
|||
let threads = CustomType::<usize>::new("How many threads to dedicate for processing ?")
|
||||
.with_error_message("Please type a valid number")
|
||||
.with_help_message("The more threads, the merrier")
|
||||
.with_default(4)
|
||||
.with_default(8)
|
||||
.prompt()?;
|
||||
|
||||
let out_data = etcher::read(&in_path, threads)?;
|
||||
|
|
Loading…
Reference in New Issue