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.

    omxplayer overlay

    Scheduled Pinned Locked Moved Development
    19 Posts 4 Posters 9.8k Views 3 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.
    • M Offline
      maxbachmann
      last edited by

      since electron and videos really don´t work well together I want to use a overlay with omxplayer. Is there already a module doing this I just did not find?
      If not my idea was to show a black form with the size of the video on the screen, so the overlay is not above any other stuff. However I did not find out how to get the absolute position of a dom object, so I can give the position to omxplayer

      MrCoffeeM 1 Reply Last reply Reply Quote 0
      • A Offline
        AxLed Module Developer
        last edited by AxLed

        @maxbachmann
        Hi,

        MMM-Podcast is using OMX Player to show videos.

        AxLED

        1 Reply Last reply Reply Quote 0
        • M Offline
          maxbachmann
          last edited by

          @axled said in omxplayer overlay:

          MMM-Podcast

          Ah thx I think thats exactly what I searched for

          1 Reply Last reply Reply Quote 0
          • M Offline
            maxbachmann
            last edited by maxbachmann

            oh no thats exactly what I did already achieve. It just overlays omxplayer, without making sure there is nothing below then, so it will hide other informations on the screen.
            Thats what I wanted to achieve but I did not know how to make sure a area is actually clear the way it would be when I just directly show a video in MM2
            I mean for one video I can do it approximately, but would be nice to have a real solution instead of try and error xD

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

              Hi,

              There is MMM-RTSPStream too.
              Meant to stream video for camera’s, but it works for every RTSP stream.
              You can specify height and width, but the position is determined by the module position.
              Overlaying other modules depends on the position of those modules, but there is nothing that can’t be done using the custom.css.
              And you cannot get away with trial and error.
              It took me a while to get it pixel perfect…

              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 1
              • M Offline
                maxbachmann
                last edited by

                ok thats what I wanted to know :)
                so there is basically no really nice way to read the pixels you have to do it try an error

                1 Reply Last reply Reply Quote 0
                • M Offline
                  maxbachmann
                  last edited by

                  btw anyone knows how to set loop? I already tried multiple of the node omxplayer applications. They all have a loop function (well using it just stops after one run anyways)

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

                    I just tried MMM-RTSPStream and it loops the video without any extra options.
                    You also could just try to add --loop after the URL of the video.
                    When lucky it will be used as an omxplayer option.

                    As omxplayer uses a fixed position, relative to the position of the module, it might need a bit extra fiddling.
                    But with MMM-RTSPStream and the module options

                    moduleWidth: 900,
                    moduleHeight: 364,
                    

                    and the omxplayer options

                    width: 480,
                    height: 270
                    

                    you have the control over the overlay and overlapping that you need.
                    And with the custom.css you have additional options and control.

                    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
                    • M Offline
                      maxbachmann
                      last edited by

                      @evroom
                      Hm i Kind of fail to use it. When I use a config without url (I gave it a path to a local file)
                      showSnapsWhen paused is activated, I get this black window on the screen so the stream does not interfere with anything, however nothing is shown with omxplayer (autostartplay activated)
                      tried with mp4 and mov

                      so how do I properly use a local file then?

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

                        Can you try this config, just to know what works and what not ?

                         {
                            module: "MMM-RTSPStream",
                            disabled: false,
                            position: "middle_center",
                            header: "Video",
                            config: {
                              autoStart: true,
                              rotateStreams: false,
                              moduleWidth: 900,
                              moduleHeight: 364,
                              localPlayer: 'omxplayer',
                              remotePlayer: 'none',
                              showSnapWhenPaused: false,
                              remoteSnaps: false,
                              stream1: {
                                name: 'BigBuckBunny Test Stream',
                                url: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov',
                                width: 480,
                                height: 270
                            },
                        }
                        

                        Height and width are perhaps a bit odd; is what I use for my camera streams.

                        I will look if streaming a local file is possible; never tried it.

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

                          For me this works:

                          url: '/home/pi/Videos/MoonEclipse.mp4',
                          

                          So no ‘rtsp:’.
                          But I do not know if this sets the right parameters for this purpose, are more suited for CAM streaming I suppose:

                          |mm       | Starting stream stream1 with args: [
                          1|mm       |     "--avdict",
                          1|mm       |     "rtsp_transport:tcp",
                          1|mm       |     "--win",
                          1|mm       |     "33, 620, 513, 890",
                          1|mm       |     "--live",
                          1|mm       |     "--video_queue",
                          1|mm       |     "4",
                          1|mm       |     "--fps",
                          1|mm       |     "30",
                          1|mm       |     "/home/pi/Videos/MoonEclipse.mp4"
                          1|mm       | ]
                          

                          Makes my Pi very slow too, but that is because I put the file on the SD, which is not a fast medium in my case.

                          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
                          • M Offline
                            maxbachmann
                            last edited by maxbachmann

                            ty I will try it

                            Ok I tried. Your first config worked perfectly fine when I tried and it showed me the video. However when I just swapped the url with a file path the way you said in your last post the omxplayer does not open it

                            1 Reply Last reply Reply Quote 0
                            • MrCoffeeM Offline
                              MrCoffee @maxbachmann
                              last edited by

                              @maxbachmann
                              I am just wondering…did you downgrade your electron to avoid activating openGL?
                              With openGL activated omxplayer ist not working anymore. Or did I get something wrong.
                              Sorry, it is not an answer for your question.

                              Thx
                              Mr.Coffee

                              1 Reply Last reply Reply Quote 0
                              • M Offline
                                maxbachmann
                                last edited by

                                Hm no I did not downgrade electron. I am really not that deap in the topic, but why does electron stop omxplayer from working? (at least in my case omxplayer still works, although it kind of does not work with local files for me for whatever reason)

                                MrCoffeeM 1 Reply Last reply Reply Quote 0
                                • MrCoffeeM Offline
                                  MrCoffee @maxbachmann
                                  last edited by

                                  @maxbachmann
                                  Seems like you do not have the latest version of MagicMirror installed.
                                  It is said “The latest versions of electron use an extreme amount of CPU power when no Open GL driver is loaded. This will result in an overheating Raspberry Pi.”
                                  Thats why I had to activate OpenGL which stops the omxplayer from working (it is not the electron).
                                  Enable the Open GL driver to decrease Electron’s CPU usage

                                  But it is off topic. So thank you so far.

                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    maxbachmann
                                    last edited by maxbachmann

                                    wait they screwed electron even more??
                                    What the heck is wrong with them I am already super annoyed they still use no hardware acceleration for videos

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

                                      To be honest, I do run MM 2.4.1, but did not activate OpenGL. That is to say, I commented out
                                      #dtoverlay=vc4-fkms-v3d
                                      The electron processes do not show extreme usage and the temperature is around 48 celsius (25 celsius room temperature).
                                      I have 2 camera streams running.

                                      And I fail to see the difference between streaming via a rtsp url and from the SD card.

                                      It just now pops up in my head; do you have the MPG2 license?
                                      Try this to see if it is enabled:

                                      # vcgencmd codec_enabled MPG2
                                      

                                      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
                                      • M Offline
                                        maxbachmann
                                        last edited by

                                        When not included by default I will definetly do not have it. Will try it when I am home later today.

                                        And yes I am confused whats the difference aswell. Especially because I can absolutely use omxplayer with a local file from the shell

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

                                          The MPG2 license I most probably needed in order to be able to stream the satellite TS stream.
                                          With the codec disabled, I am still able to play the .mov and .mp4 files.

                                          In general the rule applies: when you can play / stream a source using omxplayer from the command-line, you should be able to play that source via MM (as long as the module used passes the right omxplayer parameters).

                                          If you want to pursue the issue further, you can add the --genlog parameter in order to generate the omxplayer.log file:

                                          cd /MagicMirror/modules/MMM-RTSPStream
                                          $ vi node_helper.js
                                          
                                          Edit line 113:
                                          
                                          args.unshift("--genlog", "--avdict", "rtsp_transport:tcp");
                                          
                                          Restart MM.
                                          
                                          $ ls -als /home/pi/MagicMirror/omxplayer.log
                                          

                                          Perhaps this log will reveal why the file does not play.

                                          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 / 1
                                          • 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