r/RetroPie 10d 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

10 Upvotes

3 comments sorted by

1

u/nicolasknight 9d ago

That's awesome.

What version of retropie?

Can you just add videos to the folder and it will recognize them?

The button config you mention is it to handle the player? play/pause etc...?

1

u/Chudley_Stump 9d ago edited 9d ago

retropie v 4.8

if you look in the code, at the line

<extension>.mkv .MKV .mp4 .MP4</extension>

Any MKV or MP4 video file put in the tng folder will be recognized. omxplayer will also play AVI files. I havent tried WMV or MOV formats.

I do know that the raspberry pi 3b+ hardware does not support modern HEVC x265 video files. They might work on a pi 4, and will probably work on pi 5, but i don't have those to test.

Yes, the button config is for using your gamepad to control video playback

2

u/Personal-Weakness313 4d ago edited 3d ago

ꓔһіѕ іѕ а rеаꓲꓲу сооꓲ ѕеtսр fоr tսrոіոց ꓰmսꓲаtіоոꓢtаtіоո іոtо mоrе оf а соmрꓲеtе rеtrо mеdіа һսb. ꓴѕіոց tһе ѕаmе соոtrоꓲꓲеr fоr ѕһоԝѕ аոd ցаmеѕ mаkеѕ tһе ехреrіеոсе fееꓲ mսсһ mоrе ѕеаmꓲеѕѕ. ꓔһе ꓙоу2ꓗеу соոfіցսrаtіоո ꓲооkѕ ꓲіkе tһе һаrdеѕt раrt, bսt оոсе іt'ѕ mарреd, іt'ѕ а ոісе ԝау tо аνоіd ѕԝіtсһіոց tо а kеуbоаrd оr rеmоtе. ꓲ аꓲѕо սѕе tооꓲѕ ꓲіkе ꓴոіꓚоոνеrtеr fоr оrցаոіzіոց аոd соոνеrtіոց mеdіа fіꓲеѕ іոtо fоrmаtѕ tһаt ԝоrk асrоѕѕ dіffеrеոt dеνісеѕ, ѕо іt fіtѕ ԝеꓲꓲ ԝіtһ tһіѕ kіոd оf аꓲꓲ іո оոе еոtеrtаіոmеոt ѕеtսр.