deluan/bring

record screen

winwisely99 opened this issue · 1 comments

I got this working in 5 minutes on my MAC with your docker compose file.

Really nice work.

Any ideas about how i can start to record the screen ?
I was thinking of KISS for now and to capture the frames and make animated gif.

Thanks for trying it out.

Unfortunately recording the screen is not something that I plan to add to this project.

That being said, I added an OnSync function in the Client that allows you to receive any screen change and its timestamp. You could use this to create your gif or a video file, or just save the screenshots as the screen changes. Something like this:

func main() {
	client := createBringClient("vnc", "10.0.0.11", "5901")
	var lastupdate int64
	client.OnSync(func(img image.Image, ts int64) {
		if ts == lastupdate {
			return
		}
		fmt.Printf("---> Saving %d.png\n", ts)
		lastupdate = ts
		f, err := os.Create(fmt.Sprintf("./%d.png", ts))
		if err != nil {
			log.Fatal(err)
		}
		defer f.Close()

		if err = png.Encode(f, img); err != nil {
			log.Fatal(err)
		}
	})
	client.Start()
}

Let me know if this is what you are looking for