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

camera resolution / ratio #5

Open
stephanschulz opened this issue Oct 22, 2020 · 5 comments
Open

camera resolution / ratio #5

stephanschulz opened this issue Oct 22, 2020 · 5 comments

Comments

@stephanschulz
Copy link

stephanschulz commented Oct 22, 2020

Hi.

I love the poseOSC complied app. Works like a charm.
It seems my c920 Logitech gets initialed at 640x480 resolution. Is there a way to make it init with a different res like 1280x720 without having to compile the electron app in to a binary? Maybe a json setting file ... :) ?

@LingDong-
Copy link
Owner

Hi Stephan,

I think poseOSC just uses the default resolution, but it can be changed on line:
https://github.com/LingDong-/PoseOSC/blob/master/app.js#L75
using parameters from
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
In the compiled electron app, the source is still available and can be changed in Contents/Resources/app/app.js
But I agree having it in the json setting is convenient. Will add the feature!

@stephanschulz
Copy link
Author

stephanschulz commented Oct 22, 2020

so I can just add code to Contents/Resources/app/app.js and the already compiled binary will automatically use those changes?

@LingDong-
Copy link
Owner

yup, it's not really compiled, just "wrapped" :)

@stephanschulz
Copy link
Author

stephanschulz commented Oct 23, 2020

it works indeed.

var media_constraints = {
    audio: false,
    video: {
        width: { min: 640, ideal: 1280, max: 1920 },
        height: { min: 480, ideal: 720, max: 1080 },
    }
};

navigator.mediaDevices.getUserMedia(media_constraints)
  .then(function(stream) {
    camera.srcObject = stream;
  }).catch(function() {
    alert('could not connect stream');
});

@LingDong-
Copy link
Owner

Hi @stephanschulz, just BTW these properties are now tweak-able in the new release from settings.json. https://github.com/LingDong-/PoseOSC/releases/tag/0.0.3

It's just a little bit neater than changing app.js :)

image

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

No branches or pull requests

2 participants