RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Loading Rom completely while displaying video splash

    Scheduled Pinned Locked Moved Ideas and Development
    runcommand-onstload screenvideo splash
    8 Posts 6 Posters 1.8k Views
    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.
    • F
      Fummlah
      last edited by Fummlah

      Hi everybody.

      First I want to thank y'all for all sharing all those ideas an experiences. Finally finishing my bartop I was looking for a possibilty to display a custom loading-screen-video while loading a game with Emulationstation.

      I found the runcommand-onstart.sh option for displaying images on start. This could easily be changed to play videos:

      1. create a textfile named runcommand-onstart.sh in /retropie/configs/all
      2. Add a single line: omxplayer -o both -b --layer 10001 /path/to/video.mp4

      I nearly liked it. But i recognized the game didn't start loading bevor the video finished playing. I am really not into Linux bash scripting but found the discription of background processing (https://likegeeks.com/linux-bash-scripting-awesome-guide-part5/). It say a process can be started as a parallel task. So the script wont "wait" for the process to finish before continuing. Anyway here is the code I use now:

      nohup omxplayer -o both -b --layer 10001 /path/to/video.mp4 &
      exit

      The Video will be displayed like an overlay covering the contens on the screen. If the video playtime matches the games loading/preloading time the result is a game start right after the custom video.

      known requirements:

      • disable "Launch Menu Art"
      • disable ingame menu (the one you can start by pressing a button right bevor loading a game)
      • don't put launching.png in /opt/retropie/configs/your emulator/

      The displaying of the video is actually interrupted by a tiny moment of blackscreen after 2-3 seconds. I couldn't find the reason for it yet. It might be something in the loading process of the game causing omx-player to show blackscreen for a couple frames..anyway I am happy with that solution.

      Happy tweaking

      ClydeC ExarKunIvE 2 Replies Last reply Reply Quote 1
      • ClydeC
        Clyde @Fummlah
        last edited by

        @Fummlah Nice idea! I dream about something like this for the Launch Menu Art for a long time now (i.e. a static image I use to show the game's flyer or box art). Could you point me in the right direction on how to modify your solution for that, please?

        ClydeC 1 Reply Last reply Reply Quote 0
        • ExarKunIvE
          ExarKunIv @Fummlah
          last edited by

          @Fummlah thats sweet. was always wondering if there was a way to do just that.
          ill have to give it a shot when i have a chance

          RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
          RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
          Maintainer of RetroPie-Extra .

          1 Reply Last reply Reply Quote 0
          • ClydeC
            Clyde @Clyde
            last edited by

            @Clyde said in Loading Rom completely while displaying video splash:

            I dream about something like this for the Launch Menu Art for a long time now (i.e. a static image I use to show the game's flyer or box art).

            And, after a little research, I found a extremely simple solution. To avoid cluttering this thread, I opened another with due credit to yours: Loading ROM completely while displaying launch image

            I chose the nearly identical title, because the given task is nearly the same (just with images instead of videos). If you don't like it, I'd be happy to change it on a short notice. Thanks for the inspiration and motivation to finally do this.

            1 Reply Last reply Reply Quote 0
            • roslofR
              roslof
              last edited by roslof

              I wager there is a way to intercept the ROM name being loaded. If so, there must be a way to load an MP4 in a scraped folder (like ./media/videos).

              For instance, if you tried to load "pacman123.zip" and could isolate "pacman123" -- then if you have a corresponding "pacman123.mp4" file in a separate folder, there's probably a way to load it. That way, each ROM may have its own video if desired.

              I'm not quite savvy enough to figure this out, but I would wager this is possible with some clever command-line work.

              roslofR 1 Reply Last reply Reply Quote 0
              • roslofR
                roslof @roslof
                last edited by roslof

                Okay, the variation below works (will pull a video based on the name of the ROM) but relies on an absolute path:

                nohup omxplayer -o both -b --layer 10001 "/home/pi/RetroPie/roms/arcade/media/videos/$(ps a | grep RetroPie/roms | awk -F "/" 'NR==1 { print $NF }' | sed 's/\.[^.]*$//g; s/\\//g')".mp4 &
                exit
                

                This assumes a ROM being launched from /RetroPie/roms/arcade has a corresponding video in /Retropie/roms/media/videos.

                I tried relative paths like "./media/videos" but it didn't actually work as expected. I think this is close... Will keep looking into it, unless somebody beats me to it.

                FWIW: The magic here came from a previously posted command-line from @mitu who worked with Clyde to create a command-line for capturing screenshots with TriggerHappy. I figured this would work, but again, I'm still a bit junior (thus can't find a way to handle the path yet).

                jandalf81J 1 Reply Last reply Reply Quote 0
                • jandalf81J
                  jandalf81 @roslof
                  last edited by

                  @roslof Take a look at https://retropie.org.uk/docs/Runcommand/#runcommand-onstart-and-runcommand-onend-scripts
                  There's an easy way to get the name of the ROM and more. I'd look at the parameter $3 and create the path to the video from that with some BaSh magic...

                  cyperghostC 1 Reply Last reply Reply Quote 1
                  • cyperghostC
                    cyperghost @jandalf81
                    last edited by

                    @jandalf81 Indeed :)
                    @roslof Or ask the forum seach engine

                    https://retropie.org.uk/forum/post/170818
                    https://retropie.org.uk/forum/post/150918
                    https://retropie.org.uk/forum/post/144863
                    https://retropie.org.uk/forum/post/124474

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                    Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.