Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Linux support #7

wants to merge 1 commit into from

Conversation

misterhat
Copy link

@misterhat misterhat commented Dec 4, 2016

this should use the distro's install of ffmpeg before downloading any binaries off of npmjs

@misterhat misterhat changed the title linux support simple linux support Dec 4, 2016
@misterhat
Copy link
Author

misterhat commented Dec 4, 2016

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

@PaulBGD
Copy link

PaulBGD commented Dec 5, 2016

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.)

@PaulBGD PaulBGD mentioned this pull request Dec 5, 2016
@dmitry
Copy link

dmitry commented Dec 5, 2016

I'd say it would be great to support avconv as well (latest changelog: https://git.libav.org/?p=libav.git;a=blob;f=Changelog;hb=refs/tags/v12).

@misterhat
Copy link
Author

@dmitry agreed, but it's not packaged in my distribution. I think the arguments should be almost identical.

@dmitry
Copy link

dmitry commented Dec 5, 2016

@misterhat could you please include it. Could be checked via which ffmpeg - if found, then use it, in other case which avconv could be used as an alternative way. Then I can check how it works, so I'm 🆙 for a beta tester.

@sindresorhus sindresorhus changed the title simple linux support Linux support Dec 8, 2016

if (opts.cropArea) {
args.push(':0+' + opts.cropArea.x + ',' + opts.cropArea.y);
args.push('-video_size', opts.cropArea.width + 'x' + opts.cropArea.height);
Copy link
Contributor

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'];
Copy link
Contributor

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"
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

@sindresorhus sindresorhus Dec 8, 2016

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.

@sindresorhus
Copy link
Contributor

Can you also include support for the draw_mouse option? In master we have an option called showCursor. https://ffmpeg.org/ffmpeg-devices.html#x11grab

@sindresorhus
Copy link
Contributor

@misterhat Hey. Any interest in finishing this up? :)

@zedtux
Copy link

zedtux commented Feb 10, 2017

@misterhat +1

@fearphage
Copy link

Could be checked via which ffmpeg

FYI, don't use which in scripts to check for existence. The exit code is not reliable. Use command:

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.

@pluma
Copy link

pluma commented Mar 16, 2017

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.

@PaulBGD
Copy link

PaulBGD commented Mar 16, 2017

@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.

@fearphage fearphage mentioned this pull request Mar 17, 2017
@sindresorhus
Copy link
Contributor

Closing in favor of #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants