Skip to content

josephp27/Peak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peak | Screen Peak Your Teammates

Similar to how Discord overlays chat over gameplay, I am setting out to write a tool to stream video over the game window, so teammates can see your screen. Think whenever you screen peaked as a kid to gain advantage over a friend or another team, but over the internet.

The goal for this project is to write (almost - writing a codec seems very time intensive, which I prefer not to do. Maybe one day) everything from scratch, using no outside libraries. Uses sockets and UDP network calls to stream video between you and your teammates using minimal libraries, written in pure Rust

Since we should always have the fastest stream, dropping packets is more than ok. Packet ordering happens in O(1) time inserts, for O(n) runtime, where n is the number of packets in a frame

Running

The application works in 2 parts - server and client.

Server

The server acts as a connection point between all clients, delegating streams to the appropriate location

cargo run server/src/main.rs

Client

The client records the screen and sends packets to the server and also listens to packets and displays them over the game. Don't forget to change the destination

cargo run client/src/main.rs

TODO

  • Record screen
  • UDP - Unreliable Packet Sequencing
    • Number packets
    • Reorder packets on client side
    • Drop packets part of previous frame
  • Stream video
  • Limit Frame rate
    • Sender
    • Receiver
  • Codec - H.264
  • Resize screen capture
  • Display as small overlay on screen - DirectX? https://www.youtube.com/watch?v=7QDkceeykbI
  • Upgrading connection to P2P via UDP Hole Punching - hard time with NAT
  • Cleanup dependencies

Issues

Currently frames are about 8mb each, at 60 fps would require about 4GB/s internet - which is unfeasible. Therefore compression and resizing needs to be implemented

Releases

No releases published

Packages

No packages published

Languages