Help with Video On Shutdown
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:
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.
@obadiahjack please provide a copy of the files you changed. What did you edit and how.
I edited the file emulationstation.sh, found in
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.
It appears that this script works fine on earlier pis but not the pi4... hmmm, any ideas?
I ended up figuring out a round about solution, more details on this reddit thread for those looking:
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.