@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.
Read the statement by Michael Teeuw here.
Posts made by dwburger
-
RE: MMM-RTSPStream success
-
RE: MMM-RTSPStream success
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!
-
MMM-RTSPStream success
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!
-
RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras
I thought I would put a close to my efforts here with the following:
I believe I’ve found a solution. I decided to use ffmpeg from the RPi4 command line to save an image from the RTSP stream every 5 minutes. Every 5 minutes the new image overwrites the previous one, thus using the same filename. Then, I’m using mykle1’s MMM-EyeCandy module to display that sole image that’s housed in the /pix folder for that module. So, after several hours, ffmpeg continues to run (although it throws lots of “missed packet” errors), but it doesn’t abort. I’ll put ffmpeg under pm2 control next. Now, using MMM-EyeCandy, I’m getting a new image from my Wyze camera in the lower-right corner of my MM2 every 5 minutes. This is all I needed to stay reasonably up-to-date with what’s happening in front of that camera.
-
RE: MMM-RTSPStream snapshots
I believe I’ve found a solution. I decided to use ffmpeg from the RPi4 command line to save an image from the RTSP stream every 5 minutes. Every 5 minutes the new image overwrites the previous one, thus using the same filename. Then, I’m using mykle1’s MMM-EyeCandy module to display that sole image that’s housed in the /pix folder for that module. So, after several hours, ffmpeg continues to run (although it throws lots of “missed packet” errors), but it doesn’t abort. I’ll put ffmpeg under pm2 control next. Now, using MMM-EyeCandy, I’m getting a new image from my Wyze camera in the lower-right corner of my MM2 every 5 minutes. This is all I needed to stay reasonably up-to-date with what’s happening in front of that camera.
-
MMM-RTSPStream snapshots
I’d like to use MMM-RTSPStream to display a snapshot of my Wyze camera’s RTSP stream every 5 minutes. I can manually generate a .jpg snapshot using the following console command:
ffmpeg -y -i rtsp://#myUsername#:#myPassword#@192.168.1.117:554/live -vframes 1 /home/pi/image.jpg
However, I can’t get this file created or displayed on my MM2 screen using MMM-RTSPStream. All I see on my MM2 screen is a dark-gray area surrounded by a white frame in the bottom-right corner of the screen. Based on my reading of the module’s instructions, I should be able to do this. Below is the MMM-RTSPStream section of my MM2 config.js file. Maybe someone can spot my error(s) that’s keeping this from working properly??? Thanks for any help provided.
{ module: "MMM-RTSPStream", position: "bottom_right", config: { autoStart: true, rotateStreams: false, rotateStreamTimeout: 10, moduleWidth: 354, moduleHeight: 250, localPlayer: 'ffmpeg', remotePlayer: 'ffmpeg', showSnapWhenPaused: true, remoteSnaps: true, shutdownDelay: 12, stream1: { name: 'DWBPanCam', url: 'rtsp://#myUsername#:#myPassword#@192.168.1.117/live', frameRate: '15', hdUrl: 'rtsp://#myUsername#:#myPassword#@192.168.1.117/live', snapshotUrl: '/home/pi', snapshotType: 'file', snapshotRefresh: 60, protocol: 'tcp', width: undefined, height: undefined, ffmpegPort: 554, }, } },
-
RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras
Maybe I’m just a glutton for punishment, but I’d really like to get this to work. I went online looking for other RTSP players and found ContaCam (https://www.contaware.com/contacam.html). It’s Windows donateware and getting my Wyze RTSP stream up and viewing was simple. It’s been going for several hours. During the time the stream has been running on ContaCam I also accessed the stream with omxplayer on my Rpi4 and VLC on my Windows 10 machine. Both the omxplayer and VLC player stopped displaying live video after only a short time; the live stream on ContaCam is still going strong. Just wondering…are there settings in the ContaCam set-up that might be helpful in stabilizing the livestream video on the omxplayer? It seems apparent that the Wyze camera is working and my wifi network is OK, the weak link seems to be the player. Any suggestions on how to proceed down this path will be much appreciated.
-
RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras
Please pardon the rant…I got started down this path today since I was having stability issues with vlc inside the MMM-RTSPStream module. Now that I’ve gotten my Wyze RTSP stream working outside MM2 using omxplayer (with lots of expert help), I’m still having stability issues. The stream lasts for a few seconds to a few minutes and then vanishes. When I look at the RPi4 console, omxplayer has stopped giving me the “have a nice day” message. That’s cute and all, but It’s starting to annoy me. One advantage to the use of omxplayer is that I can easily automate restarting it. But, that doesn’t really address what seems to be a core issue with my Wyze camera or wifi ecosystem or ??? I don’t know enough about IP cams or streaming video or video players to know whether this is technically difficult to do or not, but it sure seems like all this should work way better than it does. Just sayin’.
-
RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras
@BKeyport Yep, that did it…thanks! Your explanation was so clear and concise (and simple). I don’t understand why I didn’t find a similar explanation on the web somewhere. I appreciate the help very much!