RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Help with Video On Shutdown

    Scheduled Pinned Locked Moved Help and Support
    shutdownsplashscreenvideos
    5 Posts 2 Posters 858 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.
    • O
      ObadiahJack
      last edited by

      Hey Everyone,

      I've been trying to get retropie to play a short video before shutting down the system ( with a length of ~ 10 seconds).

      I found this thread, however, this solution by u/tomhas10 does not work for me:

      https://www.reddit.com/r/RetroPie/comments/67u0xv/is_it_possible_to_play_a_videosound_before/

      I'm not sure why, but the system simply shuts down without playing the video.

      If I press f4 and type in:

      sudo omxplayer RetroPie/roms/shutdown/shutdown.mp4

      The system will play the video, so I believe the system is finding the file.

      I'm thinking that perhaps the system shuts down too quickly to play the video, at any rate, I'm truly stumped and would appreciate any ideas or solutions.

      Adding sleep 15, or something to prolong the script, doesn't seem to register either. I'm sure I'm simply making a rookie mistake, any tips would be appreciated.

      Cheers,

      BuZzB 1 Reply Last reply Reply Quote 0
      • BuZzB
        BuZz administrators @ObadiahJack
        last edited by

        @obadiahjack please provide a copy of the files you changed. What did you edit and how.

        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

        O 1 Reply Last reply Reply Quote 0
        • O
          ObadiahJack @BuZz
          last edited by

          @buzz

          Hey Buzz,

          I edited the file emulationstation.sh, found in

          opt/retropie/supplementary/emulationstation

          Currently, this is my code:

          #!/bin/sh
          
          esdir="$(dirname $0)"
          while true; do
              rm -f /tmp/es-restart /tmp/es-sysrestart /tmp/es-shutdown
              "$esdir/emulationstation" "$@"
              ret=$?
              [ -f /tmp/es-restart ] && continue
              if [ -f /tmp/es-sysrestart ]; then
                  rm -f /tmp/es-sysrestart
                  sudo reboot
                  break
              fi
              if [ -f /tmp/es-shutdown ]; then
                  rm -f /tmp/es-shutdown
                  sudo omxplayer -b RetroPie/roms/shutdown/shutdown.mp4
                  sudo poweroff
                  break
              fi
              break
          done
          exit $ret
          

          Essentially, going by the reddit thread above, I only had to add the one line

               sudo omxplayer -b RetroPie/roms/shutdown/shutdown.mp4
          

          Above " sudo poweroff" to play a video...However, this does not work for me.

          Any input would be appreciated.

          O 1 Reply Last reply Reply Quote 0
          • O
            ObadiahJack @ObadiahJack
            last edited by

            @obadiahjack

            It appears that this script works fine on earlier pis but not the pi4... hmmm, any ideas?

            O 1 Reply Last reply Reply Quote 0
            • O
              ObadiahJack @ObadiahJack
              last edited by

              @obadiahjack

              I ended up figuring out a round about solution, more details on this reddit thread for those looking:

              https://www.reddit.com/r/RetroPie/comments/l51c9g/playing_video_before_shutdown/

              My roundabout solution:

              As discussed with reddit user u/ben_theredonit, the pi4 fails to utilize the emulationstation.sh at the time of posting when shutting down. So editing emulationstation.sh, will not work to play a video before shut down. I solved the problem through a roundabout solution. I found a shutdown button that can be added via the carousel, developed by Steve Smith. Below is his video and in his YouTube description, his files:

              The user Lampros in the youtube comments has a guide to install, if you find yourself getting the permission denied error, as many people in the comments have, I fixed mine by simply typing "sudo" in front of the "chmod +x" command

              From there, I simply changed the 'rom' shutdown script adding the "sudo omxplayer RetroPie/roms/shutdown/shutdown.mp4" code and it worked.

              Big thanks to reddit user u/ben_theredonit, who offered their help.

              I hope this helps anyone that was lost as I was when trying to add a shutdown video.

              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.