raymanfx/eye-rs

Laggy webcam preview image on MacOS (Ventura 13.4)

Closed this issue · 5 comments

anfen commented

It feels like the buffer has all the frames, they just can't be painted quick enough, so there is a slow motion effect. Is this expected?

What kind of application are you using when you say “painted”? Did you compile in release mode?

anfen commented

Hi @raymanfx, I ran the following from the 'eye' folder: cargo run --example glium

It output to console this:

Selected stream:
Descriptor { width: 1280, height: 720, pixfmt: Rgb(24), interval: 33.333335ms }
[DBG ] FOURCC = 420v

Did you try running it in release mode instead?

cargo run —release —example glium
anfen commented

That fixed it! Very impressive library, well done. I'm new to Rust, so that was probably a school boy error. Do you know why the performance would be so different when not using --release?

Thanks for the kind words :)

Well it’s kind of expected with any compiled language. The debug (default) mode in Rust will turn off any optimizations. Modern compilers do lots of transformations of your code before generating the final instructions, e.g. loop unrolling, vectorization, inlining and more.