CapSoftware / scap

High-performance, cross-platform screen capture library in Rust.
https://crates.io/crates/scap
Other
231 stars 44 forks source link

Update windows-capture and make it compile on windows #21

Closed NiiightmareXD closed 10 months ago

NiiightmareXD commented 10 months ago

I think we need a better structure to make cross-platform development easier for example we need to implement traits for each os but for now I made it to compile on windows.

windows-capture updates: Add Crop 🎉 Better Threading 🔥 Bug Fix ⭐ Performance Boost 🔥 Bug Fix 🐛 Optimization 🔥 Better Error Message 😊 Update Monitor Struct ⭐ Mutable Buffer 🔥 Bug Fix 🐛 Low Latency 🔥 Optimization 🔥 Update thiserror ✅ Native Windows Encoder 🔥

About FFmpeg: the latest version of the crate used for FFmpeg doesn't compile on windows I added a specific commit for windows that compiles but it shouldn't be a problem because I'm going to stabilize the native windows encoder and drop ffmpeg for windows completely its already used for save_as_image.

clearlysid commented 10 months ago

Thanks for the PR! I'll flick through this tomorrow ✅

thisislvca commented 10 months ago

Looking forward to it!

thisislvca commented 10 months ago

Btw this still doesn't work @NiiightmareXD:

error: failed to parse manifest at `C:\Users\lucam\Downloads\scap-main\Cargo.toml`

Caused by:
  Dependency 'ac-ffmpeg' has different source paths depending on the build target. Each dependency must have a single canonical source path irrespective of build target.
clearlysid commented 10 months ago

@thisislvca you need to provide it your own FFmpeg binaries. @ZohebMOPO can you document exact steps here to help?

thisislvca commented 10 months ago

@clearlysid I did provide the binaries, the error is a standard Cargo.toml error when you have deps imported with different source paths. At least that's what I found online :)

clearlysid commented 10 months ago

Ah! to temporarily get around this for Windows, you can comment out the ac-ffmpeg import for mac (or change it to be the same as windows)

clearlysid commented 10 months ago

Merging this to main, but just a heads up to everyone: we will be deprecating the main and using v0.0.1/main as the primary one going forward. We did use a lot of @NiiightmareXD's code as reference to update stuff so this PR was very helpful!

thisislvca commented 10 months ago

Ok cool to know!

NiiightmareXD commented 10 months ago

Btw this still doesn't work @NiiightmareXD:

error: failed to parse manifest at `C:\Users\lucam\Downloads\scap-main\Cargo.toml`

Caused by:
  Dependency 'ac-ffmpeg' has different source paths depending on the build target. Each dependency must have a single canonical source path irrespective of build target.

Comment out the version thats for macos I did this because I don't think its good idea to down grade the ffmpeg library for macos when the problem is with windows.

Pranav2612000 commented 9 months ago

@allcontributors please add @NiiightmareXD for code

allcontributors[bot] commented 9 months ago

@Pranav2612000

I've put up a pull request to add @NiiightmareXD! :tada: