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] - Video Streaming from Live Feeds & Security Cameras

    Scheduled Pinned Locked Moved Utilities
    602 Posts 67 Posters 2.1m Views 68 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.
    • evroomE Offline
      evroom
      last edited by

      @dwburger said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      Could someone give me a little push

      When using the module or not, omxplayer always will be an overlay on top of your MM display.

      Test if it works at all (example for an Axis IP camera):

      $ omxplayer --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win "0 625 590 957" rtsp://user:password@192.168.178.56/axis-media/media.amp?resolution=640x360
      

      With log:

      $ omxplayer --genlog --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win "0 0 640 360" rtsp://user:password@192.168.178.56/axis-media/media.amp?resolution=640x360
      

      The positioning of the stream can be a bit of a pain.
      Size of video stream:
      (x2 - x1) x (y2 - y1) = 640 x 360

      To use it under control of pm2 (iso of vi you also can use nano):

      $ cd /home/pi
      $ vi axis.sh
      #!/bin/bash
      echo "Starting Axis stream ..."
      
      # No rotation
      omxplayer --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win "0 625 590 957" rtsp://user:password@192.168.178.56/axis-media/media.amp?resolution=640x360
      
      $ pm2 start axis.sh
      $ pm2 save
      

      To see it run:

      $pm2 status
      

      To restart it:

      $ pm2 restart axis
      

      To stop it:

      $ pm2 stop axis
      

      To remove it from pm2:

      $ pm2 delete axis
      

      MagicMirror version: 2.33.0
      Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

      Test environment:
      MagicMirror version: v2.33.0
      Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

      D 1 Reply Last reply Reply Quote 0
      • D Offline
        dwburger @evroom
        last edited by

        @evroom said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

        omxplayer --genlog --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win “0 0 640 360” rtsp://user:password@192.168.178.56/axis-media/media.amp?resolution=640x360

        I’m just getting the “have a nice day” error. What would the most basic omxplayer command be? I just want to see the Wyze rtsp stream anywhere on the RPi 4 screen. I’ve tried: omxplayer rtsp://:@IP address and I get the “have a nice day” error.

        1 Reply Last reply Reply Quote 0
        • evroomE Offline
          evroom
          last edited by

          @dwburger said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

          I’m just getting the “have a nice day” error.

          Can you see if the omxplayer.log gives a clue?
          And what would your VLC url look like?

          It can be that your cam or codec is not supported.

          MagicMirror version: 2.33.0
          Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
          Raspbian GNU/Linux 12 (bookworm)

          Test environment:
          MagicMirror version: v2.33.0
          Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
          Raspbian GNU/Linux 12 (bookworm)

          D 1 Reply Last reply Reply Quote 0
          • BKeyportB Offline
            BKeyport Module Developer
            last edited by

            @dwburger Try this:

            https://www.ispyconnect.com/man.aspx?n=Wyzecam

            get a URL from them, then use that URL directly in OMXPlayer…

            omxplayer [URL]

            No other options, YET.

            once you get that going, you can position and set FPS, etc.

            The "E" in "Javascript" stands for "Easy"

            1 Reply Last reply Reply Quote 0
            • D Offline
              dwburger @evroom
              last edited by

              @evroom I ran the following command via SSH to a headless RPi 4. I stopped MM2 via PM2 so the RPi4 GUI desktop is all I see.

              omxplayer -g rtsp://admin:admin@192.168.1.20/live

              The omxplayer.log file looks like this:

              23:13:40 T:18446744072105597939 DEBUG: DllBcm: Using omx system library
              23:13:40 T:18446744072105599016 DEBUG: DllOMX: Using omx system library
              23:13:40 T:18446744072105599609 DEBUG: DllAvFormat: Using libavformat system library
              23:13:40 T:18446744072105600891 DEBUG: DBus connection succeeded
              23:13:40 T:18446744072105601616 DEBUG: Keyboard: DBus connection succeeded
              23:13:40 T:18446744072105601755 DEBUG: OMXThread::Create - Thread with id -1387290944 started
              23:13:40 T:18446744072105601853 DEBUG: DllAvUtilBase: Using libavutil system library
              23:13:40 T:18446744072105601872 DEBUG: DllAvCodec: Using libavcodec system library
              23:13:40 T:18446744072105601888 DEBUG: DllAvFormat: Using libavformat system library
              23:13:40 T:18446744072105602188 DEBUG: COMXPlayer::OpenFile - avformat_open_input rtsp://admin:admin@192.168.1.20/live
              23:13:43 T:18446744072108706892 DEBUG: COMXPlayer::OpenFile - avformat_open_input enabled SEEKING
              23:13:43 T:18446744072108707062 ERROR: COMXPlayer::OpenFile - avformat_open_input rtsp://admin:admin@192.168.1.20/live
              23:13:43 T:18446744072108717572 DEBUG: OMXThread::Run - Exited thread with id -1387290944
              23:13:43 T:18446744072108718100 DEBUG: OMXThread::StopThread - Thread stopped

              D 1 Reply Last reply Reply Quote 0
              • D Offline
                dwburger @dwburger
                last edited by

                @dwburger said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

                rtsp://admin:admin@192.168.1.20/live

                I see I made an error with the rtsp URL. Here’s the correct one for my Wyze cam masking the username and password:

                rtsp://d____:b____@192.168.1.117/live

                D 1 Reply Last reply Reply Quote 0
                • D Offline
                  dwburger @dwburger
                  last edited by

                  @dwburger It took several seconds, but entering the correct rtsp URL got my camera’s video stream onto the RPi4 screen (full-screen). I’ll follow it a while to see how stable it is.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    dwburger
                    last edited by

                    OK…I’ve got it displaying my Wyze rtsp live stream on the screen while MM2 is running. The live stream seems to start and stop so I’ll work on that. Also, I need to position it in the correct place (lower-right corner).

                    BKeyportB 1 Reply Last reply Reply Quote 0
                    • BKeyportB Offline
                      BKeyport Module Developer @dwburger
                      last edited by

                      @dwburger Looks like you’re on the way. Good luck to you!

                      The "E" in "Javascript" stands for "Easy"

                      D 1 Reply Last reply Reply Quote 0
                      • D Offline
                        dwburger @BKeyport
                        last edited by

                        @BKeyport Yes, making good progress thanks to those of you who’ve helped. I’m having a difficult time with placing the window. I can get it in the upper-left of the screen using --win “0 0 600 300”, but I can’t seem to manipulate those coordinates to get the window to the lower-right. Can you point me to information that will help me understand this?

                        BKeyportB 1 Reply Last reply Reply Quote 0
                        • BKeyportB Offline
                          BKeyport Module Developer @dwburger
                          last edited by BKeyport

                          @dwburger

                          Here’s how to do that.

                          The coordinates are Top Left Bottom Right, assuming the monitor is in NORMAL mode (no rotation)

                          So, if your monitor is 1920×1080. say, that’s your bottom and right coordinate to get it into the bottom right corner.

                          top would be 1920 - WindowHeight
                          left would be 1080 - WindowWidth

                          using your example window size, and my example monitor size it would be, “1320 780 1920 1080”

                          If you’d like to make the window bigger or smaller, you can refer to https://bneijt.nl/pr/resolution-scale-calculator/ to compute different sizes that won’t distort the image.

                          Note: if you rotate your monitor, the normal/no rotation resolution is used for the calculations. so, in addition to adding “rotate” to the string, you’ll need to recalculate the sides to match.

                          The "E" in "Javascript" stands for "Easy"

                          D 1 Reply Last reply Reply Quote 0
                          • D Offline
                            dwburger @BKeyport
                            last edited by

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

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              dwburger
                              last edited by

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

                              BKeyportB twosquirrelsT 2 Replies Last reply Reply Quote 0
                              • BKeyportB Offline
                                BKeyport Module Developer @dwburger
                                last edited by

                                @dwburger You’re right of course. It should be a ton easier. But, we’re at the mercy of people who know how to program this ((#%#% to understand what the average user wants, and that’s usually barking up the tree at a cat that’s long gone…

                                The "E" in "Javascript" stands for "Easy"

                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  dwburger
                                  last edited by

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    dwburger
                                    last edited by

                                    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.

                                    1 Reply Last reply Reply Quote 0
                                    • Cr4z33C Offline
                                      Cr4z33
                                      last edited by

                                      @shbatm I’ve moved MagicMIrror to a brand new RPI 4.

                                      Can you see any reason why 1080i/1080p streams are not showing into your module?

                                      I can hear them, but not see them. :confused_face:

                                      This happens both if using omxplayer and VLC.

                                      Standard resolution streams show up normally.

                                      @evroom what about your experience?
                                      Did you get a RPI 4 too?

                                      1 Reply Last reply Reply Quote 0
                                      • BKeyportB Offline
                                        BKeyport Module Developer
                                        last edited by

                                        That’s sounding like you’re plugged into the wrong HDMI port - make sure you’re using the port closest to the power supply.

                                        The "E" in "Javascript" stands for "Easy"

                                        Cr4z33C 1 Reply Last reply Reply Quote 0
                                        • Cr4z33C Offline
                                          Cr4z33 @BKeyport
                                          last edited by

                                          @BKeyport it is already connected there. :D

                                          Fact is that 1080p videos, streams, etc. work perfectly if running in VLC as standalone.

                                          The same does NOT happen when using VLC (or OMXplayer) in this module.

                                          1 Reply Last reply Reply Quote 0
                                          • BKeyportB Offline
                                            BKeyport Module Developer
                                            last edited by

                                            OK, that’s weird (but expected)

                                            I never could get VLC to work. I can’t recall if OMX was working or not in the last public release, the developer branch was opposite.

                                            I use OMX independently now, using @evroom 's method, however, that requires the may 2020 update to fix a number of bugs in my case.

                                            The "E" in "Javascript" stands for "Easy"

                                            Cr4z33C 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
                                            • 25
                                            • 26
                                            • 27
                                            • 28
                                            • 29
                                            • 30
                                            • 31
                                            • 27 / 31
                                            • 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