MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED MMM-Selfieshot: High resolution for selfie

    Troubleshooting
    3
    11
    414
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hclaus last edited by

      Dear fellow mirror builders,

      for my recent mirror project, I would like to include a selfie function in order to document my continuous aging process above 30 😉

      For my prototype, I already use MMM-Selfieshot but I have an issue with setting up the image resolution: I cannot use the full resolution of my raspi camera module (v2.1) which would have a native resolution of 3280 × 2464 pixels. If I set the values of “width” and “height” to 3280x2464, the module always takes pictures at 1280x720. I first thought that the module won’t go beyond 1080p resolution of my display (1920x1080) but this resolution is also not possible and remains at 1280x720.

      Does anyone know, whether 1280x720 is the maximum allowed resolution of MMM-Selfieshot (the github documentation doesn’t clarify either… ) or if there is another way to use the full camera resolution (while still being able to have the “result picture” shown after the taken shot)?

      If you know other solutions for selfie shots beside MMM-Selfieshot, please let me know as well.

      Best from Switzerland,
      Hendrik

      M 1 Reply Last reply Reply Quote 0
      • M
        MMRIZE @hclaus last edited by

        @hclaus

        This module is using fswebcam external program to take the photo.
        So you can test your camera and fswebcam by manual like this;

        fswebcam
        fswebcam --resolution 3280x2464
        

        (It might need more options. See http://manpages.ubuntu.com/manpages/bionic/man1/fswebcam.1.html)

        Or you can test through another way.

        (Go to MMM-Selfieshot directory)
        cd node_modules/node-webcam/bin
        node ./node-webcam.js --w 3280 --h 2464 --l ~/picture.jpg 
        

        Check and show me the result.

        H 1 Reply Last reply Reply Quote 0
        • H
          hclaus @MMRIZE last edited by

          @mmrize

          Thank you so much that you try tackling this issue together!!

          I tested both paths as recommended:

          1. fswebcam --resolution 3280x2464
            This gives me a wonderful picture at the required resolution. It is above 2MB so I didn’t upload it.

          2. Via node-webcam.js
            This doesn’t shoot a picture (which should be in the “/home/pi”-directory, right?). The following outputs appear in the console, which leave me wondering what I should do:

          pi@raspberrypi:~/MagicMirror/modules/MMM-Selfieshot/node_modules/node-webcam/bin $ node ./node-webcam.js --w 3280 --h 2464 --l ~/picture.jpg
          Options
          Main {
            width: [ [Function: Number], 1280 ],
            height: [ [Function: Number], 720 ],
            delay: [ [Function: Number], 0 ],
            device: [ [Function: String], false ],
            quality: [ [Function: Number], 100 ],
            output: [ [Function: String], 'jpeg' ],
            verbose: [ [Function: Boolean], true ],
            help: [ [Function: Boolean], false ],
            version: [ [Function: Boolean], false ],
            greyscale: [ [Function: Boolean], false ],
            rotation: [ [Function: String], false ],
            topBanner: [ [Function: Boolean], false ],
            bottomBanner: [ [Function: Boolean], false ],
            skip: [ [Function: Number], 0 ],
            location: <ref *2> {
              resolve: [Function: resolve],
              normalize: [Function: normalize],
              isAbsolute: [Function: isAbsolute],
              join: [Function: join],
              relative: [Function: relative],
              toNamespacedPath: [Function: toNamespacedPath],
              dirname: [Function: dirname],
              basename: [Function: basename],
              extname: [Function: extname],
              format: [Function: bound _format],
              parse: [Function: parse],
              sep: '/',
              delimiter: ':',
              win32: <ref *1> {
                resolve: [Function: resolve],
                normalize: [Function: normalize],
                isAbsolute: [Function: isAbsolute],
                join: [Function: join],
                relative: [Function: relative],
                toNamespacedPath: [Function: toNamespacedPath],
                dirname: [Function: dirname],
                basename: [Function: basename],
                extname: [Function: extname],
                format: [Function: bound _format],
                parse: [Function: parse],
                sep: '\\',
                delimiter: ';',
                win32: [Circular *1],
                posix: [Circular *2],
                _makeLong: [Function: toNamespacedPath]
              },
              posix: [Circular *2],
              _makeLong: [Function: toNamespacedPath]
            }
          }
          Shorthand {
            w: [ '--width' ],
            h: [ '--help' ],
            D: [ '--delay' ],
            d: [ '--device' ],
            q: [ '--quality' ],
            out: [ '--output' ],
            v: [ '--version' ],
            g: [ '--greyscale' ],
            r: [ '--rotation' ],
            l: [ '--location' ],
            S: [ '--skip' ]
          }
          
          
          M 1 Reply Last reply Reply Quote 0
          • M
            MMRIZE @hclaus last edited by MMRIZE

            @hclaus
            I found what’s wrong.
            I might have forgotten to implement that feature really when I built this module 2 years ago. Haha… Sorry.

            At this moment, the module owner is BrianHepler, but I’m not sure he is still managing this module. I made a PR for this and contributed, but Brian’s acceptance is needed.

            Or you can try this repository instead;
            https://github.com/MMRIZE/MMM-Selfieshot

            Or just open node_helper.js and modify around line 86 for width and height by manual. It is an absolutely bad habit to edit source code directly by you, but at least you can test the working.

            I have no good webcam to test it, but you might have a piece of luck.

            H 1 Reply Last reply Reply Quote 0
            • H
              hclaus @MMRIZE last edited by hclaus

              @mmrize

              Haha, but your original intentions were good and are now fully applied 😉

              It works now (with the native Raspi Camera v2.1) and I can now happily integrate the selfie function into my mirror. Thank you so much for looking deeper into it!! BrianHepler seems to have left this forum and does not react on GitHub issues anymore, so you were the last resort.

              bhepler 1 Reply Last reply Reply Quote 0
              • Referenced by  H hclaus 
              • bhepler
                bhepler Project Sponsor @hclaus last edited by

                @hclaus - Hey, sorry for dropping the ball like that. I have merged the PR from @MMRIZE and added the ability to rotate the countdown & displayed image. The higher resolution fix is already in the main branch. The rotation feature is going through some testing but it should be committed by the end of the week.

                M H 2 Replies Last reply Reply Quote 0
                • M
                  MMRIZE @bhepler last edited by

                  @bhepler
                  I have one thing to discuss with u. Recently Raspberry changed its default camera stack to “libcamera” with modern and advanced spec.
                  However libcamera doesn’t support macos or old rp, so new independent module might be needed.

                  bhepler 1 Reply Last reply Reply Quote 0
                  • bhepler
                    bhepler Project Sponsor @MMRIZE last edited by

                    @MMRIZE - Hrm. It doesn’t support old RPi? How old are we talking about? I can kind of understand if it doesn’t support the original, but the big question is does it support the RPi 3A/B+. IIRC, that’s the most popular hardware for the mirrors.

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      MMRIZE @bhepler last edited by MMRIZE

                      @bhepler not for the rpi hw itself(os update be needed) but for the new compatible cams.
                      If someone has rpi zero and camera module 2, legacy raspicam stack will still work, but for the new 16MP cam, libcamra would be needed.

                      bhepler 1 Reply Last reply Reply Quote 0
                      • bhepler
                        bhepler Project Sponsor @MMRIZE last edited by bhepler

                        First: Rotation feature has been merged into the latest version.

                        @MMRIZE - Heh. So if someone uses the least powerful RPi with the most powerful camera, it may not work. Okay, not unexpected but yeah I could see how that would be a common combination.

                        Do you have a link where I can research the situation? I hate to pester you with dumb questions. I would rather do my research and then discuss strategies with you rather than me posting a lot of stuff here just to clarify our vocabulary.

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy