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.
    • B Offline
      bill22
      last edited by

      @evroom

      Hi and good evening!

      Looks i get the same as you:

      /usr/bin/omxplayer --version
      

      I get:

      omxplayer - Commandline multimedia player for the Raspberry Pi
              Build date: Fri, 07 Jun 2019 19:49:22 +0000
              Version   : f06235c [master]
              Repository: https://github.com/popcornmix/omxplayer.git
      
      /usr/bin/omxplayer --info --hw --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win '6351 968 703 1210' rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov
      

      I get:

      Input #0, rtsp, from 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov':
        Metadata:
          title           : BigBuckBunny_115k.mov
        Duration: 00:09:56.48, start: 0.000000, bitrate: N/A
          Stream #0:0: Audio: aac (LC), 12000 Hz, stereo, fltp
          Stream #0:1: Video: h264 (Constrained Baseline), yuv420p(progressive), 240x160, 24 fps, 24 tbr, 90k tbn, 48 tbc
      have a nice day ;)
      
      evroomE 1 Reply Last reply Reply Quote 0
      • evroomE Offline
        evroom @bill22
        last edited by

        @bill22
        Looks like you are doomed to watch Buck Bunny for the rest of your Magic Mirror life :-)

        You did not get an error with — hw in your previous mail.
        It did return with the prompt, right ?
        You did not have to stop it using control C, I mean to say?
        Normally omxplayer exits with: have a nice day ; )

        Can you try

        /usr/bin/omxplayer --genlog --hw --win '351 968 703 1210' rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803
        

        And check the log file.

        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
        • B Offline
          bill22
          last edited by

          @evroom

          Hopefully not…! we may need to find another one if we cannot fix it… :-)

          No i didn’t stop it using control C.

           /usr/bin/omxplayer --genlog --hw --win '351 968 703 1210' rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803
          

          returns:

          [1] 1897
          [2] 1898
          [3] 1899
          [4] 1900
          [5] 1901
          [6] 1902
          [7] 1903
          [2]   Fertig                  freq=394
          [4]   Fertig                  msys=dvbc
          

          Log shows:
          17:08:24 T:2113103317 DEBUG: DllBcm: Using omx system library
          17:08:24 T:2113104714 DEBUG: DllOMX: Using omx system library
          17:08:24 T:2113105528 DEBUG: DllAvFormat: Using libavformat system library
          17:08:24 T:2113107746 DEBUG: DBus connection succeeded

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

            @bill22

            Okay, I think it is stumbling over the ampersands in your RTSP URL.
            Try it with the RTSP part single quoted, like:

            $ /usr/bin/omxplayer --genlog --hw --win '351 968 703 1210' 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
            

            Quotes work in general. Tested it on friend Buck Bunny.

            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
            • B Offline
              bill22
              last edited by bill22

              @evroom

              Allright! :thumbs_up:

              i have a picture overlay with the omxplayer showing the live stream TV signal!

              Unfortunately it runs for a second and stops, continuously . > (buffer, cache,…?)

              Audio is not there correctly. It sounds like white noise for a second and stops continuously.

              1 Reply Last reply Reply Quote 0
              • B Offline
                bill22
                last edited by

                @evroom

                FYI:

                /usr/bin/omxplayer --genlog --hw --win '351 968 703 1210' 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
                

                shows:

                Video codec omx-mpeg2 width 720 height 576 profile 4 fps 25.000000
                Audio codec mp2 channels 2 samplerate 48000 bitspersample 16
                Subtitle count: 1, state: off, index: 1, delay: 0
                V:PortSettingsChanged: 720x576@25.00 interlace:3 deinterlace:1 anaglyph:0 par:1.42 display:0 layer:0 alpha:255 aspectMode:0
                
                evroomE 1 Reply Last reply Reply Quote 0
                • evroomE Offline
                  evroom @bill22
                  last edited by

                  @bill22
                  Getting somewhere.
                  Now you need to slowly add additional parameters.
                  Like --live --video_queue 4

                  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
                  • B Offline
                    bill22
                    last edited by bill22

                    i might be wrong. I added it here and received the error message “…file not found”:

                    /usr/bin/omxplayer --genlog --hw --win --live --video_queue 4 '351 968 703 1210' 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
                    

                    Do i need to add those parameters somewhere else?

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

                      @bill22

                      /usr/bin/omxplayer --genlog --hw --live --video_queue 4 --win '351 968 703 1210' 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
                      

                      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
                      • B Offline
                        bill22
                        last edited by bill22

                        @evroom

                        Thanks!
                        OK, positive effect on the video, running pretty smooth now!
                        Audio still missing…

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

                          @bill22
                          With Buck Bunny you had audio, right?
                          Audio over hdmi or audio jack?

                          Try adding --audio_queue 4
                          Then try removing --hw

                          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
                          • B Offline
                            bill22
                            last edited by

                            @evroom

                            yes with Buck Bunny the audio was there.

                            I use audio over HDMI.

                            adding

                            --audio_queue 4
                            

                            didn’t change the behaviour .

                            removed

                            --hw
                            

                            Audio is working smoothly together with video ! !

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

                              @bill22
                              Great!!

                              Now you could try to enable the RTSPStream module again.
                              Use

                              url: ''rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'',
                              

                              It can be that you need to play a little.

                              single quote single quote < url > single quote single quote
                              double quote single quote < url > single quote double quote
                              single quote < url with & > single quote

                              I hope you understand what I mean.

                              Look at the pm2 log for clues.

                              Over and out for today.

                              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
                              • B Offline
                                bill22
                                last edited by bill22

                                @evroom

                                Thank you very much for your guidance getting it to this point !!!

                                Great that it is working so far!

                                Have a good evening and i will follow your recommendations and let you know the outcome!

                                Bill

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

                                  @bill22

                                  Try this

                                  url: 'rtsp://192.168.178.1:554/?avm=1\&freq=394\&bw=8\&msys=dvbc\&mtype=256qam\&sr=6900\&specinv=0\&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803',
                                  

                                  Perhaps even the ? needs to be escaped

                                  url: 'rtsp://192.168.178.1:554/\?avm=1\&freq=394\&bw=8\&msys=dvbc\&mtype=256qam\&sr=6900\&specinv=0\&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803',
                                  

                                  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
                                  • evroomE Offline
                                    evroom @bill22
                                    last edited by

                                    @bill22

                                    Here a procedure on how to use omxplayer as an addition to MM (without MMM-RTSPStream).
                                    This is how I use it for my Axis IP cam.
                                    You might need to reposition a few modules to make place for the overlaid stream.

                                    pi@MagicPi:~ $ cd
                                    
                                    pi@MagicPi:~ $ vi avm_stream.sh
                                    #!/bin/bash
                                    echo "Starting AVM stream ..."
                                    
                                    /usr/bin/omxplayer --genlog --live --video_queue 4 --win '351 968 703 1210' 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
                                    
                                    pi@MagicPi:~ $ chmod +x avm_stream.sh
                                    
                                    pi@MagicPi:~ $ pm2 start avm_stream.sh
                                    
                                    i@MagicPi:~ $ pm2 save
                                    
                                    i@MagicPi:~ $ pm2 status
                                    

                                    Instead of vi you of course can use nano or so.

                                    When it runs you can remove the --genlog option.
                                    And I kind of lost track which exact command worked for you at the end.

                                    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
                                    • B Offline
                                      bill22
                                      last edited by bill22

                                      The command working with the omx player is:

                                      /usr/bin/omxplayer --genlog --live --video_queue 4 --audio_queue 4 --win '1 720 503 1010' 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
                                      
                                      evroomE 1 Reply Last reply Reply Quote 0
                                      • evroomE Offline
                                        evroom @bill22
                                        last edited by

                                        @bill22

                                        MMM-RTSPStream modification for AVM DVB-C stream.

                                        $ vi ~/MagicMirror/config/config.js
                                        
                                                frameRate: "25",
                                                protocol: "tcp",
                                        
                                        
                                        	url: 'rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803'
                                        
                                        
                                        $ cd /home/pi/MagicMirror/modules/MMM-RTSPStream
                                        
                                        $ cp -p node_helper.js node_helper.js.original 
                                        
                                        $ nano node_helper.js
                                        

                                        Use [control]- (control minus) and enter 101 to go to line 101

                                                   var args = ["--live", "--video_queue", "4", "--fps", "30",
                                        

                                        Change the line to:

                                                  var args = ["--live", "--video_queue", "4", "--audio_queue", "4", "--fps", "25",
                                        

                                        Use [control]x and then Y to save the file.

                                        $ pm2 restart mm
                                        
                                        $ pm2 logs mm
                                        
                                        $ ps -eaf | grep omxplayer | grep -v grep
                                        
                                        $ pm2 status
                                        

                                        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
                                        • B Offline
                                          bill22
                                          last edited by

                                          @evroom

                                          it shows the following status after the modification:

                                          pi@raspberrypi:~ $ pm2 restart mm
                                          Use --update-env to update environment variables
                                          [PM2] Applying action restartProcessId on app [mm](ids: 1)
                                          [PM2] [mm](1) ✓
                                          ┌─────────────┬────┬──────┬─────────┬────┬─────┬──────────┐
                                          │ Name        │ id │ mode │ status  │ ↺  │ cpu │ memory   │
                                          ├─────────────┼────┼──────┼─────────┼────┼─────┼──────────┤
                                          │ avm_stream  │ 2  │ fork │ stopped │ 1  │ 0%  │ 0 B      │
                                          │ mm          │ 1  │ fork │ online  │ 1  │ 0%  │ 2.5 MB   │
                                          │ omx_stream1 │ 0  │ fork │ stopped │ 31 │ 0%  │ 0 B      │
                                          └─────────────┴────┴──────┴─────────┴────┴─────┴──────────┘
                                           Use `pm2 show <id|name>` to get more details about an app
                                          
                                          pi@raspberrypi:~ $ pm2 logs mm
                                          [TAILING] Tailing last 15 lines for [mm] process (change the value with --lines option)
                                          /home/pi/.pm2/logs/mm-error.log last 15 lines:
                                          1|mm       | npm ERR!     /home/pi/.npm/_logs/2019-07-09T20_38_42_696Z-debug.log
                                          1|mm       | 
                                          1|mm       | (electron:1742): Gtk-WARNING **: cannot open display: :0
                                          1|mm       | npm ERR! code ELIFECYCLE
                                          1|mm       | npm ERR! errno 1
                                          1|mm       | npm ERR! magicmirror@2.7.1 start: `sh run-start.sh`
                                          1|mm       | npm ERR! Exit status 1
                                          1|mm       | npm ERR! 
                                          1|mm       | npm ERR! Failed at the magicmirror@2.7.1 start script.
                                          1|mm       | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
                                          1|mm       | 
                                          1|mm       | npm ERR! A complete log of this run can be found in:
                                          1|mm       | npm ERR!     /home/pi/.npm/_logs/2019-07-09T20_38_45_348Z-debug.log
                                          1|mm       | ATTENTION: default value of option force_s3tc_enable overridden by environment.
                                          1|mm       | ATTENTION: default value of option force_s3tc_enable overridden by environment.
                                          
                                          /home/pi/.pm2/logs/mm-out.log last 15 lines:
                                          1|mm       |     "--avdict",
                                          1|mm       |     "rtsp_transport:tcp",
                                          1|mm       |     "--win",
                                          1|mm       |     "666, 393, 1018, 635",
                                          1|mm       |     "--live",
                                          1|mm       |     "--video_queue",
                                          1|mm       |     "4",
                                          1|mm       |     "--audio_queue",
                                          1|mm       |     "4",
                                          1|mm       |     "--fps",
                                          1|mm       |     "25",
                                          1|mm       |     "rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803"
                                          1|mm       | ]
                                          1|mm       | Starting PM2 for omx_stream1
                                          1|mm       | PM2 started for omx_stream1
                                          
                                          pi@raspberrypi:~ $ ps -eaf | grep omxplayer | grep -v grep
                                          pi        6325   813  0 23:17 ?        00:00:00 bash /usr/bin/omxplayer --avdict rtsp_transport:tcp --win 666, 393, 1018, 635 --live --video_queue 4 --audio_queue 4 --fps 25 rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803
                                          pi        6327  6325  0 23:17 ?        00:00:00 bash /usr/bin/omxplayer --avdict rtsp_transport:tcp --win 666, 393, 1018, 635 --live --video_queue 4 --audio_queue 4 --fps 25 rtsp://192.168.178.1:554/?avm=1&freq=394&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,266,593,594,595,598,1801,1802,1803
                                          
                                          pi@raspberrypi:~ $ pm2 status
                                          ┌─────────────┬────┬──────┬─────────┬─────┬─────┬──────────┐
                                          │ Name        │ id │ mode │ status  │ ↺   │ cpu │ memory   │
                                          ├─────────────┼────┼──────┼─────────┼─────┼─────┼──────────┤
                                          │ avm_stream  │ 2  │ fork │ stopped │ 1   │ 0%  │ 0 B      │
                                          │ mm                   │ 1  │ fork │ online  │ 1   │ 0%  │ 2.5 MB   │
                                          │ omx_stream1 │ 0  │ fork │ online  │ 117 │ 0%  │ 2.6 MB   │
                                          └─────────────┴────┴──────┴─────────┴─────┴─────┴──────────┘
                                           Use `pm2 show <id|name>` to get more details about an app
                                          
                                          evroomE 1 Reply Last reply Reply Quote 0
                                          • evroomE Offline
                                            evroom @bill22
                                            last edited by evroom

                                            @bill22

                                            Hi,

                                            Overall it looks good I would say.
                                            The ERR are a concern, but I do not see a connection with RTSP.
                                            Give the /home/pi/.npm/_logs/2019-07-09T20_38_42_696Z-debug.log and /home/pi/.npm/_logs/2019-07-09T20_38_45_348Z-debug.loga clue ?
                                            Or when you restart mm, the newly generated log files ?

                                            With $ ps -eaf | grep omxplayer | grep -v grepand pm2 status, are the PIDs for omxplayer and omx_stream1 stable, or do they change ?

                                            Could you do ?

                                            $ pstree -ap `pgrep omxplayer | head -1`; pstree -ap `pm2 status | grep omx_stream1 | awk '{print $10}'`
                                            

                                            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

                                            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
                                            • 11
                                            • 12
                                            • 13
                                            • 14
                                            • 15
                                            • 30
                                            • 31
                                            • 13 / 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