AX-MediaPlayer - Cinder Block for Windows / macOS Video Playback

@rich.e Curious what it is about the provided cmake config that prevented it from just working out of the box? I added the cinderblock.xml stuff as a convenience but it’s intended to be a “cmake first / source only” library so anything I can do to make that run more smoothly is always good.

With regard to alpha channels, it’s a requirement of both the software and hardware renderer paths that a BGRA surface/texture is used internally, so if we’re lucky, alpha channel video may be automatically supported if the appropriate codec is installed.

About cmake, I think I was just trying from the wrong folder to start. Worked once I remember how I originally organized things back in cmake rewrite days.

WRT alpha-enabled videos, I did a quick test with the only video I could find that allegedly has an alpha channel (attached on this page) and was sadly presented with a “file not supported” error. Yet, it does play in VLC so FFMPEG supports it - it may be a case of having to enable that MF Transform. Perhaps worth moving this to a github issue and seeing if others know more.

Do you have the HEVC extensions installed? Not ideal to have to install a codec like it’s the DivX days but it may get you out of a pinch where you control the target machine until we can figure out a more general solution.

Edit: I’ve created a ticket here with some relevant URLs for posterity so I’ve got a place to start when I get some time to look at this.

@rich.e I had an hour or two this afternoon to look at this, and while I was able to get HEVC video playing in general by just installing windows’ extensions, video with alpha will load but fails to process frames. My major concern is that since windows media player is also unable to play these files (I assume it’s using the same underlying media engine), so I wonder if VLC has their own HEVC implementation, or if there’s a way to coax media foundation into doing the right thing.

Documentation for this kind of stuff is almost nil, so i’ll keep poking around and see what shakes loose.

Ah, that’s a bummer that it doesn’t process at all. It doesn’t surprise me that Windows Media Player can’t do it since it predates this newer HEVC file format, though I was hoping that somehow there is a way Media Foundation still.

Here is a bit of info I found about ffmpeg’s current status with regards to video with alpha, which is not good either. Appears only apple’s decoder has handled this.

I’d be surprised if there wasn’t some way to do it, I was just hoping it may have been handled upstream by some smarter people :wink:

In my research it seems the state of video + alpha is basically a debacle across the board, I guess it’s been deemed a niche enough concern that no real effort has been made to address it at the codec level. I played around with VP9 but IMFMediaEngine seems to ignore the alpha channel altogether and just returns a solid black background which doesn’t bode well.

The real issue here is documentation and communication, the MF team have just ignored every question i’ve asked them so far and since updates are presumably bound to OS releases I don’t imagine they could be a particularly dynamic team with regard to shipping fixes / new features etc, so even getting a straight answer about if alpha is even supported at the library level is impossible.

Such is the tradeoff for relying on the native OS implementation of things, I guess. I’ll keep playing with this in my free time anyway, but hopefully it still can be a useful general purpose media toolkit, alpha channels notwithstanding.

A

Such is the tradeoff for relying on the native OS implementation of things, I guess. I’ll keep playing with this in my free time anyway, but hopefully it still can be a useful general purpose media toolkit, alpha channels notwithstanding.

I completely agree! That the outside dependencies other than what ships in Windows is why we always wanted to get a MF video impl into core, and also why we already use it for audio decoding / encoding. Here’s to hoping that with a bit more usage and testing we can move towards that. Video + alpha would be great but if it is still considered a niche feature, guess we still just have to look for other more annoyingly difficult solutions when that comes up. But who knows, perhaps someone will read this thread and know some way to make it happen that we don’t.

Cheers,
Rich

Just an FYI, i’ve added a macOS backend to my media player block that wraps cinder’s qtime::MovieSurface / qtime::MovieGl but with the API defined by the media foundation implementation, comes in handy for those of us who still jump around platforms a bit.

2 Likes