Loading Rom completely while displaying video splash
-
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:
- create a textfile named runcommand-onstart.sh in /retropie/configs/all
- 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 &
exitThe 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
-
@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?
-
@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 -
@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.
-
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.
-
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).
-
@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... -
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.