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

    Game launching video loading screens

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstatiolaunchingimageslaunchingvideos
    123 Posts 8 Posters 31.0k 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.
    • D
      dmmarti
      last edited by dmmarti

      @cyperghost

      Works like a charm!

      Your updates to the script have greatly simplified the whole process now.

      Thank you!


      (I've also updated the main post above with the new method).

      Thanks to @cyperghost's help, here is the easy way to get this done.

      1. edit the runcommand-onstart.sh and add the lines below to it
      2. create the videoloadingscreens folder
      3. add MP4 files

      Add these lines to the runcommand-onstart.sh script.

       # Extract file name from called ROM
       gname="$(basename "$3")"
       # build path to file and remove extension from ROM to add mp4 extension
       # $HOME variable will help users that are not stick to raspberry ;)
       ifgame="$HOME/RetroPie/videoloadingscreens/${gname%.*}.mp4"
       ifsystem="$HOME/RetroPie/videoloadingscreens/$1.mp4"
       default="$HOME/RetroPie/videoloadingscreens/default.mp4"
      
       # If condition to check filename with -f switch, f means regular file
       if [[ -f $ifgame ]]; then
           omxplayer "$ifgame" > /dev/null 2>&1
       elif [[ -f $ifsystem ]]; then
            omxplayer "$ifsystem" > /dev/null 2>&1
       elif [[ -f $default ]]; then
          omxplayer "$default" > /dev/null 2>&1
       fi
      

      There's no longer any need to create a duplicate copy of omxplayer. Just the runcommand-onstart.sh addition and then MP4 files.

      1 Reply Last reply Reply Quote 2
      • cyperghostC
        cyperghost
        last edited by

        @dmmarti No problem. We have a nice thread shell scripting topic powered by the insane @meleu there you can improve and test your scripting skills. For me it was an ignition to improve code styling and keep things simple. We have some real talented and helpfull people here in the forum. So take this chance if you want ;)

        1 Reply Last reply Reply Quote 0
        • S
          Seedname101
          last edited by Seedname101

          So I did this all on the retropie and I tried the newer code. Whenever I try to save it, a message pops up saying that I can't save it because access was denied. I already have "pkill -STOP mpg123" in runcommand because I put music in the selecting page.
          I am using a Rpi 3b on retropie 4.4.4
          I even tried moving the pkill thing down and It still didn't work

          D 1 Reply Last reply Reply Quote 0
          • D
            dmmarti @Seedname101
            last edited by

            @Seedname101
            The runcommand-onstart.sh file is owned by user "pi".

            As long as you are editing the file as user "pi" you shouldn't have any issues with file permissions. Also create the new videoloadingscreens folder as user "pi" and you should be good to go.

            S 1 Reply Last reply Reply Quote 0
            • S
              Seedname101 @dmmarti
              last edited by

              @dmmarti I was using that username. It worked a few weeks later. Thanks anyway!

              1 Reply Last reply Reply Quote 0
              • U
                Unboundclassic
                last edited by Unboundclassic

                @dmmarti and @cyperghost Do you guys think there's be a way to utilize a different audio driver, but use the same basic setup? So just point to a different drier? In my case I'm using an i2s sound board in a handheld build and I've made my own custom Runcommand videos that have sound. I believe it uses the ALSA driver. It has no access to the OMXplayer sytem. For reference here's what I'm running: Adafruit I2S Stereo Decoder - UDA1334A](https://learn.adafruit.com/adafruit-i2s-stereo-decoder-uda1334a/raspberry-pi-usage)

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

                  @Unboundclassic I2S should work you need to set a asound.cfg

                  U 1 Reply Last reply Reply Quote 0
                  • U
                    Unboundclassic @cyperghost
                    last edited by Unboundclassic

                    @cyperghost honestly I'm not familiar enough with what you're referring to to know what you're asking me to do. I have audio on the system, the games, and the Splashscreen video working well. Only thing not giving audio is the Runcommand videos as they appear to use OMXplayer.

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @Unboundclassic
                      last edited by

                      @Unboundclassic said in Game launching video loading screens:

                      Only thing not giving audio is the Runcommand videos as they appear to use OMXplayer.

                      Modify the play commands in the on-start script and set omxplayer to use alsa as the output device, i.e. replace all omxplayer commands with

                      omxplayer -o alsa <...rest of the parameters>
                      
                      U 1 Reply Last reply Reply Quote 0
                      • U
                        Unboundclassic @mitu
                        last edited by

                        @mitu Perfect! Thank you so much! I've been trying to figure this one out for a long time.

                        So for anyone wanting to run these Runcommand videos and have audio on an i2s sound board here's the script that worked for me.

                        # Extract file name from called ROM
                         gname="$(basename "$3")"
                         # build path to file and remove extension from ROM to add mp4 extension
                         # $HOME variable will help users that are not stick to raspberry ;)
                         ifgame="$HOME/RetroPie/videoloadingscreens/${gname%.*}.mp4"
                         ifsystem="$HOME/RetroPie/videoloadingscreens/$1.mp4"
                         default="$HOME/RetroPie/videoloadingscreens/default.mp4"
                        
                         # If condition to check filename with -f switch, f means regular file
                         if [[ -f $ifgame ]]; then
                             omxplayer -o alsa "$ifgame" > /dev/null 2>&1
                         elif [[ -f $ifsystem ]]; then
                              omxplayer -o alsa "$ifsystem" > /dev/null 2>&1
                         elif [[ -f $default ]]; then
                            omxplayer -o alsa "$default" > /dev/null 2>&1
                         fi
                        
                        U 1 Reply Last reply Reply Quote 0
                        • U
                          Unboundclassic @Unboundclassic
                          last edited by

                          Also here's the set of Runcommand videos I made for my Game Gear Pi if anyone wants to use them. I need to take some time and do HD versions at some point. Rookervik Style Runcommand Videos

                          1 Reply Last reply Reply Quote 0
                          • G
                            gus_sc
                            last edited by gus_sc

                            One of my pet peeves with this setup is the total loading time = Total video runtime + total game loading time.
                            My solution to this is making the call to omxplayer fork, and it immediately gets on with loading the game, "behind" the playing video.
                            Most of my (arcade) roms load faster then the usual runtime of the videos, but by the time I finish the video it's run throught he boot initialization and is asking for a coin.
                            If this also irks you:

                            (<any of the above calls>)&
                            

                            Since I don't use sound and I'm using a per-rom set of loading screens :

                            (omxplayer "$ifgame" > /dev/null 2>&1) &
                            
                            ClydeC 1 Reply Last reply Reply Quote 1
                            • ClydeC
                              Clyde @gus_sc
                              last edited by

                              @gus_sc I once tried this with launching images, but it created some irritant effects:

                              this will create a strange behavior of the keyboard's Enter key in the emulator, which is especially annoying in MAME's Tab menu: Pressing Enter will either exit the Emulator or do other strange things like running Emulation Station a second time. It seems like another terminal is running in the background that reacts to the keyboard inputs in the running game.

                              See https://retropie.org.uk/forum/topic/24671/loading-rom-completely-while-displaying-launch-image/ for the complete thread about it.

                              Does your method have any such effects?

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

                                Can Someone Please help me with this!?

                                Hi, I need help with getting game launching video loading screens to work on my
                                Raspberry 3B+ on Emulation Station. I'm new to this so can you help me step by step so I can learn how to do this on my own. The reason why I want help with this is, I followed the 3 steps, like step 1 create copy of omxplayer file, I typed cd/usr/bin then I typed sudo cp omxplayer omxplayer_silent, pressed enter, then I typed sudo nano omxplayer_silent. When I did this, this command worked. Then I scrolled down to the end of line like the directions tell me where it says, LD_LIBRARY_PATH="$OMXPLAYER_LIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" $OMXPLAYER_BIN “$@"

                                Then I typed the text that says,

                                LD_LIBRARY_PATH="$OMXPLAYER_LIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" $OMXPLAYER_BIN "$@" > /dev/null 2>&1

                                Then I press CTRL-X Press: Y Press: <enter> when I did this, this also worked. Then step 2 edit the runcommand-onstart.sh script, okay so I typed on the command line the commands and I pressed enter after each one, when I did this, this also worked. So I typed the lines:

                                enablevideolaunch="true"
                                if [[ $enablevideolaunch == "true" ]]; then
                                gname=echo $3 |cut -f7 -d "/" |sed 's/.\{4\}$//'
                                ifgame=ls "/home/pi/RetroPie/videoloadingscreens/${gname}.mp4" |wc -l
                                ifsystem=ls /home/pi/RetroPie/videoloadingscreens/$1.mp4 |wc -l

                                if [[ $ifgame > 0 ]];then
                                omxplayer_silent --blank "/home/pi/RetroPie/videoloadingscreens/${gname}.mp4"
                                elif [[ $ifsystem > 0 ]];then
                                omxplayer_silent --blank /home/pi/RetroPie/videoloadingscreens/$1.mp4
                                else
                                omxplayer_silent --blank /home/pi/RetroPie/videoloadingscreens/default.mp4
                                fi
                                fi

                                when I typed all the lines in the runcommand-onstart.sh then I pressed CTRL-X pressed Y pressed <enter>

                                When I did this, this also worked but when I get to step 3, this is what happens on step 3 create a new folder to store mp4 files. I typed the command cd /home/pi/Retropie then I pressed enter this step did'nt work for me all I get instead is a message that says,

                                -bash: cd/home/pi/Retropie: No such file or directory

                                when that did'nt work I tried typing the command mkdir videoloadingscreens that did'nt work either all I got was the message that says,

                                mkdir: cannot create directory videoloadingscreens file exists

                                this is the problem I'm having with trying to do this. I can't go beyond step 3 create a new folder to store mp4 files. Is it something I'm doing wrong? This is why I'm asking for someone to help me with this.....

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

                                  @pisces3988 According to the opening post, you don't have to copy omxplayer anymore:

                                  There's no longer any need to create a duplicate copy of omxplayer. Just the runcommand-onstart.sh addition and then MP4 files.

                                  As for your problem with cd, the directory's name is RetroPie with an upper case P. Linux' file and directory names are case sensitive, so Retropie is a different dir than RetroPie.

                                  mkdir: cannot create directory videoloadingscreens file exists

                                  That means just that: there already is a file or directory with this name. Any chance that you created it before? Can you cd into it?

                                  P ClydeC 2 Replies Last reply Reply Quote 0
                                  • P
                                    PISCES3988 @Clyde
                                    last edited by

                                    @clyde

                                    I can't remember if I did or not.

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

                                      @clyde said in Game launching video loading screens:

                                      Can you cd into it?

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

                                        @clyde
                                        Yeah I'll try, but what else do I type after cd

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

                                          @pisces3988 cd means "change directory". It's followed by the directory name or path to change into. So, cd videoloadingscreens will (try to) change into that directory.

                                          BUT since your cd /home/pi/RetroPie failed before, your mkdir videoloadingscreens (mkdir = make directory) very likely tried to create videoloadingscreens not in RetroPie like the instructions say, but in your user pi's home directory. So, let's try to do it right:

                                          cd /home/pi/RetroPie     # mind the upper case!
                                          mkdir videoloadingscreens
                                          

                                          If there are no error messages from these commands, go on with step 4.

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

                                            @clyde
                                            Thankyou clyde it worked, now what do I do?

                                            ClydeC 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.