0

I am currently working on having a web page that allows the user to see a live stream of his / her webcam and then take a snapshot (so nothing special).

Everything is fine, but on a RaspberryPi 3 running raspbian with chromium browser latest (for that distro), I can't go above a resolution of 640 x 480 using the constraints.

If I go any higher than these values, the image will simply not show on the page.

some code snippet:

    var constraints = {
    audio: false,
    video: {
        //width: { min: 1024, ideal: 1280, max: 1920 },
        //height: { min: 768, ideal: 960, max: 1440 }
        width: { min: 640, ideal: 1280, max: 1920 },
        height: { min: 480, ideal: 960, max: 1440 }
    }
};

[...]

    navigator.webkitGetUserMedia(
      constraints,
      function(stream) {
        if (navigator.mozGetUserMedia) {
          video.mozSrcObject = stream;
        } else {
          var vendorURL = window.URL || window.webkitURL;
          video.src = vendorURL.createObjectURL(stream);
        }
        video.play();
      },
      function(err) {
        console.log("An error occured! " + err);
      }
    );

Does anyone have an Idea what I might want to look into ? I've searched the web for the past 2 weeks but didn't find anything helpful so far...

The camera (Logitech HD C910) is displaying fullhd just fine in cheese...

All Ideas are highly appreciated...

0

Chrome has a bug and the rpi needs a few extra flags set. This solved it for me:

Add Drivers:

sudo nano /etc/modules
i2c-dev
snd-bcm2835
bcm2835-v4l2

Add extra V4l2 video driver flag (for Chromium to pick up the camera):

sudo nano /etc/modprobe.d/bcm2835-v4l2.conf
options bcm2835-v4l2 gst_v4l2src_is_broken=1

Here's the link: https://planb.nicecupoftea.org/2016/10/24/a-presence-robot-with-chromium-webrtc-raspberry-pi-3-and-easyrtc/

  • 1
    Wow, cool, I'll re-activate the PI for this project and give it a try – Kai May 5 '17 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.