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
      last edited by

      @BKeyport and @evroom this is my environment:

      • PC Hp Intel I5.

      • Raspbian on Virtual Box (using Debian…).

      First I try to make everything work on the virtual machine and then I transfer everything to PI.

      Many thanks.

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

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

        @egnos you might never get OMX working in a virtual environment. It works directly with the hardware to show the picture.

        I would highly recommend setting it up on the pi now, and setting up SSH to communicate.

        I also have SAMBA (https://www.juanmtech.com/samba-file-sharing-raspberry-pi/) running on my pi, so I can use Geany for Windows (https://www.geany.org/) to directly edit the raspberry files.

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

        1 Reply Last reply Reply Quote 0
        • H Offline
          Hram2008
          last edited by

          Has anyone been able to get this working with Axis camera products? VLC will pull and display the video stream outside of MM but will not display the same stream on MM when configured.

          Any thoughts???

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

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

            Has anyone been able to get this working with Axis camera products?

            Yes, I have.

            Please show your MMM-RTSPStream part from config.js.

            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)

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

              @Hram2008 have you tried running the URL straight with OMX to see if it works, if it does, you may have issues with the plugin itself, and as the author seems to have disappeared, you could just replace the plugin with OMX cutting the proper hole out of the window (It’ll go in front of whatever is running, so you run it independently, and it just works.

              omxplayer --no-osd --no-keys --avdict rtsp_transport:tcp --live --fps 30 --orientation 0 --win "640 0 1280 360" [URL]
              
              -or- 
              
              omxplayer --no-osd --no-keys --avdict rtsp_transport:udp --live --fps 30 --orientation 0 --win "640 0 1280 360" [URL]
              
              

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

              1 Reply Last reply Reply Quote 0
              • E Offline
                Egnos
                last edited by Egnos

                Hello everybody!
                I’m trying to set up the module by doing some tests.

                I am using this configuration, using the test stream recommended by the developer “rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov”:

                {
                		   module: "MMM-RTSPStream",
                		   //position: "middle_center",
                		   pages: {Security: "middle_center"},
                		   header: "Test",
                		   config: {
                				autoStart: true,
                				rotateStreams: false,
                				rotateStreamTimeout: 10,
                				moduleWidth: 354,
                				moduleHeight: 240,
                				localPlayer: 'omxplayer',
                				remotePlayer: 'none',
                				showSnapWhenPaused: false,
                				remoteSnaps: false,
                				stream1: {
                					name: 'BigBuckBunny',
                					url: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov',
                					frameRate: 'undefined',
                					width: undefined,
                					height: undefined,
                						},
                					}
                		},
                

                The module starts but I don’t see anything.
                Below is a screen shot of the MM:

                2020-04-02-144902-1920x1080-scrot

                Where am I wrong?

                Thank you all.

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

                bheplerB 1 Reply Last reply Reply Quote 0
                • bheplerB Offline
                  bhepler Module Developer @Egnos
                  last edited by

                  @Egnos - Have you checked to make sure there is something at that URL? I punched it into VLC and got connection failed.

                  E 1 Reply Last reply Reply Quote 0
                  • E Offline
                    Egnos @bhepler
                    last edited by

                    @bhepler thanks for the answer.
                    I thought it was just my problem.
                    I found the link on the gitHub page.
                    The developer recommends using this link for testing and I thought it worked.

                    Do you know any public links to test the module?

                    Regards.

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

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

                      Try this link:

                      rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

                      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)

                      E 1 Reply Last reply Reply Quote 0
                      • E Offline
                        Egnos @evroom
                        last edited by

                        Many thanks @evroom, the link works in VLC but still doesn’t work in MM.

                        Below what I see on the terminal:

                        [10:58:31.986] [LOG]    Starting stream stream1 using: omxplayer --avdict rtsp_transport:tcp --win 786,238,1138,480 --live --video_queue 4 --fps 30 --no-osd rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
                        [10:58:32.033] [LOG]    Starting PM2 for omx_stream1
                        [10:58:43.404] [LOG]    PM2 started for omx_stream1
                        

                        Are there any errors in config.js?

                        		{
                        		   module: "MMM-RTSPStream",
                        		   //position: "middle_center",
                        		   pages: {Security: "middle_center"},
                        		   header: "Test",
                        		   config: {
                        				autoStart: true,
                        				rotateStreams: false,
                        				rotateStreamTimeout: 10,
                        				moduleWidth: 354,
                        				moduleHeight: 240,
                        				localPlayer: 'omxplayer',
                        				remotePlayer: 'none',
                        				showSnapWhenPaused: false,
                        				remoteSnaps: false,
                        				stream1: {
                        					name: 'BigBuckBunny',
                        					url: 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov',
                        					frameRate: 'undefined',
                        					width: undefined,
                        					height: undefined,
                        						},
                        					}
                        		},
                        

                        Thanks for your patience!

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

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

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

                          the link works in VLC but still doesn’t work in MM

                          Hi,

                          What does this say ?

                          pm2 logs --lines 100
                          

                          The part where you should see

                          0|MagicMirror  | Starting stream stream1 with args: [
                          

                          And

                          pm2 status
                          

                          should show

                          omx_stream1
                          

                          And can you try it from the command line ?

                          omxplayer --genlog --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win "0 0 354 240" rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
                          

                          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)

                          E 1 Reply Last reply Reply Quote 0
                          • E Offline
                            Egnos @evroom
                            last edited by Egnos

                            Hi @evroom ,

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

                            What does this say ?
                            pm2 logs --lines 100

                            I never posted this …!

                            I launched the command on the terminal you recommended but I still don’t see anything, here is the result:

                            pi@MagicMirror:~ $ omxplayer --genlog --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win "0 0 354 240" rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
                            Video codec omx-h264 width 240 height 160 profile 578 fps 30.000000
                            Audio codec aac channels 2 samplerate 12000 bitspersample 16
                            Subtitle count: 0, state: off, index: 1, delay: 0
                            V:PortSettingsChanged: 240x160@30.00 interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0
                            
                            

                            And this the log “omxplayer.log”:
                            omxplayer.log

                            I paste all the info that the MM prints on the terminal:

                            > magicmirror@2.10.1 start /home/pi/MagicMirror
                            > ./run-start.sh
                            
                            [19:45:33.744] [LOG]    Starting MagicMirror: v2.10.1
                            [19:45:33.792] [LOG]    Loading config ...
                            [19:45:33.805] [LOG]    Loading module helpers ...
                            [19:45:37.253] [LOG]    Initializing new module helper ...
                            [19:45:37.255] [LOG]    Module helper loaded: MMM-RTSPStream
                            [19:45:37.256] [LOG]    All module helpers loaded.
                            [19:45:37.257] [LOG]    Starting server on port 8080 ... 
                            [19:45:37.346] [LOG]    Server started ...
                            [19:45:37.348] [LOG]    Connecting socket for: MMM-RTSPStream
                            [19:45:37.350] [LOG]    PM2: Stopping all OMXPlayer Streams...
                            [19:45:37.352] [LOG]    Sockets connected & modules started ...
                            [19:45:38.246] [LOG]    Launching application.
                            [19:45:46.329] [LOG]    Starting stream stream1 using: omxplayer --avdict rtsp_transport:tcp --win 786,238,1138,480 --live --video_queue 4 --fps 30 --no-osd rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
                            [19:45:46.426] [LOG]    Starting PM2 for omx_stream1
                            [19:45:53.630] [LOG]    PM2 started for omx_stream1
                            
                            

                            I don’t understand what’s missing…

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

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

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

                              I don’t understand what’s missing…

                              It does look good.

                              In principle, the line from the pm2 log

                              [19:45:46.329] [LOG]    Starting stream stream1 using: omxplayer --avdict rtsp_transport:tcp --win 786,238,1138,480 --live --video_queue 4 --fps 30 --no-osd rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
                              

                              should work as standalone.
                              If it does not play standalone, so from the command line, then it will not work in MMM-RTSPStream.

                              I would disable the module and make sure nothing is running anymore (no omxplayer stuff).

                              module: "MMM-RTSPStream",
                              disabled: true,
                              
                              pm2 restart mm
                              pm2 status
                              

                              Make sure ‘omx_stream1’ is not present.
                              Stop it when necessary

                              pm2 stop omx_stream1
                              pm2 delete omx_stream1
                              
                              ps -eaf | grep -v grep | grep omxplayer
                              

                              Kill any omxplayer process (kill -9 ).

                              Then run omxplayer from command line:

                              omxplayer --avdict rtsp_transport:tcp --win 786,238,1138,480 --live --video_queue 4 --fps 30 --no-osd rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
                              

                              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)

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

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

                                Are there any errors in config.js?

                                This is my config that works.
                                I think the only real difference is the omxRestart entry.

                                {
                                  module: "MMM-RTSPStream",
                                  disabled: false,
                                  position: "bottom_right",
                                  header: "MMM-RTSPStream Test",
                                  config: {
                                    autoStart: true,
                                    omxRestart: 1,
                                    rotateStreams: false,
                                    moduleWidth: "352px", // Width in px of the module.
                                    moduleHeight: "240px", // Height in px of the module.
                                    localPlayer: 'omxplayer',
                                    remotePlayer: 'none',
                                    showSnapWhenPaused: false,
                                    remoteSnaps: false,
                                    stream1: {
                                      name: 'BigBuckBunny',
                                      url: 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov',
                                      frameRate: "25",
                                      protocol: "tcp",
                                      width: "352px", // The width in px of the stream.
                                      height: "240px", // The height in px of the stream.
                                    }
                                  }
                                },
                                

                                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)

                                E 1 Reply Last reply Reply Quote 0
                                • E Offline
                                  Egnos @evroom
                                  last edited by

                                  @evroom many thanks!
                                  I don’t know why but now I’m viewing the video in MM.
                                  I haven’t touched anything!

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

                                  1 Reply Last reply Reply Quote 0
                                  • E Offline
                                    Egnos @evroom
                                    last edited by

                                    @evroom I finally understood what the problem is … that is VNC.
                                    I use VNC to connect with the Raspberry PI and for some reason, using the VNC interface, the player is not displayed!
                                    If instead I turn on the monitor where the Raspberry PI is physically connected I magically see the streaming … whether I run the command from the terminal or with the MM.

                                    Can you explain this behavior?

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

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

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

                                      Can you explain this behavior?

                                      No, I cannot explain this, but I noticed it too.
                                      No video over the VNC connection.

                                      When I google, I see this recommendation:

                                      Open VNC Server>Options>Troubleshooting. Then make sure "enable experimental direct capture mode is checked.

                                      You might give it a try.

                                      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)

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

                                        hello,lil help,what do i have to add in custom.css to align MMM-RTSPStream window with the module below?
                                        https://imgur.com/XQZNEvg

                                        1 Reply Last reply Reply Quote 0
                                        • 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

                                            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