Coder Social home page Coder Social logo

mira-screen-share / sharer Goto Github PK

View Code? Open in Web Editor NEW
364.0 6.0 17.0 2.2 MB

A screen-sharing / remote collaboration software written in Rust

License: GNU General Public License v3.0

Rust 96.96% HLSL 1.78% Batchfile 0.16% Makefile 0.78% Shell 0.32%
rust screencapture screensharing

sharer's Introduction


Logo

Mira Screenshare

A high-performance screen-sharing / remote collaboration software written in Rust.

Rust Stargazers MIT License

Introduction

Screenshot

Currently this project is completely free and open-source. We have hosted a TURN server and a signalling server for public use, though we cannot make any guarantees about their availability or performance. The viewer client is available at mirashare.app.

You may also choose to host your own viewer and signalling server so everything is under your control.

At this stage, we do not recommend using it for any sensitive or mission-critical applications. Contributions are welcome.

Downloads

Pre-compiled binaries for macOS (aarch64 / x86-64) and Windows are available for download at the releases page.

Features

  • High performance screen capturing and streaming
  • Remote mouse and keyboard control
  • System audio capturing
  • Cross-platform (macOS, Windows)
  • Concurrent viewers support

Performance

  • 60 FPS encoding at 4K resolution
  • 110 ms E2E latency

Technical Details

Mira is built on top of the WebRTC stack, and consists of three parts, namely the sharer client, the viewer client, and the signalling server.

  • The sharer client will be responsible for capturing and streaming the screen directly to the viewer(s) through a P2P connection.
    • if your Internet environment does not permit such a P2P connection to be established, a TURN server is required to relay the data.
  • The viewer can dispatch input (e.g. keyboard, mouse events) to the sharer to achieve control of the sharer's operating system.
  • The signalling server is reponsible for peer discovery and initial connection negotiations.

For screen capturing, we use Windows.Graphics.Capture on Windows, and ScreenCaptureKit on macOS. This requires at least Windows 10 v1803 and macOS 13.0.

For encoding, by default x264 is used, however you can use other codecs/encoder or adjust its settings (quality, speed, compression, etc.) in the configuration file, config.toml (~/Library/Application Support/Mira-Sharer/config.toml for macOS).

Q & A

Q. Can you see my screens?

A. No, we cannot see your screens. In an ideal environment, the data is transmitted directly from the sharer to the viewer(s), and the signaller is only used for initial connection negotiation. We do not have access to the data. Even when a direct connection cannot be established, the data is relayed through a TURN server, and is encrypted with the WebRTC stack (e.g. Secure Real Time Protocol (SRTP)).

However, if you are still concerned, you could host your own signalling server and TURN server, and use the viewer client from the source code.

Q. Do you collect any data from me?

A. The signalling server we host does collect some metrics such as the number/length of sessions and the number of unique users estimated through your hashed IP address (salted and hashed with argon2). However, we do not collect any personal data. We do not have access to the data transmitted between the sharer and the viewer(s).

Build

You need to have ffmpeg installed.

  • For macOS, you could use brew install ffmpeg.
  • For Windows, you need to download ffmpeg from here. Make sure you download a shared library build such as ffmpeg-master-latest-win64-gpl-shared.zip. Put it under .\third_party\ffmpeg so you have e.g. .\third_party\ffmpeg\bin\ffmpeg.exe. Then copy over all dlls under ffmpeg\bin to . (working directory).

Then, simply run cargo run --release.

Configure

Configuration file is by default config.toml. There are preset configs in configs/ directory that you could use as a starting point.

For macOS, the configuration file is located at ~/Library/Application Support/Mira-Sharer/config.toml.

License

GPLv3

Note that files under src/capture/macos are also dual-licensed under MIT.

Attributions

  • Some code is adapted from scrap, which is licensed under the MIT license.
  • Some code from MirrorX, licensed under GPLv3.

sharer's People

Contributors

alisonzhangzx avatar harrynull avatar hitgif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sharer's Issues

Selecting screens a little broken (Win 11)

I can select wich screen to share on Windows 11 BUT it ends up on my main screen anyways.

(Windows 11 Home 23H2, v. 22631.3007)

It seems to work fine on macOS thought

Thanks! + Build fail on Mac

This is an amazing and useful contribution; thank you!

I brew-installed ffmpeg and tried to compile it on a Macbook pro M2 running Sonoma 14.2, in RustRover and also from the terminal.

In RustRover I get:

error: failed to run custom build command for `ac-ffmpeg v0.17.4 (https://github.com/mira-screen-share/rust-ac-ffmpeg?branch=dev#8c469771)`

The command line gives me:

brad@Hutchins sharer-main % cargo run --release
... (many compiling+ lines elided)
  error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "/opt/homebrew/Cellar/ffmpeg/7.0.1/include" "-Wall" "-Wextra" "-o" "/Users/brad/BradsExploratoryProjects/sharer-main/target/release/build/ac-ffmpeg-97185c71929fef0d/out/src/codec/mod.o" "-c" "src/codec/mod.c" with args "cc" did not execute successfully (status code exit status: 1).

Any hints?

If my newbie guess that an iPhone target is holding up the works is true, I don't need it; I just need to run it on my Macbook. So I could disable that target?

Thanks!
Brad

Prototype sharer

Prototype a screen sharing client that captures the screen and encode it to a video file ('sharer').

Goal:

  • Find the best API for screen capture in Windows (in terms of performance and capacities)
  • Experiment and compare different codec that enables real-time (60FPS) encoding

Non-goal:

  • Sound capturing
  • Cross-platform
  • Network
  • Code style

Windows Not Work

Sounds like a good idea, but it not work when I try it 🤔

software version: 0.2.0

system version: Windows 10 22H2

What additional debugging information can I provide?

Mac 桌面端闪退

macOS 14.4 Beta版(23E5191e)

安装后打开瞬间闪退,任务栏图标闪现一下消失

Linux support

Hey,

are you planning to add linux support to the sharer anytime soon?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.