MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. shbatm
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    S
    Offline
    • Profile
    • Following 0
    • Followers 3
    • Topics 12
    • Posts 208
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Niggich I will need to investigate further.

      As a temporary fix, you can try deleting Line 107 and Lines 109-114 in the node_helper.js file:

          ~/MagicMirror/modules/MMM-RTSPStream/node_helper.js
      

      You should be deleting the if…else block and this line will remain:

      args.unshift("--win", `${payload.box.left}, ${payload.box.top}, ${payload.box.right}, ${payload.box.bottom}`);
      

      I do not know if this will fix the problem but it is worth a try. I have opened Issue #13 to track the position, border, and fullscreen resume problems.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @barnosch @Niggich - Glad you got it working. I will clarify in the next update: the camera port should be included in the url. The port setting for the stream is actually the socket ffmpeg uses (when ffmpeg is used instead of omx).

      If anyone has any additional feature requests, clarifications, config options they would like, please let me know on here. I will get back to working on this module in the coming weeks; I am Houston, TX based so I’ve been occupied with other matters recently.

      posted in Utilities
      S
      shbatm
    • RE: Auto start does not work

      See my previous post here: https://forum.magicmirror.builders/topic/1094/pm2-mm2-not-starting-on-start-up/20

      This method may help you:

      Set pm2 to startup using systemd with user pi and home directory /home/pi

      sudo pm2 startup systemd -u pi --hp /home/pi
      

      And then use pm2 save to save the state.

      posted in Troubleshooting
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @barnosch Great! I’m glad its working. You bring up an important point that I should emphasize:

      For anyone using the OMXPlayer Version: OMXPlayer outputs directly to the screen via the GPU. The video window will show up on top of anything else and will not appear in any remote desktop, VLC, or remote browser windows. This is by design. Think of it like picture-in-picture on your TV.

      About the OMXPlayer not exiting: this is a known issue and is the reason the wip branch hasn’t been made the master yet. I thought I had a fix for it, but it’s inconsistent.

      A temporary fix is to try adding the following BEFORE the npm start line in your mirror.sh script to make sure everything is dead before restarting:

      pkill omxplayer
      pkill electron
      
      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @barnosch Here is a picture to explain:
      0_1502450595358_RTSPStream.jpg

      • Please make sure you run the following after switching branches:
          cd ~/MagicMirror/modules/MMM-RTSPStream
          npm install
      
      • Do you have any errors in the console log?
      • Please check omxplayer is installed
          which omxplayer
          # Should show '/usr/bin/omxplayer'
      
      • Please check omxplayer is running when the video should be playing:
          pgrep omx
          # Should show a number (process ID)
      
      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @imdickie Great! I’m glad it’s working!

      WRT the offset – that part is definitely a work in progress and the moduleOffset setting is a stop-gap.

      For anyone who is proficient in JavaScript – I need a better way to get the position of the camera window’s canvas tag with respect to the corner of the screen and not the browser window. Currently I’m using canvas.getBoundingClientRect() which doesn’t account for all of the borders, margins, or paddings.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @imdickie The 2nd one was the correct method. I made an adjustment to the code so now you can specify separate vertical & horizontal offsets.

      // Both methods below should work now:
      
      // Same Offset for Horizontal & Vertical:
      moduleOffset: -20    // any number works
      // Different Offsets for Horizontal & Vertical:
      moduleOffset: { top: -20, left: 0 }
      

      I didn’t get a chance to double check on my mirror, so please pull the update and let me know if you have any issues:

      # Run the following to update the module
      cd ~/MagicMirror/modules/MMM-RTSPStream
      git pull
      

      If you want to make any further adjustments yourself without waiting for me, see this post above on where to edit the code directly.

      posted in Utilities
      S
      shbatm
    • RE: Dynamically Moving Modules

      This version of MMM-Carousel will allow you to set different locations for a module for different slides:

      [card:shbatm/MMM-Carousel]

      See the very bottom of the README for more information

      If you’re interested in incorporating this into your own module, the relevant parts of the code are here and here

      posted in Development
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @imdickie If you were on the Master branch it makes sense now why you were getting duplicate views, it was using ffmpeg and looking at only the first port for both cameras. The work-in-progress branch does not use websockets/ports for local playback since OMXPlayer just draws directly on top of the MM’s browser window.

      For the black screen: I forgot the wip branch has an additional node package required. This should take care of your problem:

      cd ~/MagicMirror/modules/MMM-RTSPStream
      git checkout wip
      git pull
      npm install
      

      You may or may not need to also add a moduleOffset config option: see the posts above for pictures, if the video doesn’t line up with the border, you can add moduleOffset: X to shift the video over (where X is a number of pixels).

      For more information about the wip branch, there is an updated README on the Github page: https://github.com/shbatm/MMM-RTSPStream/tree/wip

      For pm2: it’s definitely not a requirement, but I find it’s nice to have; I included in the note above just in case you were already using it. It will automatically run the MM script for you on startup. See this page if you want more information.

      To all using the module: Thanks for bearing with me, I haven’t had a lot of time this past month to finish out the hardware-accelerated version (wip/development branch) but I hope to get it done in the next month or so. I really do appreciate any feedback / issues you have to help me improve this module.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @imdickie OK, couple more things to try:

      • Make sure you are actually on the wip branch to use OMXPlayer:
        • Run cd ~/MagicMirror/modules/MMM-RTSPStream/ && git status and the first line should say: On branch wip. If it says On branch master then run git checkout wip to switch.
      • Change the port setting of stream2 to port: 10000 (or some other free port, different than stream1 – this shouldn’t matter when using omxplayer, but if it works it means there’s probably a bug I need to fix.
      • Can you please restart the MM2 script and post (or send in a chat) your Mirror’s server log–e.g. the output to the console/log file and not the DevTools/browser?
        • If you’re using pm2 to run the MM script, this would be in ~/.pm2/logs/ on a RPi or run pm2 restart mm && pm2 logs mm
        • I’m looking for any errors and the lines that start with “Starting WebSocket server on port…” and “Starting stream stream1 with args…”
      posted in Utilities
      S
      shbatm
    • 1 / 1