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.
    • E Offline
      Egnos @evroom
      last edited by Egnos

      @evroom now, enabling in VNC options “direct capture mode”, also from VNC I see the stream on omxplayer and on MM.

      Many Thanks! 👍

      My Mirror https://forum.magicmirror.builders/topic/17262/the-raspimirror-was-born/7

      1 Reply Last reply Reply Quote 0
      • I Offline
        imdickie
        last edited by imdickie

        I’m going from a working Raspi3 to a Raspi4 and using the exact same working module configuration I cannot get video on omxplayer using this module.

        I set up a pristine image and loaded everything one at a time, but this one fails. I pulled out all of the modules to make sure there was nothing in them that was causing the issue.

        Below is my module config and my logs pulled using pm2 logs mm. There is an error, but I don’t know enough about this to determine the cause. Can anyone review the logs and provide some direction?

        Thanks.

         		 {
        		    module: "MMM-RTSPStream",
        		    position: "bottom_bar",
        		    config: {
        		        autoStart: true,
        		        rotateStreams: true,
        		        rotateStreamTimeout: 10,
        		        moduleWidth: 642,
        		        moduleHeight: 362,
        		        localPlayer: 'omxplayer',
        		        remotePlayer: 'none',
        		        showSnapWhenPaused: true,
        		        remoteSnaps: true,
        		        stream1: {
        		            name: '',
        		            url: 'rtsp://xxx:xxx@192.168.1.164:554/Streaming/Channels/102/',
        		            frameRate: '10',
        		            snapshotType: 'url',
        		            snapshotRefresh: 10,
        		            width: 640,
        		            height: 360,
        		            },
        		        }
        		}
        

        pi@raspberrypi:~ $ pm2 logs mm --lines 100
        [TAILING] Tailing last 100 lines for [mm] process (change the value with --lines option)
        /home/pi/.pm2/logs/mm-error.log last 100 lines:
        0|mm | [2020-04-08 14:17:49.908] [ERROR] TypeError: Cannot convert undefined or null to object
        0|mm | at Function.keys ()
        0|mm | at stopProcs (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_helper.js:469:32)
        0|mm | at /home/pi/MagicMirror/modules/MMM-RTSPStream/node_helper.js:498:17
        0|mm | at /home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/pm2/lib/API.js:606:19
        0|mm | at /home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/pm2-axon-rpc/lib/client.js:45:10
        0|mm | at Parser. (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/pm2-axon/lib/sockets/req.js:67:8)
        0|mm | at Parser.emit (events.js:200:13)
        0|mm | at Parser._write (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/amp/lib/stream.js:91:16)
        0|mm | at doWrite (_stream_writable.js:417:12)
        0|mm | at writeOrBuffer (_stream_writable.js:401:5)

        /home/pi/.pm2/logs/mm-out.log last 100 lines:
        0|mm |
        0|mm | > magicmirror@2.11.0 start /home/pi/MagicMirror
        0|mm | > DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js
        0|mm |
        0|mm | [2020-04-08 14:17:48.507] [LOG] Starting MagicMirror: v2.11.0
        0|mm | [2020-04-08 14:17:48.514] [LOG] Loading config …
        0|mm | [2020-04-08 14:17:48.519] [LOG] Loading module helpers …
        0|mm | [2020-04-08 14:17:49.292] [LOG] Initializing new module helper …
        0|mm | [2020-04-08 14:17:49.293] [LOG] Module helper loaded: MMM-RTSPStream
        0|mm | [2020-04-08 14:17:49.293] [LOG] All module helpers loaded.
        0|mm | [2020-04-08 14:17:49.399] [LOG] Starting server on port 8080 …
        0|mm | [2020-04-08 14:17:49.421] [LOG] Server started …
        0|mm | [2020-04-08 14:17:49.422] [LOG] Connecting socket for: MMM-RTSPStream
        0|mm | [2020-04-08 14:17:49.423] [LOG] PM2: Stopping all OMXPlayer Streams…
        0|mm | [2020-04-08 14:17:49.424] [LOG] Sockets connected & modules started …
        0|mm | [2020-04-08 14:17:49.531] [LOG] Launching application.
        0|mm | [2020-04-08 14:17:49.908] [LOG] Whoops! There was an uncaught exception…
        0|mm | [2020-04-08 14:17:49.916] [LOG] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
        0|mm | [2020-04-08 14:17:49.916] [LOG] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
        0|mm | [2020-04-08 14:17:53.508] [LOG] Starting stream stream1 using: omxplayer --avdict rtsp_transport:tcp --win 282,1501,922,1861 --live --video_queue 4 --fps 30 --no-osd rtsp://xxx:xxx@192.168.1.164:554/Streaming/Channels/102/
        0|mm | [2020-04-08 14:17:53.527] [LOG] Starting PM2 for omx_stream1
        0|mm | [2020-04-08 14:17:53.698] [LOG] PM2 started for omx_stream1

        1 Reply Last reply Reply Quote 0
        • I Offline
          imdickie
          last edited by imdickie

          Getting closer. Hoping to get some help based on the new info below.

          I was able to get a video stream, but…

          It only works in the middle_center position and the video orientation is rotated 90 deg.

          I tried using the rotateDegree switch, and it does rotate it, but the video frame stays in the portriat oreintation.

          Video Oreintation

          I am using the below config file.

          	modules: [
          		{
          			module: "alert",
          		},
          		{
          			module: "updatenotification",
          			position: "top_bar"
          		},
          		{
          			module: "clock",
          			position: "top_left"
          		},
          		{
          			module: "calendar",
          			header: "Family Calendar",
          			position: "top_left",
          			config: {
          				colored: "true",
          				calendars: [
          					{
          						symbol: "calendar-check-o ",
          						color: "#34a95f",
          						url: "https://calendar.google.com/calendar/ical/xxx/basic.ics"
          					},
          					{
          						symbol: "calendar-check-o ",
          						color: "#b1002c",
          						url: "https://calendar.google.com/calendar/ical/xxx/basic.ics"
          					},
          				]
          			}
          		},
          		{
          		  module: "MMM-DarkSkyForecast",
          		  header: "Weather",
          		  position: "top_right",
          		  classes: "default everyone",
          		  disabled: false,
          		  config: {
          		    apikey: "xxx",
          		    latitude: "33.481613",
          		    longitude: "-117.061959",      
          		    iconset: "5c",
          		    concise: false,
              		    forecastLayout: "table",
          		    units: "us"
          		    }
          		},		
          		{
          		module: 'MMM-RTSPStream',
          		position: 'middle_center',
          		config: {
          		    autoStart: true,
          		    moduleWidth: 642,
          		    moduleHeight: 362,
          		    localPlayer: 'omxplayer',     
          		    stream1: {
          			name: '',
          			url: 'rtsp://xxx:xxx@192.168.x.xxx:554/Streaming/Channels/102/',
          			snapshotUrl: '',
          			snapshotRefresh: 10, // Seconds
          			frameRate: "30",
          			width: 640,
          		        height: 360,
          			port: 9999,
          		    }
          		}
          	},
          		{
          			module: "compliments",
          			position: "bottom_center"
          		},
          		{
          			module: "newsfeed",
          			position: "bottom_center",
          			config: {
          				feeds: [
          					{
          						title: "New York Times",
          						url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
          					}
          				],
          				showSourceTitle: true,
          				showPublishDate: true
          			}
          		},
          	        {
          	            module: 'MMM-GoogleMapsTraffic',
          	            position: 'bottom_center',
          	            config: {
          	                key: 'xxx',
          	                lat: xxx,
          	                lng: -xxx,
          	                height: '360px',
          	                width: '360px',
          	                styledMapType: "",
          	                disableDefaultUI: true,
          	                backgroundColor: 'hsla(0, 0%, 0%, 0)',
          	            }
          		},
          	]
          
          };
          
          1 Reply Last reply Reply Quote 0
          • evroomE Offline
            evroom
            last edited by

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

            but the video frame stays in the portriat oreintation

            In

            /home/pi/MagicMirror/css/custom.css
            

            add

            .MMM-RTSPStream .innerWrapper {
              border-style: none;
            }
            

            to remove the frame altogether.
            Or find a way using css to rotate the frame.

            I tried the positions top_left, top_right, bottom_left and bottom_right.
            All work.
            It can be that your other modules are pushing it down.
            Try to have the module positioned a bit earlier in your config.

            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)

            1 Reply Last reply Reply Quote 0
            • PointPubMediaP Offline
              PointPubMedia
              last edited by

              @shbatm Do you think it could be possible to run this on another plateform, like pine64 with armbian where omxplayer is not available?

              The npm install part is not working as omxplayer is not available…

              1 Reply Last reply Reply Quote 0
              • K Offline
                KumarTRD
                last edited by

                Has anyone had success getting this module to work with Lorex security cameras? The is the only module preventing my magic mirror being “complete”

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

                  1st, have you tried the URL string at https://www.ispyconnect.com/man.aspx?n=Lorex ?

                  2nd, have you verified that the video player you want is able to run the video stream?

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

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    costascontis
                    last edited by

                    i am using vlc as local player to play my stream locally just fine.When i try to access MM from my pc (chrome) using http://mmip:8080 ,my stream is not starting at all.Using ffmpeg for remote player and i also test my stream using ffplay and it works just fine at my rpi3b.What is wrong ???

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

                      @costascontis Try a different local player. In testing of the last version I used, VLC had an invalid command line. I honestly have abandoned the module totally in favor of an external approach for the camera.

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

                      C 1 Reply Last reply Reply Quote 0
                      • C Offline
                        costascontis @BKeyport
                        last edited by

                        @BKeyport i dont have any problem with vlc as local player ,my issue is with remote player,ffmpeg.I am trying to see the feed from windows pc with chrome.Every other module is working fine ,the live feed is starting but i only see black,no camera image.

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

                          @costascontis oh, sorry, I misunderstood.

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

                          1 Reply Last reply Reply Quote 0
                          • Z Offline
                            zzricezz
                            last edited by

                            I’m assuming if i just have 1 stream, it will most likely cause a burn-in issue? any good idea? like transition between a black backgroup ever minute or so for couple of seconds?

                            Thanks,

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

                              @zzricezz burn in is mostly a non-issue in modern screens, however, I severely doubt a stream isn’t gonna do anything like that, unless you’re streaming a closet… there’s enough movement on most streams that even things that are locked into place move around (due to encoding bugs, etc)

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

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

                                I’ve got this module working with my Wyze camera, but the connection drops and the image freezes after a few minutes. Is there a way to automatically reconnect to the camera from within the module? I can do it by stopping and starting MM2 using PM2, but I’d rather not have to do that every few minutes. Thanks for any help or guidance!

                                BKeyportB twosquirrelsT 2 Replies Last reply Reply Quote 0
                                • evroomE Offline
                                  evroom
                                  last edited by evroom

                                  Hi,

                                  You can try adding this line to the config:

                                  omxRestart: 1,
                                  

                                  Automatically restart the OMX Stream every X hours.
                                  Default: 24 (hours).

                                  Btw. Assuming you use omxplayer. Do not have experience with other players.

                                  localPlayer: 'omxplayer',
                                  

                                  But getting rid of the root cause of connection dropping and image freezing after a few minutes seems better time invested.

                                  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)

                                  evroomE D 2 Replies Last reply Reply Quote 0
                                  • evroomE Offline
                                    evroom @evroom
                                    last edited by

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

                                    Btw. Assuming you use omxplayer. Do not have experience with other players.

                                    I use omxplayer ‘standalone’, not within MM, but under control of pm2.
                                    When I restart my camera, the omxplayer is connecting to the stream automatically.
                                    No restart of the omxplayer stream needed.
                                    Just FYI.

                                    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)

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

                                      @evroom Thanks! I haven’t been able to get OMXplayer to work, only VLC. However, if I can’t get the auto-restart to work with VLC, I’ll see if I can’t get OMXplayer to work.

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

                                        @dwburger I was having a ton of trouble streaming anything on my Pi 4. if you’re on a Pi 4, make sure to install the May 2020 update. Streaming is rock solid now.

                                        https://www.raspberrypi.org/documentation/raspbian/updating.md

                                        I will note, I’m also using OMX Player independently from MM - the last releases of RTSPStream broke everything, and I couldn’t bother to get things working again. I wrote a little module I kept private because it’s not configurable to cut the desired space out of the MM workspace.

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

                                        S D BKeyportB 3 Replies Last reply Reply Quote 0
                                        • S Offline
                                          sdetweil @BKeyport
                                          last edited by

                                          @BKeyport that link is for PI OS… does it apply to raspian buster?

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

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

                                            @BKeyport Yes, I’m using an RPi4. Thanks for the link for updating!

                                            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
                                            • 22
                                            • 23
                                            • 24
                                            • 25
                                            • 26
                                            • 30
                                            • 31
                                            • 24 / 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