• 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-RTSPStream success

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 3.3k 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.
  • D Offline
    dwburger
    last edited by dwburger Dec 16, 2020, 12:34 AM Dec 16, 2020, 12:32 AM

    I’ve finally gotten a video stream that’s stable on my MM2 using MMM-RTSPStream. I thought I’d share the set-up to give back to this community that has been so helpful to me!
    Webcam - Reolink E1 Pro (https://www.amazon.com/gp/product/B07THQDSBD/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1)
    Raspberry Pi 4 Model B
    OS - Raspberry Pi OS 32-bit
    Magic MIrror 2.13.0 (installed using sdetweil scripts at https://github.com/sdetweil/MagicMirror_scripts
    Followed instructions for camera set-up
    Installed MMM_RTSPStream following instructions and config.html link to start
    Could not use vlc, used omxplayer instead
    Install omxplayer if necessary (using Snapcraft at https://snapcraft.io/install/omxplayer-pi/debian)
    Final, working configuration:

    {
        module: "MMM-RTSPStream",
        position: "bottom_right",
        config: {
            autoStart: true,
            rotateStreams: false,
            rotateStreamTimeout: 10,
            moduleWidth: 308,
            moduleHeight: 231,
            localPlayer: 'omxplayer',
            remotePlayer: 'vlc',
            showSnapWhenPaused: false,
            remoteSnaps: false,
            shutdownDelay: 12,
                stream1: {
                name: 'Your Own Label',
                url: 'rtsp://admin:[Your Password]@[Your IP address]:554/h264Preview_01_sub',
                frameRate: '7',
                hdUrl: 'rtsp://admin:[Your Password]@[Your IP address]:554/h264Preview_01_sub',
                snapshotType: 'url',
                snapshotRefresh: 10,
                width: 400,
                height: 350,
    			absPosition:{
    				top: 700,
    				right: 1910,
    				bottom: 1050,
    				left: 1310,
    				
    			},
                },
            }
    },
    

    The “moduleWidth” and moduleHeight" are irrelevant. What sets the size and position of the video window are the “width” and “height” values along with the “absPosition” values for “stream1”. The values that worked for me may not work for you so some trial error will be involved. Unless, of course, you completely understand the screen geometry for your MM2. I don’t so I had to go through a trial and error process to get the position just right. Part of my challenge was a body “zoom” value in my custom.css that added a level of complexity I never quite figured out. No matter, my step-by-step process resulted in a video stream the size I wanted and in the place I wanted. I also set the border width to 0 in MMM-RTSPStream.css file as follows:

    .MMM-RTSPStream .innerWrapper {
      position: relative;
      width: 352px; /* Video width + 2*border + 2*padding */
      height: 242px;
      border: 0px solid white;
    

    The bottom-line is a stable video feed from my Reolink webcam in the lower-right corner of my MM2. Hope this helps!

    1 Reply Last reply Reply Quote 1
    • D Offline
      dwburger
      last edited by Dec 21, 2020, 2:19 AM

      I’m following up on my own post since my experience has changed just a little bit since I started this. Yes, I got a stable video stream at the beginning and for a few days. After that, however, the feed became less stable and modules in my MM2 would sometimes fail. I don’t know enough about the RPi to diagnose what’s going on, but I associated the problems with either memory issues with the RPi and/or the Wifi connection. I updated/upgraded my RPi and that helped a little. My most recent attempt is to use Watchdog to keep an eye on my Wifi connection and reboot my RPi anytime a Ping test fails. So far, it’s been an improvement, but I won’t know for sure for a couple days or so. If/when I know more I’ll report back here. If someone reading this knows why the stability deteriorated or has suggestions for a solution, please share those. Thanks!

      D 1 Reply Last reply Dec 27, 2020, 5:26 PM Reply Quote 0
      • D Offline
        dwburger @dwburger
        last edited by Dec 27, 2020, 5:26 PM

        @dwburger Watchdog definitely improved the stability of my MM2 and, specifically, the video stream coming from the RTSPStream module. On the couple of occasions my MM2 froze up in the last week, I don’t think it had anything to do with the video stream. I think a daily reboot of the RPi using crontab will help. That’s my next step.

        1 Reply Last reply Reply Quote 0
        • D Offline
          dwburger
          last edited by Mar 20, 2021, 12:15 AM

          This is an update to my post detailing my experience with the WWW-RTSPStream module. My implementation of the module in my MM2 was working OK, but I still had some interruptions when the video stream I was displaying would go black. Things got worse when I introduced a new WiFi router to improve coverage in my home. I had been depending on my OEM Uverse modem/router. I disabled the modem’s WiFi and added a Netgear RAX70 router to handle the WiFi duties in my home. For reasons beyond my understanding, this caused my MMM-RTSPStream module to be less stable. So, I decided to try a new IP camera. I chose a Wansview 1080 outdoor wireless IP camera that emphasized its use of the RTSP protocol. It’s this one:

          https://www.amazon.com/gp/product/B08C4YXV51/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1

          At only $40 I wasn’t really expecting much, but I was pleasantly surprised. Their installation process was about as simple as it gets and the RTSP URLs they supply in their app were easy to copy/paste into the MMM-RTSPStream config.sys section of the MM2. I’ve had it up and running for 2 days now and haven’t had any down time. For the first time, I can actually depend on the MMM-RTSPStream module to show me a video stream that’s current. For what it’s worth, I’ve pasted my config.sys section for the MMM-RTSPStream below.

          {
              module: "MMM-RTSPStream",
              position: "bottom_right",
              config: {
                  autoStart: true,
                  rotateStreams: false,
                  rotateStreamTimeout: 10,
                  moduleWidth: 308,
                  moduleHeight: 231,
                  localPlayer: 'omxplayer',
                  remotePlayer: 'vlc',
                  showSnapWhenPaused: false,
                  remoteSnaps: false,
                  shutdownDelay: 12,
          		omxRestart: 1,
          		debug: true,
                      stream1: {
                      name: 'Garage',
          			url: 'USE RTSP URL FROM WANSVIEW APP',
                      frameRate: '30',
          			hdUrl: 'USE RTSP URL FROM WANSVIEW APP',
          			protocol: 'tcp',
          			timeout: 20,
                      snapshotType: 'url',
                      snapshotRefresh: 10,
                      width: 400,
                      height: 350,
           			absPosition:{
          				top: 700,
          				right: 1910,
          				bottom: 1050,
          				left: 1310,
          				
          			},
                      },
                  }
          },
          
          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • 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