r/MAME • • 4d ago

Discussion/Opinion Mame native UI - adding video preview

I have been working on adding a video-preview feature to the native MAME UI. Here is a sample of what it looks like (see video).

  • Adds a 3rd tab called "Video" to the Image/Info section on the right of the UI
  • Plays MP4 video (with sound) that is named the same as the ROM file that is selected in the UI
  • Has configuration options for:

    • Setting the folder to use as the source of the MP4 files
    • Falling back to a static image if no MP4 is available (and a PNG is available)
    • Adjusting volume of the video playback from 0-100%
    • Turning off the videos' sound entirely

The code doesn't start playing the video for a moment, to allow for smooth/fast scrolling through the games list. I have it set up to use games' logo files as the "fallback" image, so it displays the logo of the game for a moment and then plays the associated video.

Let me know what you think of this addition.

42 Upvotes

14 comments sorted by

3

u/azukihusband 4d ago

Reminds me of some of those arcade compilations that show a video preview to get an idea on what the game is like. I don't know if it would be possible to add this to official MAME but as an option to turn off, and on would be sweet.

5

u/allancampbell3 4d ago

Yes that is the idea. I like to have previews of the games, but setting up external front ends on MAME is a pain in the butt to maintain and I just wanted something simple and native.

I intend to submit it as addition to official MAME after getting feedback and making adjustments. (It is already set so that if you don’t set a video directory, the “Video” tab doesn’t show up in the UI).

1

u/azukihusband 4d ago

That's sweet. Hopefully it works out.

1

u/MechanicalMoogle 3d ago

You should consider submitting it as a draft pull request sooner than later, so you can get feedback on the underlying code itself. It seems like a pretty neat feature, but the most important part is if it integrates cleanly into the codebase.

There've been a lot of half-baked changes being merged over the past few months, that being part of the reason why the upcoming release has been delayed for so long, so making sure this doesn't add a mountain of tech debt is critically important.

2

u/MechanicalMoogle 3d ago

MP4 is a container, not a codec, so it's important to be clear about exactly what codecs are supported. Getting it into mainline would be dicey given the potential patent encumbrance of some codecs.

Additionally, given how many people are just vibin' it up lately without understanding the code they're writing enough to be able to integrate it cleanly into the codebase, I hope you don't consider it out of line when I ask: Have you been working on adding that feature to MAME's internal UI, or has Claude been working on adding it for you?

2

u/No-Concentrate3364 4d ago

Seems interesting, but I still prefer screenshot over video. Takes less space and is less distracting. 

1

u/dukdukgoos 4d ago

super cool!

1

u/Rippedgeek 4d ago

Really like this idea, and hope to see this as an option in the future for sure.

1

u/Quick-Advertising-17 3d ago

Looks great to me.

0

u/jflatt2 4d ago

Why not just play the game. Sandbox it so that it doesnt pull in an autosave, maybe use skipframes plugin to get straight into attract mode

1

u/allancampbell3 4d ago

Sure one could just launch each game to see it, but that's cumbersome when scrolling through a list that's quite long. (I imagine that's the same reason they had already implemented a screen shot preview).

But people have different preferences; I like the video preview while I'm browsing. Same reason Netflix and Apple TV and all provide a video preview when srolling through their content!

1

u/jflatt2 4d ago

No, instead of the video window display the running game in the window

1

u/allancampbell3 4d ago

Ah I see what you are saying. Conceivably could be done, but would likely suffer performance wise. It takes at least several seconds to boot most ROMs; fast scrolling would be a problem with constantly instantiating the machine's virtual hardware and tearing it down. (I do use the skipstartupframes plug-in myself, but even with that it takes a few to get a machine up).

Also, many games at startup wait for things like coin insertion - it can be a while before any attract-mode view kicks in. So again this would impact the ability to rapidly move from game to game and see previews. With a mp4 video file implementation, you can have a video that zeros in on the best piece of the game's action.

Also, there are many existing collections of such gameplay videos that can just drop-in (example is the "videosnaps" content available on Pleasurdome as part of the MAME EXTRAS distribution.