MMM-RTSPStream not showing video



  • So, I am at my wits end with this, and am fairly certain that I am losing more hair than I should over this issue. So I have the module installed, all dependencies installed and I have tried a lot of different config settings to get this to work.

    My current config section looks like this:

    {
                               module: 'MMM-RTSPStream',
                               position: 'middle_center',
                               config: {
                                   autoStart: true,
                                   rotateStreams: false,
                                   showSnapWhenPaused: false,
    //                              moduleWidth: 354,
    //                              moduleHeight: 242,
                                                   localPlayer: 'omxplayer',
                                   stream1: {
                                       name: 'Cam1',
                                       url: 'rtsp://admin:*******@192.168.1.242',
                           snapshotUrl: '',
                           snapshotRefresh: 10, // Seconds
                           frameRate: "30",
                           port: 9999,
                                        }
                               }
                     },
    

    With this setup I get a white box with no video.

    Here are my logs from pm2:

    pi@raspberrypi:~/MagicMirror/config $ rm /home/pi/.pm2/logs/*
    pi@raspberrypi:~/MagicMirror/config $ pm2 start mm
    [PM2] Applying action restartProcessId on app [mm](ids: 0)
    [PM2] [mm](0) ✓
    [PM2] Process successfully started
    ┌─────────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬──────────┬──────┬──────────┐
    │ App name    │ id │ version │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem      │ user │ watching │
    ├─────────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤
    │ mm          │ 0  │ N/A     │ fork │ 11239 │ online │ 0       │ 0s     │ 0%  │ 2.5 MB   │ pi   │ disabled │
    │ omx_stream1 │ 1  │ N/A     │ fork │ 11224 │ online │ 10841   │ 0s     │ 0%  │ 2.7 MB   │ pi   │ disabled │
    └─────────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴──────────┴──────┴──────────┘
     Use `pm2 show ` to get more details about an app
    pi@raspberrypi:~/MagicMirror/config $ pm2 logs
    [TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
    /home/pi/.pm2/pm2.log last 15 lines:
    PM2        | 2019-02-08T21:39:50: PM2 log: App [mm:0] online
    PM2        | 2019-02-08T21:39:53: PM2 log: App [omx_stream1:1] exited with code [1] via signal [SIGINT]
    PM2        | 2019-02-08T21:39:53: PM2 log: App [omx_stream1:1] starting in -fork mode-
    PM2        | 2019-02-08T21:39:53: PM2 log: App [omx_stream1:1] online
    PM2        | 2019-02-08T21:39:56: PM2 log: App [omx_stream1:1] exited with code [1] via signal [SIGINT]
    PM2        | 2019-02-08T21:39:56: PM2 log: App [omx_stream1:1] starting in -fork mode-
    PM2        | 2019-02-08T21:39:56: PM2 log: App [omx_stream1:1] online
    PM2        | 2019-02-08T21:40:00: PM2 log: Stopping app:omx_stream1 id:1
    PM2        | 2019-02-08T21:40:00: PM2 log: pid=11336 msg=failed to kill - retrying in 100ms
    PM2        | 2019-02-08T21:40:00: PM2 log: pid=11336 msg=failed to kill - retrying in 100ms
    PM2        | 2019-02-08T21:40:00: PM2 log: pid=11336 msg=failed to kill - retrying in 100ms
    PM2        | 2019-02-08T21:40:00: PM2 log: pid=11336 msg=failed to kill - retrying in 100ms
    PM2        | 2019-02-08T21:40:00: PM2 log: pid=11336 msg=failed to kill - retrying in 100ms
    PM2        | 2019-02-08T21:40:00: PM2 log: App [omx_stream1:1] exited with code [1] via signal [SIGINT]
    PM2        | 2019-02-08T21:40:00: PM2 log: pid=11336 msg=process killed
    
    /home/pi/.pm2/logs/omx-stream1-error.log last 15 lines:
    /home/pi/.pm2/logs/mm-error.log last 15 lines:
    /home/pi/.pm2/logs/mm-out.log last 15 lines:
    0|mm       | Module helper loaded: MMM-RTSPStream
    0|mm       | All module helpers loaded.
    0|mm       | Starting server on port 8080 ...
    0|mm       | Server started ...
    0|mm       | Connecting socket for: updatenotification
    0|mm       | Connecting socket for: calendar
    0|mm       | Starting node helper for: calendar
    0|mm       | Connecting socket for: newsfeed
    0|mm       | Starting module: newsfeed
    0|mm       | Connecting socket for: MMM-RTSPStream
    0|mm       | PM2: Stopping all OMXPlayer Streams...
    0|mm       | Sockets connected & modules started ...
    0|mm       | Launching application.
    0|mm       | PM2: Checking if omx_stream1 is running...
    0|mm       | PM2: Stopping omx_stream1...
    
    0|mm  | Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/US-Holidays.ics - Interval: 300000
    0|mm  | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/vonarstonehelm%40gmail.com/public/basic.ics - Interval: 300000
    0|mm  | Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
    0|mm  | Starting stream stream1 using: omxplayer --avdict rtsp_transport:tcp --win 624,302,976,544 --live --video_queue 4 --fps 30 --no-osd rtsp://admin:jeffrey69@192.168.1.242
    0|mm  | Starting PM2 for omx_stream1
    PM2      | App [omx_stream1:1] starting in -fork mode-
    PM2      | App [omx_stream1:1] online
    0|mm     | PM2 started for omx_stream1
    1|omx_stream1  | have a nice day ;)
    PM2            | App [omx_stream1:1] exited with code [1] via signal [SIGINT]
    PM2            | App [omx_stream1:1] starting in -fork mode-
    PM2            | App [omx_stream1:1] online
    1|omx_stream1  | have a nice day ;)
    PM2            | App [omx_stream1:1] exited with code [1] via signal [SIGINT]
    PM2            | App [omx_stream1:1] starting in -fork mode-
    PM2            | App [omx_stream1:1] online
    

    Clearly there is an issue with omx, however I can’t seem to find a reason why it is quitting and restarting, and I can’t seem to find where omx sends its logs. I also know the stream works because I can copy/paste that into VLC and it plays just fine.

    Suggestions? Recommendations?

    Thank you in advance

    edit: double checked the stream in VLC and the codec is h264 - mpeg-4 avc (part 10) (h264). Not sure if this matters or not.



  • @vonarstonehelm

    Hi,

    it is has been some time since I used MMM-RTSPStream, but you can try following and provide some more info.

    $ which omxplayer
    
    $ vcgencmd codec_enabled MPG2
    

    omxplayer only logs when asked for (–genlog).

    Try running omxplayer from the command line first:

    $ cd
    $ rm -f omxplayer.log
    
    $ omxplayer --genlog --win "0 0 800 480" rtsp://admin:*******@192.168.1.242
    
    or:
    
    $ omxplayer --genlog --avdict rtsp_transport:tcp --live --video_queue 4 --fps 30 --win "0 0 800 480" rtsp://admin:*******@192.168.1.242
    
    $ ls -als omxplayer.log
    
    $ sudo find . -name omxplayer.log
    

    And it appears you have a few mistakes / omitted parameters in your config.js:

    moduleWidth: 590,
    moduleHeight: 332,
    
    ffmpegPort: 9999,
    
    width: 590,
    height: 332,
    

    port: 9999, is not a valid parameter.

    Furthermore, your URL seems a bit basic, but that probably depends on the camera.
    For example, for my Axis camera I need this:

    rtsp://user:password@192.168.178.56/axis-media/media.amp?resolution=640x360
    


  • I suspect you’re not addressing the video correctly.

    https://www.ispyconnect.com/sources.aspx - check your camera model for full URLs.



  • @bkeyport Actually found a workaround using iframe and a HLS stream from blue iris. Have a new issue now that I am trying to figure out.