ImageCapture API throwing Platform Error on takePhoto()












0















I'm attempting to use the ImageCapture API to capture a snapshot using a 4k Logitech Brio Stream webcam.



All works well on my Mac's built in camera, or using the default video constraints with the web cam, though trying to capture in higher res fails with a pretty generic platform error. The only references I've found to this come in the source code, here and here.



These links suggest either capabilities.is_null() or photo_state.is_null() respectively, though I've been unable to find what could potentially cause either of these.



Here's my (slightly trimmed down) implementation:



// N.B. self is scoped within the code file, and works as it should

const videoConstraints = {
video: {
width: { min: 1280, ideal: 3840, max: 3840 },
height: { min: 720, ideal: 2160, max: 2160 }
}
}

navigator.mediaDevices.getUserMedia(videoConstraints)
.then(function(stream) {
self.imageCapture = new ImageCapture(stream.getVideoTracks()[0]);
})


self.imageCapture.takePhoto()
.then(function(blob) { self.doSomethingWithThe(blob); }) // never gets here because...
.catch(function(e) { console.log(e); }); // here the error is thrown


This works with the built in cam, while switching the video constraints to { video: true } gets this working with the webcam, albeit with a lower res 720 x 1280 resolution (the minimum specified). No custom higher resolutions work for this.



Using Chrome as the browser for this.



Does anyone know how to get takePhoto() to work to capture a 4k image?



I've found very little describing issues with the API, so any suggestions or help welcome. Let me know if there are any details missing from the question. Thanks in advance.










share|improve this question

























  • Make sure the camera supports the resolutions you've specified.

    – Pedro Lobito
    Nov 19 '18 at 14:43













  • Thanks @PedroLobito - it should do, bought for purpose :) It's the Brio Stream. I should have specified, but no options other than the default work to take an image, which hasn't been an issue for the built in cam.

    – SRack
    Nov 19 '18 at 14:46











  • Have you tried it with ff or opera? Same problem? Just to rule out a chrome issue. Are your graphic card drivers up to date? I cannot find any mac driver to download on brio-stream/downloads. No drivers needed for Mac?

    – Pedro Lobito
    Nov 19 '18 at 15:27













  • Driver is up to date, came with a link to get this up to speed. ImageCapture isn't available in Firefox yet, though good idea to try Opera. To be honest, at this point we're considering switching back to previous tried and tested approaches to grab this. Seems ImageCapture struggles with the higher resolution. At least in Chrome, their own task manager shows Utility: Video Capture Service using ~85% CPU before throwing (or sometimes now) the above error. Appreciate the ideas though @PedroLobito, thanks :)

    – SRack
    Nov 19 '18 at 16:30
















0















I'm attempting to use the ImageCapture API to capture a snapshot using a 4k Logitech Brio Stream webcam.



All works well on my Mac's built in camera, or using the default video constraints with the web cam, though trying to capture in higher res fails with a pretty generic platform error. The only references I've found to this come in the source code, here and here.



These links suggest either capabilities.is_null() or photo_state.is_null() respectively, though I've been unable to find what could potentially cause either of these.



Here's my (slightly trimmed down) implementation:



// N.B. self is scoped within the code file, and works as it should

const videoConstraints = {
video: {
width: { min: 1280, ideal: 3840, max: 3840 },
height: { min: 720, ideal: 2160, max: 2160 }
}
}

navigator.mediaDevices.getUserMedia(videoConstraints)
.then(function(stream) {
self.imageCapture = new ImageCapture(stream.getVideoTracks()[0]);
})


self.imageCapture.takePhoto()
.then(function(blob) { self.doSomethingWithThe(blob); }) // never gets here because...
.catch(function(e) { console.log(e); }); // here the error is thrown


This works with the built in cam, while switching the video constraints to { video: true } gets this working with the webcam, albeit with a lower res 720 x 1280 resolution (the minimum specified). No custom higher resolutions work for this.



Using Chrome as the browser for this.



Does anyone know how to get takePhoto() to work to capture a 4k image?



I've found very little describing issues with the API, so any suggestions or help welcome. Let me know if there are any details missing from the question. Thanks in advance.










share|improve this question

























  • Make sure the camera supports the resolutions you've specified.

    – Pedro Lobito
    Nov 19 '18 at 14:43













  • Thanks @PedroLobito - it should do, bought for purpose :) It's the Brio Stream. I should have specified, but no options other than the default work to take an image, which hasn't been an issue for the built in cam.

    – SRack
    Nov 19 '18 at 14:46











  • Have you tried it with ff or opera? Same problem? Just to rule out a chrome issue. Are your graphic card drivers up to date? I cannot find any mac driver to download on brio-stream/downloads. No drivers needed for Mac?

    – Pedro Lobito
    Nov 19 '18 at 15:27













  • Driver is up to date, came with a link to get this up to speed. ImageCapture isn't available in Firefox yet, though good idea to try Opera. To be honest, at this point we're considering switching back to previous tried and tested approaches to grab this. Seems ImageCapture struggles with the higher resolution. At least in Chrome, their own task manager shows Utility: Video Capture Service using ~85% CPU before throwing (or sometimes now) the above error. Appreciate the ideas though @PedroLobito, thanks :)

    – SRack
    Nov 19 '18 at 16:30














0












0








0








I'm attempting to use the ImageCapture API to capture a snapshot using a 4k Logitech Brio Stream webcam.



All works well on my Mac's built in camera, or using the default video constraints with the web cam, though trying to capture in higher res fails with a pretty generic platform error. The only references I've found to this come in the source code, here and here.



These links suggest either capabilities.is_null() or photo_state.is_null() respectively, though I've been unable to find what could potentially cause either of these.



Here's my (slightly trimmed down) implementation:



// N.B. self is scoped within the code file, and works as it should

const videoConstraints = {
video: {
width: { min: 1280, ideal: 3840, max: 3840 },
height: { min: 720, ideal: 2160, max: 2160 }
}
}

navigator.mediaDevices.getUserMedia(videoConstraints)
.then(function(stream) {
self.imageCapture = new ImageCapture(stream.getVideoTracks()[0]);
})


self.imageCapture.takePhoto()
.then(function(blob) { self.doSomethingWithThe(blob); }) // never gets here because...
.catch(function(e) { console.log(e); }); // here the error is thrown


This works with the built in cam, while switching the video constraints to { video: true } gets this working with the webcam, albeit with a lower res 720 x 1280 resolution (the minimum specified). No custom higher resolutions work for this.



Using Chrome as the browser for this.



Does anyone know how to get takePhoto() to work to capture a 4k image?



I've found very little describing issues with the API, so any suggestions or help welcome. Let me know if there are any details missing from the question. Thanks in advance.










share|improve this question
















I'm attempting to use the ImageCapture API to capture a snapshot using a 4k Logitech Brio Stream webcam.



All works well on my Mac's built in camera, or using the default video constraints with the web cam, though trying to capture in higher res fails with a pretty generic platform error. The only references I've found to this come in the source code, here and here.



These links suggest either capabilities.is_null() or photo_state.is_null() respectively, though I've been unable to find what could potentially cause either of these.



Here's my (slightly trimmed down) implementation:



// N.B. self is scoped within the code file, and works as it should

const videoConstraints = {
video: {
width: { min: 1280, ideal: 3840, max: 3840 },
height: { min: 720, ideal: 2160, max: 2160 }
}
}

navigator.mediaDevices.getUserMedia(videoConstraints)
.then(function(stream) {
self.imageCapture = new ImageCapture(stream.getVideoTracks()[0]);
})


self.imageCapture.takePhoto()
.then(function(blob) { self.doSomethingWithThe(blob); }) // never gets here because...
.catch(function(e) { console.log(e); }); // here the error is thrown


This works with the built in cam, while switching the video constraints to { video: true } gets this working with the webcam, albeit with a lower res 720 x 1280 resolution (the minimum specified). No custom higher resolutions work for this.



Using Chrome as the browser for this.



Does anyone know how to get takePhoto() to work to capture a 4k image?



I've found very little describing issues with the API, so any suggestions or help welcome. Let me know if there are any details missing from the question. Thanks in advance.







javascript navigator image-capture mediastream






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 14:47







SRack

















asked Nov 19 '18 at 14:38









SRackSRack

3,95831436




3,95831436













  • Make sure the camera supports the resolutions you've specified.

    – Pedro Lobito
    Nov 19 '18 at 14:43













  • Thanks @PedroLobito - it should do, bought for purpose :) It's the Brio Stream. I should have specified, but no options other than the default work to take an image, which hasn't been an issue for the built in cam.

    – SRack
    Nov 19 '18 at 14:46











  • Have you tried it with ff or opera? Same problem? Just to rule out a chrome issue. Are your graphic card drivers up to date? I cannot find any mac driver to download on brio-stream/downloads. No drivers needed for Mac?

    – Pedro Lobito
    Nov 19 '18 at 15:27













  • Driver is up to date, came with a link to get this up to speed. ImageCapture isn't available in Firefox yet, though good idea to try Opera. To be honest, at this point we're considering switching back to previous tried and tested approaches to grab this. Seems ImageCapture struggles with the higher resolution. At least in Chrome, their own task manager shows Utility: Video Capture Service using ~85% CPU before throwing (or sometimes now) the above error. Appreciate the ideas though @PedroLobito, thanks :)

    – SRack
    Nov 19 '18 at 16:30



















  • Make sure the camera supports the resolutions you've specified.

    – Pedro Lobito
    Nov 19 '18 at 14:43













  • Thanks @PedroLobito - it should do, bought for purpose :) It's the Brio Stream. I should have specified, but no options other than the default work to take an image, which hasn't been an issue for the built in cam.

    – SRack
    Nov 19 '18 at 14:46











  • Have you tried it with ff or opera? Same problem? Just to rule out a chrome issue. Are your graphic card drivers up to date? I cannot find any mac driver to download on brio-stream/downloads. No drivers needed for Mac?

    – Pedro Lobito
    Nov 19 '18 at 15:27













  • Driver is up to date, came with a link to get this up to speed. ImageCapture isn't available in Firefox yet, though good idea to try Opera. To be honest, at this point we're considering switching back to previous tried and tested approaches to grab this. Seems ImageCapture struggles with the higher resolution. At least in Chrome, their own task manager shows Utility: Video Capture Service using ~85% CPU before throwing (or sometimes now) the above error. Appreciate the ideas though @PedroLobito, thanks :)

    – SRack
    Nov 19 '18 at 16:30

















Make sure the camera supports the resolutions you've specified.

– Pedro Lobito
Nov 19 '18 at 14:43







Make sure the camera supports the resolutions you've specified.

– Pedro Lobito
Nov 19 '18 at 14:43















Thanks @PedroLobito - it should do, bought for purpose :) It's the Brio Stream. I should have specified, but no options other than the default work to take an image, which hasn't been an issue for the built in cam.

– SRack
Nov 19 '18 at 14:46





Thanks @PedroLobito - it should do, bought for purpose :) It's the Brio Stream. I should have specified, but no options other than the default work to take an image, which hasn't been an issue for the built in cam.

– SRack
Nov 19 '18 at 14:46













Have you tried it with ff or opera? Same problem? Just to rule out a chrome issue. Are your graphic card drivers up to date? I cannot find any mac driver to download on brio-stream/downloads. No drivers needed for Mac?

– Pedro Lobito
Nov 19 '18 at 15:27







Have you tried it with ff or opera? Same problem? Just to rule out a chrome issue. Are your graphic card drivers up to date? I cannot find any mac driver to download on brio-stream/downloads. No drivers needed for Mac?

– Pedro Lobito
Nov 19 '18 at 15:27















Driver is up to date, came with a link to get this up to speed. ImageCapture isn't available in Firefox yet, though good idea to try Opera. To be honest, at this point we're considering switching back to previous tried and tested approaches to grab this. Seems ImageCapture struggles with the higher resolution. At least in Chrome, their own task manager shows Utility: Video Capture Service using ~85% CPU before throwing (or sometimes now) the above error. Appreciate the ideas though @PedroLobito, thanks :)

– SRack
Nov 19 '18 at 16:30





Driver is up to date, came with a link to get this up to speed. ImageCapture isn't available in Firefox yet, though good idea to try Opera. To be honest, at this point we're considering switching back to previous tried and tested approaches to grab this. Seems ImageCapture struggles with the higher resolution. At least in Chrome, their own task manager shows Utility: Video Capture Service using ~85% CPU before throwing (or sometimes now) the above error. Appreciate the ideas though @PedroLobito, thanks :)

– SRack
Nov 19 '18 at 16:30












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376914%2fimagecapture-api-throwing-platform-error-on-takephoto%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376914%2fimagecapture-api-throwing-platform-error-on-takephoto%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents