wulkano / Aperture

Record the screen on macOS
MIT License
1.24k stars 111 forks source link

Port to Linux #3

Closed PaulBGD closed 7 years ago

PaulBGD commented 7 years ago

If you want to test it, just run ./linux/capture.sh with the same arguments that you'd pass to the swift binary.

PaulBGD commented 7 years ago

This can easily be ported to Mac, replacing all of the Swift code. The changes we'd need to make to the bash script are here: https://trac.ffmpeg.org/wiki/Capture/Desktop#OSX

matheuss commented 7 years ago

@PaulBGD thank you for the PR!

I'm afraid we can't use ffmpeg for the job – at least on macOS. I spent countless hours on it (history | grep ffmpeg | wc -l currently returns 839 😛) and I'm almost sure that it isn't a viable solution:

Recording the entire screen with ffmpeg -f avfoundation -i 1 -y test.mp4:

ffmpeg

Recording the entire screen with aperture.js:

aperture

Besides that, we can't record a section of the screen with ffmpeg on macOS 😕

It would be awesome if you could gather some benchmarks from ffmpeg on Linux 😄 Also, do you know how to record the screen natively on Linux, like I did with Swift?

PaulBGD commented 7 years ago

Yeah we could do it native, but ffmpeg is incredibly fast on Linux. I'll grab some benchmarks.

doot0 commented 7 years ago

Yo @PaulBGD, I'm curious about those benchmarks - have you had any time to run any? 😅

PaulBGD commented 7 years ago

ffmpeg could record 345 frames using 1 CPU core, recordMyDesktop could barely record 60 using the same core. From what I can tell its because rMD uses a custom encoder that is nowhere as fast as ffmpeg. With the time that we'd have to put in to make a native implementation as fast as ffmpeg ourselves, I think ffmpeg is the better choice.

PaulBGD commented 7 years ago

This is ready to go!