• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-Selfieshot: High resolution for selfie

Scheduled Pinned Locked Moved Solved Troubleshooting
11 Posts 3 Posters 2.8k Views 3 Watching
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 Offline
    hclaus
    last edited by Nov 28, 2021, 7:04 PM

    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 :winking_face:

    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 Nov 29, 2021, 9:34 AM Reply Quote 0
    • M Offline
      MMRIZE @hclaus
      last edited by Nov 29, 2021, 9:34 AM

      @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 Nov 30, 2021, 3:16 PM Reply Quote 0
      • H Offline
        hclaus @MMRIZE
        last edited by Nov 30, 2021, 3:16 PM

        @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 Nov 30, 2021, 4:51 PM Reply Quote 0
        • M Offline
          MMRIZE @hclaus
          last edited by MMRIZE Nov 30, 2021, 4:54 PM Nov 30, 2021, 4:51 PM

          @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 Nov 30, 2021, 8:22 PM Reply Quote 0
          • H Offline
            hclaus @MMRIZE
            last edited by hclaus Nov 30, 2021, 8:37 PM Nov 30, 2021, 8:22 PM

            @mmrize

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

            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.

            B 1 Reply Last reply Aug 10, 2022, 4:18 PM Reply Quote 0
            • H hclaus referenced this topic on Apr 6, 2022, 4:11 PM
            • B Offline
              bhepler Module Developer @hclaus
              last edited by Aug 10, 2022, 4:18 PM

              @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 Aug 10, 2022, 5:16 PM Reply Quote 0
              • M Offline
                MMRIZE @bhepler
                last edited by Aug 10, 2022, 5:16 PM

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

                B 1 Reply Last reply Aug 11, 2022, 11:50 PM Reply Quote 0
                • B Offline
                  bhepler Module Developer @MMRIZE
                  last edited by Aug 11, 2022, 11:50 PM

                  @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 Aug 12, 2022, 5:20 AM Reply Quote 0
                  • M Offline
                    MMRIZE @bhepler
                    last edited by MMRIZE Aug 12, 2022, 5:25 AM Aug 12, 2022, 5:20 AM

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

                    B 1 Reply Last reply Aug 14, 2022, 12:47 AM Reply Quote 0
                    • B Offline
                      bhepler Module Developer @MMRIZE
                      last edited by bhepler Aug 14, 2022, 12:48 AM Aug 14, 2022, 12:47 AM

                      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
                      1 / 2
                      • First post
                        1/11
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy