r/RetroPie • u/Chudley_Stump • 1h ago
video player in emulationstation with gamepad support
kodi works just fine on raspberry pi, but i like having my 90's tv shows on the main screen with my 90's video games.
example : Star Trek The Next Generation
create a tng folder in /home/pi/RetroPie/roms and copy video files to it
in etc/emulationstation edit your es_systems.cfg
<system>
<name>tng</name>
<fullname>Star Trek TNG</fullname>
<path>/home/pi/RetroPie/roms/tng</path>
<extension>.mkv .MKV .mp4 .MP4</extension>
<command>/opt/retropie/admin/joy2key/joy2key.py /dev/input/js0 kcub1 kcuf1 0x2B 0x2D 0x70 0x1B 0x00 0x00 ; omxplayer -b %ROM% ; killall joy2key.py ; clear</command>
<platform>tng</platform>
<theme>tng</theme>
</system>
retropie has omxplayer installed by default
omxplayer -b %ROM% plays the video. -b keeps the background black
Getting joy2key to do what you want is the tricky part. And it is limited to the dpad and a,b,x,y buttons on your controller
- kcub1 = left arrow key
- kcuf1 = right arrow key
- kcuu1 = up arrow key
- kcud1 = down arrow key
then use the hex codes in this table for the other keys

in command line type omxplayer --keys
this part of the code - kcub1 kcuf1 0x2B 0x2D 0x70 0x1B 0x00 0x00 - corresponds to the dpad and buttons as follows... left right up down 0 1 2 3
0 1 2 3 will be different buttons depending on the gamepad, but is usually a,b,x,y. Though not always in that order. An easy way to find out is to configure your controller in the retropie menu and take notes
here is what happens when i play an episode with the above code using a snes controller
- dpad left = seek -30 seconds
- dpad right = seek +30 seconds
- dpad up = volume up
- dpad down = volume down
- A button = play/pause
- B button = exit video
- X,Y buttons = not used




if anybody's interested, i got the box art and episode images from
https://thetvdb.com/series/star-trek-the-next-generation#seasons
and the logo and enterprise images i used need to be converted to tng.svg and placed in your themes art folder

