-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux support #7
Conversation
didn't realize there was already a PR for this, but mine seems a bit simpler. i think it should check for win32 before linux, and then use ffmpeg as the last fallback for GNU & other UNIXes. right now it will definitely throw an error on windows |
I like it, it is simple. One of the advantages mine has however is that the bash script accepts the EXACT arguments that the mac binary accepts. This means that we don't have to do any special parsing of arguments (like you do in the JS code.) |
I'd say it would be great to support |
@dmitry agreed, but it's not packaged in my distribution. I think the arguments should be almost identical. |
@misterhat could you please include it. Could be checked via |
|
||
if (opts.cropArea) { | ||
args.push(':0+' + opts.cropArea.x + ',' + opts.cropArea.y); | ||
args.push('-video_size', opts.cropArea.width + 'x' + opts.cropArea.height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use template literals for these
if (process.platform === 'darwin') { | ||
this.recorder = execa(path.join(__dirname, 'swift', 'main'), recorderOpts); | ||
} else if (process.platform === 'linux') { | ||
let args = ['-f', 'x11grab', '-i']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let
=> const
And use long flags whenever possible.
"build": "cd swift && xcodebuild && mv build/release/aperture main && rm -r build", | ||
"postinstall": "npm run build" | ||
"build-macos": "cd swift && xcodebuild && mv build/release/aperture main && rm -r build", | ||
"postinstall": "case $OSTYPE in darwin*) npm run build-macos ;; esac" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think [[ $OSTYPE == darwin* ]] && npm run build-macos
would be simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be, but it's not supported in plain shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use [ "$(uname)" = "Darwin" ] && npm run build-macos
then.
Can you also include support for the |
@misterhat Hey. Any interest in finishing this up? :) |
@misterhat +1 |
FYI, don't use if command -v ffmeg > /dev/null 2>&1; then
# do work
fi; Are these changes abandoned? I wouldn't mind wrapping them up if needed. |
I guess the PR has been abandoned. Are the changes that were requested all that is needed to get Linux support working in aperture (and thus kap)? I would be willing to fork @misterhat's PR and make the requested changes myself. |
@pluma I had previously created a working version of kap + aperture that ran on linux. It's a bit outdated, but it exists on my profile with support for ubuntu/centos/arch. The main issue with integration with kap is the area selector, as electron's semi-transparent windows have differing support on different distros. I solved it by creating a node addon in c++ that uses gtk to draw the transparent window. |
Closing in favor of #32 |
this should use the distro's install of ffmpeg before downloading any binaries off of npmjs