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.

    Ghost Overlay / OMXPlayerTransparency

    Scheduled Pinned Locked Moved Troubleshooting
    mmm-pirvideoplayer
    40 Posts 9 Posters 31.7k Views 8 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.
    • Nystro0mN Offline
      Nystro0m @Reotch2
      last edited by

      @Reotch2
      Have you tried to convert your ghost.mp4 to your native screen resolution?
      I think the pi will have a hard time to do the scale conversion live.

      If you dont have the software for it, i can help you out.

      1 Reply Last reply Reply Quote 0
      • R Offline
        Reotch2 @pyrosmiley
        last edited by

        @pyrosmiley I converted the M4V to .webm using ffmpeg (incredible tool btw). Unfortunately, it’s still super choppy. @Nystro0m in a later post suggested converting it to the native resolution, so that will be the next step. That’ll be my last attempt before I stick with the semi-transparent OMXPlayer. My kid is only 11 months old, so I’ve got a couple years before it needs to be “perfect” to scare the hell out of him.

        You guys have been awesome. Thanks for all the continued help.

        Nystro0mN 1 Reply Last reply Reply Quote 0
        • Nystro0mN Offline
          Nystro0m @Reotch2
          last edited by

          @Reotch2
          Is you other widgets also laggy chunky?
          Im thinking about the transitions on the RSS module etc.

          R 1 Reply Last reply Reply Quote 0
          • R Offline
            Reotch2 @Nystro0m
            last edited by

            @Nystro0m I have minimal transitions on the screen (weather, newsfeed, clock). It looks like there is an occasional hiccup on the newsfeed, but otherwise, no issues. My front door cam is kind of a cluster and naturally clunky because it’s a non-rtsp feed, so I’m stuck doing snapshots every 500ms to give ma a “live” picture. Thinking this may be the culprit, I disabled it in the config.js to verify it wasn’t the one killing the video.

            I like where you’re headed though. (top) is showing two electron processes, is that normal? The highest processor abusers are Electron # 1 / Electron # 2 / XORG.

            1 Reply Last reply Reply Quote 0
            • Mykle1M Offline
              Mykle1 Project Sponsor Module Developer @Reotch2
              last edited by

              @Reotch2 said in Ghost Overlay / OMXPlayerTransparency:

              it turns out running the video as a module within electron is super “clunky” on my RPI-3.

              What version combination of MM and Electron are you running? We’ve had great success eliminating excessive Electron CPU usage with MM v2.1.0 and Electron v1.4.15 on Pi3 B’s, and just recently, a Pi2 as well.

              Obviously, the results are at the end of the topic

              https://forum.magicmirror.builders/topic/4684/electron-cpu-usage

              Create a working config
              How to add modules

              R 1 Reply Last reply Reply Quote 0
              • R Offline
                Reotch2 @Mykle1
                last edited by

                @Mykle1 said in Ghost Overlay / OMXPlayerTransparency:

                What version combination of MM and Electron are you running? We’ve had great success eliminating excessive Electron CPU usage with MM v2.1.0 and Electron v1.4.15 on Pi3 B’s, and just recently, a Pi2 as well.

                Obviously, the results are at the end of the topic

                https://forum.magicmirror.builders/topic/4684/electron-cpu-usage

                Unsure on electron (kinda hard to find a version). But I’m running 2.1.2, and still running Jessie. I should have some more time MUCH later today to tinker. I’ll use the steps on page 15 of that thread for a clean install and report back. Do any of these combinations allow GPU usage within electron? As always, appreciate the help.

                -Rich

                Nystro0mN 1 Reply Last reply Reply Quote 0
                • Nystro0mN Offline
                  Nystro0m @Reotch2
                  last edited by Nystro0m

                  @Reotch2
                  I got helped with this yesterday from Mykle and i went from 80-100% cpu usage to 2-45% cpu usage.
                  The biggest difference was by downgrading electron to 1.4.15.
                  But running MM 2.1.0 instead of 2.1.2 also made a improvement.

                  How to downgrade electron
                  Navigate to your home folder, from here delete all maps including electron. there should be two:
                  .electron & .electron-glpyh.
                  Navigate to you node-modules inside MM.

                  § cd ~/MagicMirror/node_modules
                  

                  Uninstall electron by

                  § sudo npm uninstall electron
                  

                  install electron with desired version in this case 1.4.15 by:

                  § sudo npm install electron@1.4.15
                  

                  Now open file manager or navigate to “~/MagicMirror/node_modules/electron” and look in package.json
                  Here you can confirm your version number of electron.

                  How to downgrade MagicMirror
                  If you want to downgrade your MM version you will need to make a new install.
                  I would suggest everyone doing this to NOT delete it BEFORE you have made a backup.

                  You can find MM 2.1.0 here (thanks to Mykle for providing me with link):
                  https://github.com/MichMich/MagicMirror/archive/v2.1.0.zip.

                  Unpack the zip in you home folder, and rename it to MagicMirror
                  then just run npm install from the folder.

                  § cd ~/MagicMirror/
                  § npm install
                  

                  Note: You will need to re-install electron 1.4.15 after the clean install of MM 2.1.0.
                  Make sure to have everything up and running before you do that.

                  I did run the gun and needed to redo everything twice.

                  R 1 Reply Last reply Reply Quote 2
                  • R Offline
                    Reotch2 @Nystro0m
                    last edited by

                    @Nystro0m So went all out, and did a fresh install of Raspbian Stretch, MM2.1.0 and electron 1.4.15… even with just the default modules and htmlvideo, electron has the CPU pegged at >75% playing the .webm file. The video is slightly less choppy than before, but still not as seamless as OMXPlayer. Do I just have a crappy Pi3? Are there memory, GPU, or overclock settings I’m missing in my pi config file that may help? I’m also running it through PM2… is that causing issues?

                    Thanks,
                    Rich

                    Mykle1M Nystro0mN 2 Replies Last reply Reply Quote 0
                    • Mykle1M Offline
                      Mykle1 Project Sponsor Module Developer @Reotch2
                      last edited by

                      @Reotch2 said in Ghost Overlay / OMXPlayerTransparency:

                      even with just the default modules and htmlvideo, electron has the CPU pegged at >75% playing the .webm file.

                      If you read through the Electron CPU Usage you would see that your results are not as bad as you think they are. Many people saw drastically worse results without asking their Pi to run htmlvideo. A simple default installation of MM 2.1.1 or higher and Electron higher than 1.4.15 would bring a Pi3 to its knees.

                      The video is slightly less choppy than before, but still not as seamless as OMXPlayer. Do I just have a crappy Pi3?

                      I don’t believe it’s your Pi3. Again, all the testing we did in that topic pretty much ruled that out and pointed the finger squarely at the MM/Electron version combination,

                      My opinion: We’re asking the Pi to do things that it’s just not capable of, or at least pushing it to its limits. I’m not bashing the Pi. I love the Pi. There’s just only so much it can do. I think you should be glad that OMXPlayer is giving you the results you want on the Pi. If you moved from the Pi to something more robust then you would likely not have the problem running htmlvideo within MM, no matter what versions of MM and Electron.

                      Create a working config
                      How to add modules

                      R 1 Reply Last reply Reply Quote 0
                      • Nystro0mN Offline
                        Nystro0m @Reotch2
                        last edited by

                        @Reotch2
                        Sorry that it does not seem to work.
                        The only thing i can think about now is the read speed of your micro SD card.
                        In video editing playback often is limited due to read speeds of the drive.
                        But here we talk about 100MB+ per second. And that is an understatement.

                        I would try to see if you can get html video running from a embedded source such as Youtube.
                        Else, if you have not tried running OMXPlayer and the PIR module as “behind” in the config i have no idea.

                        Im interesting in following up this project in the future, when i run out of things to incorporate in my MM.

                        If you decide to not follow this up anymore i would love to see a summary post what you have up and running, including scripts and such. Also a summary of what did and did not work in your research :)

                        1 Reply Last reply Reply Quote 1
                        • R Offline
                          Reotch2 @Mykle1
                          last edited by

                          @Mykle1 @Nystro0m

                          My opinion: We’re asking the Pi to do things that it’s just not capable of, or at least pushing it to its limits.

                          Honestly… this is good news. Gives me permission to stop troubleshooting :). I’m still doing a clean install of STRETCH (having minor issues on another thread), and I’ll fall back on my OMXPlayer workaround.

                          Thanks EVERYONE for helping me try every possible workaround. When the time comes for me to scale-up to a bathroom mirror, I’ll definitely plan on a little more processing power.

                          Also, I’ll post my final workaround/setup when I’m back up and running.

                          Mykle1M 1 Reply Last reply Reply Quote 1
                          • Mykle1M Offline
                            Mykle1 Project Sponsor Module Developer @Reotch2
                            last edited by

                            @Reotch2 said in Ghost Overlay / OMXPlayerTransparency:

                            Also, I’ll post my final workaround/setup when I’m back up and running.

                            Yeah dude, keep us posted!

                            Create a working config
                            How to add modules

                            1 Reply Last reply Reply Quote 1
                            • J Offline
                              jasondreher @pyrosmiley
                              last edited by

                              @pyrosmiley
                              What module did you use to play the .webm file? I have converted a file but dont know how to play it on the MM.

                              pyrosmileyP 1 Reply Last reply Reply Quote 0
                              • pyrosmileyP Offline
                                pyrosmiley @jasondreher
                                last edited by

                                @jasondreher
                                I use the MMM-htmlvideo module for it. Webm seems to work best for me as a format to reduce choppiness but even then it’s certainly not perfect. This module is great though!

                                1 Reply Last reply Reply Quote 0
                                • bheplerB Offline
                                  bhepler Module Developer
                                  last edited by

                                  I played around with this a bit. In the end, running omxplayer with a resized and rotated video was the way to go. Oh, and I re-edited a few videos together in order to provide a more seamless experience. I’ll see about capturing some video tomorrow and uploading it.

                                  I used pm2 to manage a quick script to keep the video going in case of failure. Overall, I’m quite pleased. Now to do the same to my office mirror…

                                  R 1 Reply Last reply Reply Quote 1
                                  • R Offline
                                    Reotch2 @bhepler
                                    last edited by

                                    @bhepler Are you running a borderless OMX window centered on your mirror? If so, what parameters you starting it with?

                                    After all of my troubleshooting, it seems like OMX is the best solution. I’ve just been putting up with the loss of module brightness. Overall though, good enough to get me through Halloween.

                                    bheplerB 1 Reply Last reply Reply Quote 0
                                    • bheplerB Offline
                                      bhepler Module Developer @Reotch2
                                      last edited by

                                      @Reotch2 I started by editing together the videos into a single 5 minute video, using the vertical sources. These show up on my normal computer monitor as rotated 90 degrees. Once i had the video edited (with several of the buffer video interspersed to add some tension), I output the video as a full resolution 1920x1080 MP4. I copied that video over to the pi and then used ffdshow to rotate the video 90 degrees. This part took close to 30 minutes and it made the pi sweat resistors.

                                      Once the file was rotated, I created a one-line script file called boo.sh that contains omxplayer -p -o hdmi --loop --alpha 85 boo.mp4. Start it up with pm2 (pm2 start boo.sh) and then save it.

                                      Originally I was going to convert the file to webm, but the ffdshow that installed on the pi doesn’t have that switch enabled. I didn’t feel like recompiling ffdshow, so I just went with a H264 encoded MP4.

                                      R 1 Reply Last reply Reply Quote 0
                                      • R Offline
                                        Reotch2 @bhepler
                                        last edited by

                                        @bhepler Wow. Well done. That’s exactly where I ended up except my pm2 file name is called “omx.sh”. I ran into issues with the looped video interrupting my Monitors sleep mode (PIR Sensor), so I ended up disabling it and setting a crontab for both sleep and pm2 stop/start omx.sh. My original post was only because the —alpha was dimming other modules. Are you seeing the same?

                                        Good work.

                                        1 Reply Last reply Reply Quote 0
                                        • bheplerB Offline
                                          bhepler Module Developer
                                          last edited by bhepler

                                          Video of the ghost in the mirror can be found here: https://youtu.be/6hb1N1tYcPc

                                          As an aside, this morning I changed the command to omxplayer -p -o local --loop --alpha 85 boo.mp4 to cut the sound from the video file. It woke me up when the mirror switched on this morning at 5 AM.

                                          G 1 Reply Last reply Reply Quote 1
                                          • G Offline
                                            Gubert @bhepler
                                            last edited by

                                            @bhepler said in Ghost Overlay / OMXPlayerTransparency:

                                            Video of the ghost in the mirror can be found here: https://youtu.be/6hb1N1tYcPc

                                            As an aside, this morning I changed the command to omxplayer -p -o local --loop --alpha 85 boo.mp4 to cut the sound from the video file. It woke me up when the mirror switched on this morning at 5 AM.

                                            Realy nice solution! Looks awesome!
                                            Could you sum up all the things needed for that?
                                            Reading through this 4 Pages is very difficulty.
                                            Would be very thankful.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 2 / 2
                                            • First post
                                              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